• Modifying TTT HUD
    10 replies, posted
So I tried modifying TTT HUD, but whenever I turn any function off, or modify it or just reload it (without modifying). I get this error [code][ERROR] gamemodes/terrortown/gamemode/cl_hud.lua:258: attempt to index local 'L' (a nil value) 1. InfoPaint - gamemodes/terrortown/gamemode/cl_hud.lua:258 2. unknown - gamemodes/terrortown/gamemode/cl_hud.lua:342 [/code]
Could you post the whole cl_hud.lua. Also did you make any changes to the Language file for ttt.
I didn't even start modifying it, I just put "--" to disable the function in GM:HUDPaint() and then when I saved it, it automatically reloaded and the error started appearing, then I removed the commentary thing, saved and reload again and it was still showing the error
so you put it back to original and its still happening? are you sure you put the file back in the correct place
[QUOTE=Sikvibration;40269141]so you put it back to original and its still happening? are you sure you put the file back in the correct place[/QUOTE] I didnt remove or move the file, I simply editted the one (gamemode/cl_hud.lua)
Whenever you edit a HUD file you need to either rejoin or change the map.
[QUOTE=The Android1;40269815]Whenever you edit a HUD file you need to either rejoin or change the map.[/QUOTE] Yeah, TTT wasn't made to be "lua refreshed". This is a simple workaround you can use to edit the HUD in real time. 1. Open terrortown/gamemode/lang_shd.lua 2. Add this after line 5: [QUOTE]if LANG then return end[/QUOTE] 3. The top of that file should look like this: [QUOTE]if LANG then return end LANG = {}[/QUOTE]
Brandon, that's wrong, I'm pretty sure. I made a HUD of my own, and to identify L I used this code: [lua] local L = GetLang() [/lua] Worked for me, tell me if it didn't. :)
[QUOTE=mib999;40271306]Brandon, that's wrong, I'm pretty sure. I made a HUD of my own, and to identify L I used this code: [lua] local L = GetLang() [/lua] Worked for me, tell me if it didn't. :)[/QUOTE] I don't think you understand. In the current cl_hud.lua, by default that is what L is defined as GetLang() and if you go higher up in the file it uses the LANG table. [IMG]http://puu.sh/2zz93[/IMG] He is reloading it directly from the gamemode, not in a separate file that is outside of the gamemode. If you use the code I provided it will prevent the other language files from reloading therefore preventing your table index error.
Guys, guys. I stopped replying here because I solved this issue alredy, long, long ago. The thing was that TTT from GCF file of garrymod was outputing this error, even when I was running TTT downloaded from the website and not the one shipped with GMod. To fix this, I had to rename both folder and info file.
how did you fix it? I have the same error, when I upload my hud.
Sorry, you need to Log In to post a reply to this thread.