Some questions to get me started a bit faster
clankill3r
Join Date: 2007-09-03 Member: 62145Members, NS2 Map Tester, Reinforced - Shadow
in Modding
Hi all,
I just started to mod for NS2 so I have to learn a lot.
I have a few questions, I hope someone can answer.
1.
I want to make changes to xeno, how can I quick research xeno?
Sandbox mode is broken as hell. None of the upgrades work for example (like celerity, cloack etc.) so I prefer not to test in sandbox cause I have no idea what else is broken.
And outside sandbox mode it takes really long to get to biomass 9.
2.
Can I add non moving bots? (dummies)
3.
How can a local function be overwritten?
In my file XenoChange I have:
But it does not seem to overwrite the default TriggerXenocide cause I never see the print in the console.
I load the file with:
That is it for now.
I just started to mod for NS2 so I have to learn a lot.
I have a few questions, I hope someone can answer.
1.
I want to make changes to xeno, how can I quick research xeno?
Sandbox mode is broken as hell. None of the upgrades work for example (like celerity, cloack etc.) so I prefer not to test in sandbox cause I have no idea what else is broken.
And outside sandbox mode it takes really long to get to biomass 9.
2.
Can I add non moving bots? (dummies)
3.
How can a local function be overwritten?
In my file XenoChange I have:
local function TriggerXenocide(self, player) Print("xeno!"); --rest of code
But it does not seem to overwrite the default TriggerXenocide cause I never see the print in the console.
I load the file with:
modEntry = [[ Shared: lua/XenoChange.lua, Priority: 1 ]]
That is it for now.
Comments
2. Use or just place a few dummy objects via or use normal boots and the commands. Overall just use what suits you best.
3. local functions are only locally declared. That means you can't access them via the Global table. This make things a bit tricky. You can access local variables of a globally declared function (called "Upvalues" ) via the debug library. In case you don't want to dig to much into the Lua language you can use utility classes like Elixer (ofc you have to ship those with your mod).
In the end i wouldn't recommend to directly work with stuff like the debug lib at the very start of learning Lua and NS2 modding. So i would suggest to just overload completely for now.
Tip: Have a closer look at the linked Lua book to get used to Lua itself before getting dragged too much into the NS2 code .
Is it save to remove all content in:
C:\Users\Doeke\AppData\Roaming\Natural Selection 2
Cause for some reason I can't load any map anymore. My mod is nothing more then the UberShotgun.
Even if i create a new mod and leave it totally empty and build it then I still can't load any level.
It says:
And then I get a File not Found error.
I checked in explorer and ns_tram.level does exists.
Yes it is safe to remove your NS2 appdata folder (beside that you loose some of your settings). I never heard of a ns2 map named "ns_tram" must be a typo for "ns2_tram", right?
Your help means a lot. Soon I probably need less help...
O damn, yeah I meant ns2_tram
Back to new problems.
1.
I have my own 'XenocideLeap:OnPrimaryAttack(player)' function now which is just a copy of the original with an print in it.
In game I get (when trying to xeno):
I tried to resolve it with adding:
But that does not work. How can I make it see the global function TriggerXenocide?
2.
Is there a way to copy all the content of the console, or save it to a file?
2. All console output should be saved into the log.txt at %appdata%/Natural Selection 2/ (use win + r to get there )
I got Xeno working now lol
I do wonder, if I xenoside then it prints "xeno!!" to the console but it does this a lot of times (27x for example), why is that?
2. Thx, the log makes it so much easier to search and read