Install Steam
login
|
language
简体中文 (Simplified Chinese)
繁體中文 (Traditional Chinese)
日本語 (Japanese)
한국어 (Korean)
ไทย (Thai)
Български (Bulgarian)
Čeština (Czech)
Dansk (Danish)
Deutsch (German)
Español - España (Spanish - Spain)
Español - Latinoamérica (Spanish - Latin America)
Ελληνικά (Greek)
Français (French)
Italiano (Italian)
Bahasa Indonesia (Indonesian)
Magyar (Hungarian)
Nederlands (Dutch)
Norsk (Norwegian)
Polski (Polish)
Português (Portuguese - Portugal)
Português - Brasil (Portuguese - Brazil)
Română (Romanian)
Русский (Russian)
Suomi (Finnish)
Svenska (Swedish)
Türkçe (Turkish)
Tiếng Việt (Vietnamese)
Українська (Ukrainian)
Report a translation problem
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
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
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
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
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'll implement a fix asap
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 :)))
Thanks for the quick turnaround =)
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