Definitive guide to running a modded server (Combat, custom maps or otherwise)

MCMLXXXIVMCMLXXXIV Join Date: 2010-04-14 Member: 71400Members
edited April 2013 in Server Discussion
I keep getting queries from server operators who are having trouble getting set up with modded servers (mainly for my mod, Combat) so I thought I would post a proper guide on how to get this set up.

<!--sizeo:3--><span style="font-size:12pt;line-height:100%"><!--/sizeo-->Before you start<!--sizec--></span><!--/sizec-->
<b>How to look up a mod's ID</b>
Log into Steam on your gaming PC, visit the workshop and subscribe to the mod you want to host. Start up NS2 and wait for it to download. Once it has downloaded, look in your workshop folder at C:\Users\<you>\AppData\Roaming\Natural Selection 2\Workshop and look at the most recently updated folders. One of those is probably the right one.

The folders in the workshop are always of the form m<b>4d41f11</b>_1350933140. The bit in bold is the actual Mod ID that you'll be using below.

<b>What you will need</b>
<ul><li>The mod ID of any server mods you want to run (e.g. Combat Mode is 5f35045)</li><li>The names and mod IDs of any custom maps you want to have in your rotation. (e.g. "ns2_co_core" has mod ID "57f5f9a").</li></ul>
<!--sizeo:3--><span style="font-size:12pt;line-height:100%"><!--/sizeo-->Server Hosting Instructions<!--sizec--></span><!--/sizec-->
<ul><li>Get the dedicated server working with regular NS2</li><li>Create a new batch file in your server's directory and put the following in it (<i>Note, you will need to change everything that is marked in <brackets> in the code blocks below:</i>)<!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1-->cd <your server location>
server.exe -config_path "C:\Users\<your username>\AppData\Roaming\Natural Selection 2\<config folder, e.g. combat>" -modstorage "C:\Users\<your username>\AppData\Roaming\Natural Selection 2\Workshop" -mods "<Server Mods, separated by space, if applicable> <Map mods, separated by space>" -map <first map to start> -name "<My Modded Server>"<!--c2--></div><!--ec2--></li><li>Run the batch file</li><li>The server will create new config files in your C:\Users\<your username>\AppData\Roaming\Natural Selection 2\<config folder, e.g. combat> folder and download all the appropriate mods from the Workshop automatically!</li><li>Close the server down and visit this folder with Windows Explorer: c:\Users\<your username>\AppData\Roaming\Natural Selection 2\<config folder, e.g. combat></li><li>Edit MapCycle.json and put something like this inside it, then hit save:
<!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1-->{
  "mods": [ "<Server mod, e.g. >" ],
  "mode": "random",
  "time": 30,
  "maps": [ { "map": "<map name e.g. ns2_co_core>", "mods": [ "<mod ID, e.g. 57f5f9a>" ] },
            { "map": "<map name e.g. ns2_co_core>", "mods": [ "<mod ID, e.g. 57f5f9a>" ] }
            { "map": "<map name e.g. ns2_co_faceoff", "mods": [ "<mod ID, e.g. 4d41f11>" ] } ]
}<!--c2--></div><!--ec2--></li><li>Start the server again. You're now up and running with your Modded Server!</li></ul>
<!--sizeo:4--><span style="font-size:14pt;line-height:100%"><!--/sizeo-->Example Configurations<!--sizec--></span><!--/sizec-->
<b>If you have any good example configurations, please reply below and I'll add them here:</b>

<!--sizeo:3--><span style="font-size:12pt;line-height:100%"><!--/sizeo-->Combat Mode<!--sizec--></span><!--/sizec-->
<b>Launch Command</b>
<!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1-->server.exe -config_path "C:\Users\<you>\AppData\Roaming\Natural Selection 2\combat" -modstorage "C:\Users\<you>\AppData\Roaming\Natural Selection 2\Workshop" -mods "5f35045 55e90a3 4d41f11 4fd7fd4 57c685f 57f5f9a 662442f" -map ns2_co_core -name "Combat Mode Server"<!--c2--></div><!--ec2-->

