Script.Load()
Vitdom
Join Date: 2012-04-30 Member: 151345Members, Reinforced - Supporter, Reinforced - Silver, Reinforced - Gold, Reinforced - Diamond, Reinforced - Shadow, WC 2013 - Shadow
in Modding
I have seen some other mods which add code to a file like this:
Server.lua
<!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1-->Script.Load("lua/Server.lua")
// Additional mod code here<!--c2--></div><!--ec2-->
But when I do this everything breaks, even with a clean file, with nothing but Script.Load("lua/Server.lua") in it.
Am I using Script.Load() incorrectly or am I doing some other thing wrong?
Server.lua
<!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1-->Script.Load("lua/Server.lua")
// Additional mod code here<!--c2--></div><!--ec2-->
But when I do this everything breaks, even with a clean file, with nothing but Script.Load("lua/Server.lua") in it.
Am I using Script.Load() incorrectly or am I doing some other thing wrong?
Comments
Can you post a bit more example code?
Script.Load() simply loads and parses the file into the Lua environment.
Server.exe does not output any errors at all, and stuff seem to run fine. But any commands inputted does not execute, e.g. "sv_changemap ns2_tram, cyclemap, cheats 1, addbot, sv_password testpass". Connecting to the server as a client works fine though.
Output: <a href="http://pastebin.com/855pVsz7" target="_blank">http://pastebin.com/855pVsz7</a>
(I haven't updated to 231 yet)
I later added Shared.Message("MOD-SERVER.LUA") into the mod and Shared.Message("ORIGINAL-SERVER.LUA") into the original file, and only MOD-SERVER.LUA is printed into the console.
If you have lua files in your mod folder that have the same name as the NS2 original files it will only use the one in the mod.