Garry's Mod

Garry's Mod

TTT 360 No Scope AWP
 This topic has been pinned, so it's probably important
satrams  [developer] 9 Sep, 2022 @ 10:54pm
[BUGS]
Report any bugs here instead of in the comments so they don't get lost.

Expect a response within a couple days, and if I take longer mention it in the comments or on my profile.

:tobdog:
< >
Showing 1-11 of 11 comments
The Stig 22 Sep, 2022 @ 11:16pm 
Hi, hilarious way nerf to the AWP, I must say. Definitely going to try this out with friends, but I'm using Custom Roles for TTT, and am running into errors:

I have this error whenever I drop the gun:
[TTT 360 No Scope AWP] lua/weapons/ttt_nsawp_gun_base/shared.lua:552: attempt to call method 'KeyDown' (a nil value)
1. unknown - lua/weapons/ttt_nsawp_gun_base/shared.lua:552

As well as this error with Custom Roles for TTT itself:
[Custom Roles for TTT] gamemodes/base/entities/weapons/weapon_base/shared.lua:244: attempt to call method 'GetAmmoCount' (a nil value)
1. Ammo1 - gamemodes/base/entities/weapons/weapon_base/shared.lua:244
2. DrawWeapon - gamemodes/terrortown/gamemode/cl_wepswitch.lua:118
3. Draw - gamemodes/terrortown/gamemode/cl_wepswitch.lua:178
4. unknown - gamemodes/terrortown/gamemode/cl_hud.lua:460

https://steamhost.cn/steamcommunity_com/sharedfiles/filedetails/?id=2421039084
Here's the link to CR's code as well: https://github.com/NoxxFlame/TTT-Custom-Roles
Malivil 23 Sep, 2022 @ 5:04am 
Hi, I'm one of the developers for CR for TTT. It looks like the error is due to us showing the weapon switch UI a bit longer than in base TTT. This causes the Ammo1 method to get called on the weapon after the owner has been set to "nil".

This isn't a problem in vanilla TTT because the weapon switch UI is closed immediately when dropping weapons so it doesn't call Ammo1.

I've made a fix in the next beta version of CR for TTT (coming out later today, most likely) which will fix this error, but one thing you may be able to do to fix it on your side without any adverse effect is to switch from "weapon_base" to "weapon_tttbase" for the TTT version of the weapon. "weapon_tttbase" already protects against this specific situation and should not cause any other problems (as far as I know).

If you don't want to make the change, that's fine =) Like I said, we'll have a fix on our side shortly.

EDIT: I just took a look at your weapon and I can see you're using a custom base that doesn't derive from weapon_base directly. I'm not sure if you can just add weapon_tttbase as a base for your base, but if not you can add the same protection that weapon_tttbase has by copying the Ammo1 function found here into your base: https://github.com/Facepunch/garrysmod/blob/master/garrysmod/gamemodes/terrortown/entities/weapons/weapon_tttbase.lua#L372
Last edited by Malivil; 23 Sep, 2022 @ 5:08am
satrams  [developer] 23 Sep, 2022 @ 7:58am 
Originally posted by Malivil:
Hi, I'm one of the developers for CR for TTT. It looks like the error is due to us showing the weapon switch UI a bit longer than in base TTT. This causes the Ammo1 method to get called on the weapon after the owner has been set to "nil".

This isn't a problem in vanilla TTT because the weapon switch UI is closed immediately when dropping weapons so it doesn't call Ammo1.

I've made a fix in the next beta version of CR for TTT (coming out later today, most likely) which will fix this error, but one thing you may be able to do to fix it on your side without any adverse effect is to switch from "weapon_base" to "weapon_tttbase" for the TTT version of the weapon. "weapon_tttbase" already protects against this specific situation and should not cause any other problems (as far as I know).

If you don't want to make the change, that's fine =) Like I said, we'll have a fix on our side shortly.

EDIT: I just took a look at your weapon and I can see you're using a custom base that doesn't derive from weapon_base directly. I'm not sure if you can just add weapon_tttbase as a base for your base, but if not you can add the same protection that weapon_tttbase has by copying the Ammo1 function found here into your base: https://github.com/Facepunch/garrysmod/blob/master/garrysmod/gamemodes/terrortown/entities/weapons/weapon_tttbase.lua#L372
Hmm interesting.

The custom base just implemented (what I thought was) all the functions called by the ttt base.

I might have missed one or two

I'll look over it this weekend
satrams  [developer] 23 Sep, 2022 @ 7:59am 
Originally posted by The Stig:
Hi, hilarious way nerf to the AWP, I must say. Definitely going to try this out with friends, but I'm using Custom Roles for TTT, and am running into errors:

I have this error whenever I drop the gun:
[TTT 360 No Scope AWP] lua/weapons/ttt_nsawp_gun_base/shared.lua:552: attempt to call method 'KeyDown' (a nil value)
1. unknown - lua/weapons/ttt_nsawp_gun_base/shared.lua:552