<b>MapCycle.json</b>
<!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1-->{
  "mods": [ "5f35045" ],
  "mode": "random",
  "time": 30,
  "maps": [ { "map": "ns2_co_Core", "mods": [ "57f5f9a" ] },
            { "map": "ns2_pulsecombat", "mods": [ "57c685f" ] },
            { "map": "ns2_summitcombat", "mods": [ "4fd7fd4" ] },
            { "map": "ns2_co_veilcombat", "mods": [ "662442f" ] },
            { "map": "ns2_chuteout", "mods": [ "55e90a3" ] },
            { "map": "ns2_co_faceoff", "mods": [ "4d41f11" ] } ]
}<!--c2--></div><!--ec2-->

Comments

  • ViperXVIIViperXVII Join Date: 2012-11-13 Member: 170382Members
    Thanks for this, I wish I'd found it sooner, instead of having to waddle through 1 hour's worth of wiki and forum threads cross-checking to verify whether server.xml still exists, whether it should be run from command line ... etc

    A question for us rent-a-server guys,

    Is there any way to set relative paths? I cannot set the whole "C:\appdata ..." since I cannot see it. Can config_path be ".\config" ?

    It's beyond me why all these folders are not in the same directory to begin with by default, but for people without access to the whole machine, it makes administration a tiresome process as we have to request changes from the host.

    Thanks again
  • ZaggyZaggy NullPointerException The Netherlands Join Date: 2003-12-10 Member: 24214Forum Moderators, NS2 Playtester, Reinforced - Onos, Subnautica Playtester
    edited November 2012
    I believe this is sticky worthy!
  • JektJekt Join Date: 2012-02-05 Member: 143714Members, Squad Five Blue, Reinforced - Shadow
    edited November 2012
    Thank you!
    The dedicated server wiki needs some serious work.
  • ScardyBobScardyBob ScardyBob Join Date: 2009-11-25 Member: 69528Forum Admins, Forum Moderators, NS2 Playtester, Squad Five Blue, Reinforced - Shadow, WC 2013 - Shadow
    <!--quoteo(post=2021953:date=Nov 13 2012, 03:40 AM:name=ViperXVII)--><div class='quotetop'>QUOTE (ViperXVII @ Nov 13 2012, 03:40 AM) <a href="index.php?act=findpost&pid=2021953"><{POST_SNAPBACK}></a></div><div class='quotemain'><!--quotec-->A question for us rent-a-server guys,

    Is there any way to set relative paths? I cannot set the whole "C:\appdata ..." since I cannot see it. Can config_path be ".\config" ?

    It's beyond me why all these folders are not in the same directory to begin with by default, but for people without access to the whole machine, it makes administration a tiresome process as we have to request changes from the host.<!--QuoteEnd--></div><!--QuoteEEnd-->
    Yup, just change the directory for the -config_path and -modstorage to whatever you want. The only thing you can't currently change the path for is the server log.txt (it always defaults to your appdata directory).
  • ZaggyZaggy NullPointerException The Netherlands Join Date: 2003-12-10 Member: 24214Forum Moderators, NS2 Playtester, Reinforced - Onos, Subnautica Playtester
    edited November 2012
    Can anyone confirm if this works for 229 and if it works with Linux and wine?
  • MCMLXXXIVMCMLXXXIV Join Date: 2010-04-14 Member: 71400Members
    edited November 2012
    I think it still works. I can't update the title though... Can a moderator do it? Maybe we should just remove the [Build 228] and I'll try and keep it up to date.
  • ZaggyZaggy NullPointerException The Netherlands Join Date: 2003-12-10 Member: 24214Forum Moderators, NS2 Playtester, Reinforced - Onos, Subnautica Playtester
    <!--quoteo(post=2025060:date=Nov 15 2012, 11:34 PM:name=MCMLXXXIV)--><div class='quotetop'>QUOTE (MCMLXXXIV @ Nov 15 2012, 11:34 PM) <a href="index.php?act=findpost&pid=2025060"><{POST_SNAPBACK}></a></div><div class='quotemain'><!--quotec-->I think it still works. I can't update the title though... Can a moderator do it? Maybe we should just remove the [Build 228] and I'll try and keep it up to date.<!--QuoteEnd--></div><!--QuoteEEnd-->

    Mod here, I'll remove the build part.
  • CoTTonCoTTon Join Date: 2005-02-28 Member: 42773Members
    How many times does it update?

    It seems I have to restart the server like twice a day.
  • MCMLXXXIVMCMLXXXIV Join Date: 2010-04-14 Member: 71400Members
    edited November 2012
    I've updated the Combat Mode startup configuration on here.
    Also, modded servers do tend to need updating at least once a day as the mods and associated maps tend to change quite regularly. I find that it's easiest to do this with a scheduled task that closes and restarts the server and runs once a day, when people in your region are normally asleep!
  • MGS-3MGS-3 France Join Date: 2006-11-11 Member: 58540Members, NS2 Playtester, Reinforced - Supporter, Reinforced - Onos, Subnautica Playtester
    edited November 2012
    Thx for contacting ns2fr about our co_server problem. The problem is in your guide though.

    <!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1-->"maps": [ { "map": "ns2_co_core", "mods": [ "57f5f9a" ] },<!--c2--></div><!--ec2-->

    needs to be

    <!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1-->"maps": [ { "map": "ns2_co_Core", "mods": [ "57f5f9a" ] },<!--c2--></div><!--ec2-->

    It's case sensitive
  • MCMLXXXIVMCMLXXXIV Join Date: 2010-04-14 Member: 71400Members
    <!--quoteo(post=2036615:date=Nov 28 2012, 06:47 PM:name=MGS-3)--><div class='quotetop'>QUOTE (MGS-3 @ Nov 28 2012, 06:47 PM) <a href="index.php?act=findpost&pid=2036615"><{POST_SNAPBACK}></a></div><div class='quotemain'><!--quotec-->Thx for contacting ns2fr about our co_server problem. The problem is in your guide though.

    <!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1-->"maps": [ { "map": "ns2_co_core", "mods": [ "57f5f9a" ] },<!--c2--></div><!--ec2-->

    needs to be

    <!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1-->"maps": [ { "map": "ns2_co_Core", "mods": [ "57f5f9a" ] },<!--c2--></div><!--ec2-->

    It's case sensitive<!--QuoteEnd--></div><!--QuoteEEnd-->

    Thanks for the tip! Guide is updated...
  • BigTracerBigTracer Join Date: 2012-12-04 Member: 174169Members
    I want to make a note for everyone.
    server.exe -config_path "C:\Users\<your username>\AppData\Roaming\Natural Selection 2\<config folder, e.g. combat>" -modstorage "C:\Users\<your username>\AppData\Roaming\Natural Selection 2\Workshop" -mods "<Server Mods, separated by space, if applicable> <Map mods, separated by space>" -map <first map to start> -name "<My Modded Server>"

    This is a SINGLE string. Don't edit it with enters. Or you're gonna look for mistakes for several #### hours.
  • redvegaredvega Join Date: 2013-04-21 Member: 184921Members
    Renting a server currently. For some reason I keep getting "verify game cache". Where should -config_path point on a rented server? I don't seem to have a \ns2\combat folder or anything.
  • MCMLXXXIVMCMLXXXIV Join Date: 2010-04-14 Member: 71400Members
    config_path points to "c:\users\<user>\appdata\roaming\natural selection 2" by default. If you want to store your config inside a different folder just set the -config_path to that folder (either relative or absolute path). The same with -modstorage I think?

    Disclaimer: I'm not a server op, some of those guys may have some better advice!
  • redvegaredvega Join Date: 2013-04-21 Member: 184921Members
    I set it to my normal \config path which houses all of my other configurations. It doesn't seem to have any effect on the "verify your game cache" error. I tried deleting all mods, and the server works just fine with just ns2, so It has to be an error with the combat mod. I also ended up reloading them, verified that all mod id's were correct, and it didn't seem to have any affect. Any other ideas?
  • redvegaredvega Join Date: 2013-04-21 Member: 184921Members
    Phew! By systematically adding mods one at a time, I narrowed it down to the ns2stats mod. That broke everything. I removed that, and now all is well. Yay!
  • ScardyBobScardyBob ScardyBob Join Date: 2009-11-25 Member: 69528Forum Admins, Forum Moderators, NS2 Playtester, Squad Five Blue, Reinforced - Shadow, WC 2013 - Shadow
    Currently, ns2stats and combat mod don't work together. I believe both mod makers are working on fixing that, but don't know the eta.
  • MCMLXXXIVMCMLXXXIV Join Date: 2010-04-14 Member: 71400Members
    I think that with the current Combat codebase that's not going to be possible, but we're depending on it for our rewrite! I'm hoping we're nearly at the point where we can link the two together but I need to talk to them about how we can avoid muddying the regular stats with our combat stats and I think they'll need to define one of Andi's new .entry files if they haven't already.
  • MCMLXXXIVMCMLXXXIV Join Date: 2010-04-14 Member: 71400Members
    Bump... what happened to the sticky here?
  • ScardyBobScardyBob ScardyBob Join Date: 2009-11-25 Member: 69528Forum Admins, Forum Moderators, NS2 Playtester, Squad Five Blue, Reinforced - Shadow, WC 2013 - Shadow
    MCMLXXXIV wrote: »
    Bump... what happened to the sticky here?
    The number of them were getting out of control, so Complex cleaned them up and linked them in this mega post: http://forums.unknownworlds.com/discussion/130104/links-to-important-info#latest
  • WyzcrakWyzcrak Pot Pie Aficionado Join Date: 2002-12-04 Member: 10447Forum Moderators, Constellation, NS2 Playtester, Squad Five Blue
    Can I host NS2 and CO on the same server? Like so?
    {
        "mods": [ ],
        "time": 30,
        "mode": "random",
        "maps": [ 
    		{ "map": "ns2_summit" }
                    , { "map": "ns2_co_faceoff", "mods": [ "4d41f11 5f35045" ] }
    		]
    }
    

    I don't want the Combat modid on that first line of MapCycle.json, as I don't want to run CO on every map.

    With this MapCycle.json, I can change to ns2_co_faceoff only when the ns2_co_faceoff modid is the only modid on that line. Once I add the CO modid (two modids on the same line, space-delimited), the changemap fails with server and client errors (clients are disconnected with "File not found"):
    SERVER ERROR:
    Client disconnected (127.0.0.1) File not found
    [Server] Script Error #16: lua/Gamerules_Global.lua:40: attempt to index a nil value
        Call stack:
        #1: lua/Gamerules_Global.lua:40
            client = ServerClient { }
    
    CLIENTS ERROR:
    Error: Couldn't mount '4d41f11 5f35045' from path 'C:/Program Files (x86)/Steam/steamapps/common/natural selection 2/4d41f11 5f35045' as the path does not exist
    

    The same MapCycle.json (that has both modids on the ns2_co_faceoff line and generates errors on changemap) allows me to start the server with "-map ns2_co_faceoff" just fine, and things play perfectly, but the server and client errors (and disconnections) return the next time I change the map to ns2_co_faceoff.

    So, is it fair of me to want NS2 and CO on the same server, depending on the map?
  • remiremi remedy [blu.knight] Join Date: 2003-11-18 Member: 23112Members, Super Administrators, Forum Admins, NS2 Developer, NS2 Playtester
    edited May 2013
    Wyz have you tried separating those mods by a comma? e.g. "4d41f11", "5f35045"

    The lua looks like it should handle that properly, as it's not doing anything different for the global vs. the map specific ones. It seems like the problem is that it's just incorrectly interpreting the two mods as one mod, but the [ ... ] syntax appears to indicate a comma delim array so that should work...
        // Copy the global defined mods.
        if type(cycle.mods) == "table" then
            table.copy(cycle.mods, mods, true)
        end
        
        local mapName = GetMapName(map)
        if type(map) == "table" and type(map.mods) == "table" then
            table.copy(map.mods, mods, true)
        end
    

  • FalcomFalcom Join Date: 2012-12-17 Member: 175359Members
    edited May 2013
    Hello :)
    I have a problem with your mod i can't download it. I get this error:

    dlcbt.png

    So i have download the mod with my ns2 steam account and copying files in the workshop server folder but when i launch my server that erase all the files and trying to download the mod. Can you help me please ?

    Thank you
  • MCMLXXXIVMCMLXXXIV Join Date: 2010-04-14 Member: 71400Members
    I've found that this fixes itself if I stop and start the server a couple of times - it eventually manages to download the mod a piece at a time...
  • kais_4kais_4 Join Date: 2012-08-31 Member: 157127Members, Reinforced - Shadow
    Thanks heaps for the guide!! Used it to add some extra maps to my server! Much appreciated :D
Sign In or Register to comment.