How To Make A Basic Mod?

Bullet_ForceBullet_Force Join Date: 2012-11-02 Member: 165952Members
What would be the steps I would need to do to make a mod that rename the Marine Armoury to "Store"?

I am looking for a basic guide to get started but can't find one.

Also when you download a mod where abouts on your computer is it stored?

Comments

  • CloudwolfCloudwolf Join Date: 2012-11-11 Member: 169690Members
    if you download a mod from the workshop it goes to %appdata% Natural Selection2 workshop and then saves under a name like m66254345_morenumbers
  • DghelneshiDghelneshi Aims to surpass Fana in post edits. Join Date: 2011-11-01 Member: 130634Members, Squad Five Blue, Reinforced - Shadow
    Have no time to get a guide going right now. To rename stuff you will have to edit the translation strings in the gamestrings folder.
  • YuukiYuuki Join Date: 2010-11-20 Member: 75079Members
    I find the current workflow to be a pain in the ass, with workshop, consistency checking, hotload, ...

    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.
  • DghelneshiDghelneshi Aims to surpass Fana in post edits. Join Date: 2011-11-01 Member: 130634Members, Squad Five Blue, Reinforced - Shadow
    @Yuuki: Why would you ever use the workshop for development builds of mods? Does the dedicated server not support "-game xyz" anymore? Why not use a listen server via "map ns2_something" in console?
  • YuukiYuuki Join Date: 2010-11-20 Member: 75079Members
    I was kicked out of the game by the consistency checking with a listen server. But now that I disabled it, maybe it works. I'll give it a try.

    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).
  • ChaosXBeingChaosXBeing Join Date: 2012-10-12 Member: 162114Members
    I use -game myself, and it works fine. (Didn't even know -mod was an option.) Though, on that subject, how exactly do you use hotload? I've tried to use it a few times, but it's never seemed to do anything. It can be a pain to start the game and wait for the client and server to load, only to then find out that I've typo-ed some method name and have to close everything, capitalize a name, and then relaunch everything.
  • YuukiYuuki Join Date: 2010-11-20 Member: 75079Members
    edited November 2012
    So here is how to make a mod:

    - 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.
  • WilsonWilson Join Date: 2010-07-26 Member: 72867Members
    I didn't have to turn off the consistency checks to create a mod.
  • ChaosXBeingChaosXBeing Join Date: 2012-10-12 Member: 162114Members
    <!--quoteo(post=2021184:date=Nov 12 2012, 04:02 PM:name=Wilson)--><div class='quotetop'>QUOTE (Wilson @ Nov 12 2012, 04:02 PM) <a href="index.php?act=findpost&pid=2021184"><{POST_SNAPBACK}></a></div><div class='quotemain'><!--quotec-->I didn't have to turn off the consistency checks to create a mod.<!--QuoteEnd--></div><!--QuoteEEnd-->

    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.
  • TimMcTimMc Join Date: 2012-02-06 Member: 143945Members
    <!--quoteo(post=2021152:date=Nov 12 2012, 02:28 PM:name=Yuuki)--><div class='quotetop'>QUOTE (Yuuki @ Nov 12 2012, 02:28 PM) <a href="index.php?act=findpost&pid=2021152"><{POST_SNAPBACK}></a></div><div class='quotemain'><!--quotec-->So here is how to make a mod:

    - 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.
  • YuukiYuuki Join Date: 2010-11-20 Member: 75079Members
    You don't need any files I think. Try like this maybe:

    -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.
  • TimMcTimMc Join Date: 2012-02-06 Member: 143945Members
    edited November 2012
    <!--quoteo(post=2021312:date=Nov 12 2012, 04:36 PM:name=Yuuki)--><div class='quotetop'>QUOTE (Yuuki @ Nov 12 2012, 04:36 PM) <a href="index.php?act=findpost&pid=2021312"><{POST_SNAPBACK}></a></div><div class='quotemain'><!--quotec-->You don't need any files I think. Try like this maybe:

    -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. =/
  • ChaosXBeingChaosXBeing Join Date: 2012-10-12 Member: 162114Members
    edited November 2012
    I copied the entire ns2 folder. (That being, Natural Selection 2/ns2.) I don't think it's necessary, but it does make it easier when you want to look through the vanilla files for reference. It's also good practice not to edit any of the vanilla files, instead creating your own and calling Class_ReplaceMethod when you need to edit existing methods.


    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.
  • sinbusinbu Join Date: 2003-02-02 Member: 12994Members, Constellation, Reinforced - Shadow
    <!--quoteo(post=2021406:date=Nov 12 2012, 08:34 PM:name=ChaosXBeing)--><div class='quotetop'>QUOTE (ChaosXBeing @ Nov 12 2012, 08:34 PM) <a href="index.php?act=findpost&pid=2021406"><{POST_SNAPBACK}></a></div><div class='quotemain'><!--quotec-->I copied the entire ns2 folder. (That being, Natural Selection 2/ns2.) I don't think it's necessary, but it does make it easier when you want to look through the vanilla files for reference. It's also good practice not to edit any of the vanilla files, instead creating your own and calling Class_ReplaceMethod when you need to edit existing methods.


    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
  • ChaosXBeingChaosXBeing Join Date: 2012-10-12 Member: 162114Members
    Let me just tell you exactly the steps I did.

    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!
  • sinbusinbu Join Date: 2003-02-02 Member: 12994Members, Constellation, Reinforced - Shadow
    <!--quoteo(post=2023932:date=Nov 14 2012, 09:15 PM:name=ChaosXBeing)--><div class='quotetop'>QUOTE (ChaosXBeing @ Nov 14 2012, 09:15 PM) <a href="index.php?act=findpost&pid=2023932"><{POST_SNAPBACK}></a></div><div class='quotemain'><!--quotec-->Let me just tell you exactly the steps I did.

    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
  • WilsonWilson Join Date: 2010-07-26 Member: 72867Members
    All I did was create a folder in "..steamapps/common/Natural Selection 2/" called mymod, then put my lua folder inside that. Then run the game with launch option -game mymod and it will use your lua files from that folder. You don't need to copy the entire lua directory, only the files you want to modify.
  • sinbusinbu Join Date: 2003-02-02 Member: 12994Members, Constellation, Reinforced - Shadow
    <!--quoteo(post=2023964:date=Nov 14 2012, 09:46 PM:name=Wilson)--><div class='quotetop'>QUOTE (Wilson @ Nov 14 2012, 09:46 PM) <a href="index.php?act=findpost&pid=2023964"><{POST_SNAPBACK}></a></div><div class='quotemain'><!--quotec-->All I did was create a folder in "..steamapps/common/Natural Selection 2/" called mymod, then put my lua folder inside that. Then run the game with launch option -game mymod and it will use your lua files from that folder. You don't need to copy the entire lua directory, only the files you want to modify.<!--QuoteEnd--></div><!--QuoteEEnd-->

    I'm just trying to get builder to work too
  • sinbusinbu Join Date: 2003-02-02 Member: 12994Members, Constellation, Reinforced - Shadow
    edited November 2012
    Works fine. What's the best way to push lua code changes? Do I have to restart the client every time?

    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
  • ChaosXBeingChaosXBeing Join Date: 2012-10-12 Member: 162114Members
    <!--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-->Works fine. What's the best way to push lua code changes? Do I have to restart the client every time?<!--QuoteEnd--></div><!--QuoteEEnd-->

    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.
  • sinbusinbu Join Date: 2003-02-02 Member: 12994Members, Constellation, Reinforced - Shadow
    edited November 2012
    <!--quoteo(post=2024096:date=Nov 14 2012, 11:58 PM:name=ChaosXBeing)--><div class='quotetop'>QUOTE (ChaosXBeing @ Nov 14 2012, 11:58 PM) <a href="index.php?act=findpost&pid=2024096"><{POST_SNAPBACK}></a></div><div class='quotemain'><!--quotec-->There is a hotload command, but to be honest, I've never gotten it to work. :/



    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?
  • TimMcTimMc Join Date: 2012-02-06 Member: 143945Members
    Bah, looks like NS2 doesn't want me to mod it. May just hang my hat on this and give up.


    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". :(
  • ChaosXBeingChaosXBeing Join Date: 2012-10-12 Member: 162114Members
    <!--quoteo(post=2025119:date=Nov 15 2012, 06:51 PM:name=TimMc)--><div class='quotetop'>QUOTE (TimMc @ Nov 15 2012, 06:51 PM) <a href="index.php?act=findpost&pid=2025119"><{POST_SNAPBACK}></a></div><div class='quotemain'><!--quotec-->Start up game. Create server, 2 players on mineshaft. Loads, when initializing it stops with error "File not found". :(<!--QuoteEnd--></div><!--QuoteEEnd-->


    Which file? Just '' or something specific?
  • TimMcTimMc Join Date: 2012-02-06 Member: 143945Members
    <!--quoteo(post=2025429:date=Nov 16 2012, 12:02 AM:name=ChaosXBeing)--><div class='quotetop'>QUOTE (ChaosXBeing @ Nov 16 2012, 12:02 AM) <a href="index.php?act=findpost&pid=2025429"><{POST_SNAPBACK}></a></div><div class='quotemain'><!--quotec-->Which file? Just '' or something specific?<!--QuoteEnd--></div><!--QuoteEEnd-->

    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.
Sign In or Register to comment.