As well as this error with Custom Roles for TTT itself:
[Custom Roles for TTT] gamemodes/base/entities/weapons/weapon_base/shared.lua:244: attempt to call method 'GetAmmoCount' (a nil value)
1. Ammo1 - gamemodes/base/entities/weapons/weapon_base/shared.lua:244
2. DrawWeapon - gamemodes/terrortown/gamemode/cl_wepswitch.lua:118
3. Draw - gamemodes/terrortown/gamemode/cl_wepswitch.lua:178
4. unknown - gamemodes/terrortown/gamemode/cl_hud.lua:460

https://steamhost.cn/steamcommunity_com/sharedfiles/filedetails/?id=2421039084
Here's the link to CR's code as well: https://github.com/NoxxFlame/TTT-Custom-Roles
See my previous comment for a possible explanation
I'll look into the missing functions this weekend and see if I can fix both issues at the same time

Thanks for the feedback :tobdog:
Last edited by satrams; 23 Sep, 2022 @ 7:59am
Malivil 23 Sep, 2022 @ 8:02am 
Originally posted by satrams:
Originally posted by Malivil:
Hi, I'm one of the developers for CR for TTT. It looks like the error is due to us showing the weapon switch UI a bit longer than in base TTT. This causes the Ammo1 method to get called on the weapon after the owner has been set to "nil".

This isn't a problem in vanilla TTT because the weapon switch UI is closed immediately when dropping weapons so it doesn't call Ammo1.

I've made a fix in the next beta version of CR for TTT (coming out later today, most likely) which will fix this error, but one thing you may be able to do to fix it on your side without any adverse effect is to switch from "weapon_base" to "weapon_tttbase" for the TTT version of the weapon. "weapon_tttbase" already protects against this specific situation and should not cause any other problems (as far as I know).

If you don't want to make the change, that's fine =) Like I said, we'll have a fix on our side shortly.

EDIT: I just took a look at your weapon and I can see you're using a custom base that doesn't derive from weapon_base directly. I'm not sure if you can just add weapon_tttbase as a base for your base, but if not you can add the same protection that weapon_tttbase has by copying the Ammo1 function found here into your base: https://github.com/Facepunch/garrysmod/blob/master/garrysmod/gamemodes/terrortown/entities/weapons/weapon_tttbase.lua#L372
Hmm interesting.

The custom base just implemented (what I thought was) all the functions called by the ttt base.

I might have missed one or two

I'll look over it this weekend

It's not a missing function, it's just that weapon_base doesn't check that the owner is valid and weapon_tttbase does. If you copy the Ammo1 from that link I provided you'll have the weapon_tttbase implementation without having to actually use weapon_tttbase =)
satrams  [developer] 23 Sep, 2022 @ 8:13am 
Originally posted by Malivil:
Originally posted by satrams:
Hmm interesting.

The custom base just implemented (what I thought was) all the functions called by the ttt base.

I might have missed one or two

I'll look over it this weekend

It's not a missing function, it's just that weapon_base doesn't check that the owner is valid and weapon_tttbase does. If you copy the Ammo1 from that link I provided you'll have the weapon_tttbase implementation without having to actually use weapon_tttbase =)
Oh haha yeah I was referring to the function Ammo1

I'll implement a fix asap
satrams  [developer] 23 Sep, 2022 @ 5:17pm 
Originally posted by Malivil:
Originally posted by satrams:
Hmm interesting.

The custom base just implemented (what I thought was) all the functions called by the ttt base.

I might have missed one or two

I'll look over it this weekend

It's not a missing function, it's just that weapon_base doesn't check that the owner is valid and weapon_tttbase does. If you copy the Ammo1 from that link I provided you'll have the weapon_tttbase implementation without having to actually use weapon_tttbase =)

I pushed an update that literally just adds the ttt base as a 3rd lowest level base.

Hopefully all the features are like working now.

Thanks for all the help, and let me know if anyone still has any issues :)))
Malivil 23 Sep, 2022 @ 5:29pm 
I just tested it on the unpatched version of Custom Roles and the error is fixed.

Thanks for the quick turnaround =)
satrams  [developer] 23 Sep, 2022 @ 6:28pm 
Originally posted by Malivil:
I just tested it on the unpatched version of Custom Roles and the error is fixed.

Thanks for the quick turnaround =)
For sure. Thanks for the posts :tobdog:
The Stig 7 Nov, 2022 @ 4:18pm 
Hey, just letting you know when more than one player has the 360 AWP held, everyone can hear the charge/uncharged sounds continuously. This doesn’t happen with bots, only real players.
satrams  [developer] 15 Mar, 2023 @ 7:01pm 
Originally posted by The Stig:
Hey, just letting you know when more than one player has the 360 AWP held, everyone can hear the charge/uncharged sounds continuously. This doesn’t happen with bots, only real players.

Hey so fun fact I did not see this until now.

Just in case you cared for the update still, I believe I fixed the issue with the chargeup sound playing over and over again. It was a semi-hacky solution but, hey, it worked.

I was not able to reproduce the bug after I made changes, however if you still experience it be sure to let me know.

Thanks again for the help
:tobdog:
< >
Showing 1-11 of 11 comments
Per page: 1530 50