How To Make A Basic Mod?
Bullet_Force
Join Date: 2012-11-02 Member: 165952Members
in Modding
Comments
During the beta making a mod would be simple as creating a folder anywhere, putting some modified game files in it and starting NS2 with -game pathToMyMod option.
The solution I found is to start a dedicated server with -hotload and -mods xyz and disable consistency checking, then start the game with -game and -hotload and connect to the local server. The sound volume goes crazy when the game reload lua files, so I need to set the volume to zero.
If anybody knows a simpler solution, please share.
A short tutorial on how to setup a mod would be nice.
I don't know if -mods is doing something different from -game, it seems to be more of less the same (load the folder content).
- Go into your personal NS2 folder (..\Application Data\Natural Selection 2\) and edit ConsistencyConfig.json to
{
"check": [ ]
}
To disable consistency checking.
- Create a folder anywhere
- Copy the file you want to modify into the folder (keeping the same folder structure as in ..\steamapps\common\natural selection 2\ns2\)
- Launch the game using "...steamapps\common\natural selection 2\NS2.exe" -game "path to your mod" -hotload
- Turn the sound ###### down. Seriously.
Each time you save a file the game will reload the lua.
Neither did I. Actually, the only times I've ever gotten consistency errors is when I've coded something wrong and allowed the Client/Server to see files that only the other should have access to, so if anything it's been helpful.
- Go into your personal NS2 folder (..\Application Data\Natural Selection 2\) and edit ConsistencyConfig.json to
{
"check": [ ]
}
To disable consistency checking.
- Create a folder anywhere
- Copy the file you want to modify into the folder (keeping the same folder structure as in ..\steamapps\common\natural selection 2\ns2\)
- Launch the game using "...steamapps\common\natural selection 2\NS2.exe" -game "path to your mod" -hotload
- Turn the sound ###### down. Seriously.
Each time you save a file the game will reload the lua.<!--QuoteEnd--></div><!--QuoteEEnd-->
What files do I need in this folder?
Currently all I have for my test is:
D:/Test Mod/lua/Balance.lua
D:/Test Mod/lua/BalanceHealth.lua
D:/Test Mod/lua/BalanceMisc.lua
Steam launch option: -game D:\Test Mod -hotload
However when I start a server, I get a 'File Not Found' error.
-game "D:\Test Mod" -hotload
<!--quoteo--><div class='quotetop'>QUOTE </div><div class='quotemain'><!--quotec-->I didn't have to turn off the consistency checks to create a mod.<!--QuoteEnd--></div><!--QuoteEEnd-->
Yeah, I'm not sure if it's necessary for hot reloading, try without it and if you get consistency problems you can always disable it.
-game "D:\Test Mod" -hotload<!--QuoteEnd--></div><!--QuoteEEnd-->
Nope. Deleted everything in the folder, still says 'File not found' when I try to make a server.
Edit: Quote marks didn't seem to help either. =/
By the way, did you follow the tutorial on the wiki for setting up the builder? While the builder itself isn't 100% necessary (I use it just because it's convenient not to have to copy/paste every time I make a change), it does tell you how to get started.
By the way, did you follow the tutorial on the wiki for setting up the builder? While the builder itself isn't 100% necessary (I use it just because it's convenient not to have to copy/paste every time I make a change), it does tell you how to get started.<!--QuoteEnd--></div><!--QuoteEEnd-->
Can you help with this? I tried using the builder setup, and it just says 0 successful, 1 skipped. I have a mod at:
C:\Program Files (x86)\Steam\steamapps\common\Natural Selection 2\Test Mod\Builder
And i am using the builder_setup.xml and the settings are pointing to my mod... do i need to copy all the source files over to their folders? How do I run my mod using the launch pad? Do i have to -hotload -game?
Thanks for your help
I went to My Documents, and created a folder called NS2 Mods. This could be anywhere of course, but for the sake of this example, I'll continue to reffer to this folder as (My Documents/NS2 Mods/).
Then, I copied the NS2 files (steamapps/common/Natural Selection 2/ns2/) into it. Then in the (steamapps/common/Natural Selection 2/) folder, you run launchpad, and hit create mod. Fill in the information.
Whatever you chose to call your mod, for the sake of this example I'll use "MyMod", will appear as a folder. (steamapps/common/Natural Selection 2/MyMod/). In launchpad, the dropdown box should now have the name of your mod in it. If it doesn't, just click the dropdown box and select it.
Builder itself is optional unless you're making custom models/textures, but I think it's convenient because it will copy/paste any changes from (My Documents/NS2 Mods/) to (steamapps/common/Natural Selection 2/ns2/). Otherwise, you just have to do it manually. If you do want to use builder, now's the time that you go to that .xml file and set it up.
Create a new shortcut to (steamapps/common/Natural Selection 2\NS2.exe), and at the end, add " -game MyMod". Again, MyMod being whatever you called your mod.
You're done! Now all you need to do is open decoda (or your editor of choice) and star modding away!
I went to My Documents, and created a folder called NS2 Mods. This could be anywhere of course, but for the sake of this example, I'll continue to reffer to this folder as (My Documents/NS2 Mods/).
Then, I copied the NS2 files (steamapps/common/Natural Selection 2/ns2/) into it. Then in the (steamapps/common/Natural Selection 2/) folder, you run launchpad, and hit create mod. Fill in the information.
Whatever you chose to call your mod, for the sake of this example I'll use "MyMod", will appear as a folder. (steamapps/common/Natural Selection 2/MyMod/). In launchpad, the dropdown box should now have the name of your mod in it. If it doesn't, just click the dropdown box and select it.
Builder itself is optional unless you're making custom models/textures, but I think it's convenient because it will copy/paste any changes from (My Documents/NS2 Mods/) to (steamapps/common/Natural Selection 2/ns2/). Otherwise, you just have to do it manually. If you do want to use builder, now's the time that you go to that .xml file and set it up.
Create a new shortcut to (steamapps/common/Natural Selection 2\NS2.exe), and at the end, add " -game MyMod". Again, MyMod being whatever you called your mod.
You're done! Now all you need to do is open decoda (or your editor of choice) and star modding away!<!--QuoteEnd--></div><!--QuoteEEnd-->
Thanks ill try this and post my results
I'm just trying to get builder to work too
Edit: I can use decoda debugging, but it defaultly starts the main game... is there a good test map that loads quickly? Whats the console command to load a map
Sorry for so many questions
There is a hotload command, but to be honest, I've never gotten it to work. :/
<!--quoteo(post=2024017:date=Nov 14 2012, 09:33 PM:name=sinbu)--><div class='quotetop'>QUOTE (sinbu @ Nov 14 2012, 09:33 PM) <a href="index.php?act=findpost&pid=2024017"><{POST_SNAPBACK}></a></div><div class='quotemain'><!--quotec-->Edit: I can use decoda debugging, but it defaultly starts the main game... is there a good test map that loads quickly? Whats the console command to load a map<!--QuoteEnd--></div><!--QuoteEEnd-->
Console command to load a map is just 'map'. For example, if you wanted to load Summit, type 'map ns2_summit'. As for a test map, I just made one myself. Saves me looooads of time, because I have a crappy comp and it takes ~3 minutes to load a normal map. My test map is just two rooms, each big enough for a res tower, a tech point and a power node.
<!--quoteo(post=2024017:date=Nov 14 2012, 09:33 PM:name=sinbu)--><div class='quotetop'>QUOTE (sinbu @ Nov 14 2012, 09:33 PM) <a href="index.php?act=findpost&pid=2024017"><{POST_SNAPBACK}></a></div><div class='quotemain'><!--quotec-->Sorry for so many questions<!--QuoteEnd--></div><!--QuoteEEnd-->
Nah, it's what the boards are for.
Console command to load a map is just 'map'. For example, if you wanted to load Summit, type 'map ns2_summit'. As for a test map, I just made one myself. Saves me looooads of time, because I have a crappy comp and it takes ~3 minutes to load a normal map. My test map is just two rooms, each big enough for a res tower, a tech point and a power node.
Nah, it's what the boards are for.<!--QuoteEnd--></div><!--QuoteEEnd-->
Cool... Last question about hotload... if i use decoda, and i start without debugging, does it automatically hotload?
Edit: From my testing, it doesnt :-O
Edit 2: Finally, whenever i change something, it kicks me out of the map saying client and server differ. I know that makes sense, but then whats the point of hotloading?
Created folder "steamapps/common/Natural Selection 2/MyMod"
Created a /lua folder, copied Balance, BalanceMisc and BalanceHealth into folder.
Created second NS2 icon.
Added "-game MyMod -hotload" to target.
Start up game. Create server, 2 players on mineshaft. Loads, when initializing it stops with error "File not found". :(
Which file? Just '' or something specific?
It doesn't say any file, just the message as I wrote it. Would be useful if it did.
HOWEVER.
Just got it to work. Decided to try creating server with another map. Click on ns2_mineshaft, and it swapped to "Mineshaft". Guess my game had saved my settings, point to an old file name? Either way its fixed now :<
Thanks.