• The easiest/best way to develop lua script.
    12 replies, posted
I was wondering what the easiest/Best way to develop lua scripts. I'm getting pretty tired of restarting the map every 10 seconds. Restarting the map is the only way I can check if my vgui/Derma Menu is working properly. As lua_openscript and lua_openscript_cl doesn't update it. If someone knows better way of doing it without having to restart everytime, that'd be awesome!
If your vgui is loaded from the gamemode you might be looking for gamemode_reload and gamemode_reload_cl. Also I find luapad to be quite good at quickly testing vguis and all sorts of scripts. [url]http://www.facepunch.com/showthread.php?t=776712[/url] It's also worth noting that developing with no addons enabled will greatly speed things up.
Umm... lua_openscript_cl [b]does[/b] work. If it's not working for you, you're doing something wrong (and it's by far the easiest method). What're you trying to do?
I'm developing vgui's mostly. Which does NOT work. However, I'm currently testing out luapad, if it works exactly how it's supposed to, it's the best thing ever (besides Garry's Mod).
No, seriously dude, I've made plenty of vguis and I always used lua_openscript_cl. Tell me exactly what you're putting into console and where your file is located.
[QUOTE=Entoros;18195878]No, seriously dude, I've made plenty of vguis and I always used lua_openscript_cl. Tell me exactly what you're putting into console and where your file is located.[/QUOTE] It's true, it really should. Luapad does almost the same thing except it also runs txt files you can edit ingame.
Well, my scripts are located in autorun/blah.lua In the script, I have this: if( SERVER )then AddCSLuaFile("autorun/blah.lua") else include("autorun/blah.lua") end [code] local frame = vgui.Create("DFrame") frame:SetSize(250,250) frame:Center() frame:SetTitle("This is an example frame!") [/code] Then when I go to add buttons or what not, it doesn't update till after I restart the map. =/
frame:SetDeleteOnClose(true) Then close the frame, and open the file with lua_openscript_cl I forget if SDOC is defaulted to true or false.
Since frame is local, it doesn't matter how many he makes, they will be different depending on the script. I think something/someone is conflicting this script.
[QUOTE=Gbps;18196351]Since frame is local, it doesn't matter how many he makes, they will be different depending on the script. I think something/someone is conflicting this script.[/QUOTE] It might simply be the first one never actually closing when reloaded?
I'll have to try that method later, when I'm not using LuaPad =D LuaPad is perfectly awesome. I Love it. Thanks for the help guys!
[QUOTE=Crazy Quebec;18195507]Also I find luapad to be quite good at quickly testing vguis and all sorts of scripts.[/QUOTE] For me, Luapad can not open gamemode files, which greatly annoys me. :V
[QUOTE=Jamie932;18205222]For me, Luapad can not open gamemode files, which greatly annoys me. :V[/QUOTE] I've not actually used Luapad, but this works :P include("gamemodes/GMNAME/script") Assuming the gamemode is the one you are currently playing. If not, try include("../gamemodes/gmname/script")
Sorry, you need to Log In to post a reply to this thread.