RUNNING WITH RIFLES

RUNNING WITH RIFLES

Not enough ratings
How to host a Dedicated Server
By ElaN
This is a comprehensive guide on how to run the legacy PvP game modes by setting up a dedicated server.
2
   
Award
Favorite
Favorited
Unfavorite
Introduction
Running with Rifles isn't just all about Invasion and Dominance. The game also features a number of legacy PvP game modes such as Team Elimination, Deathmatch, Minimodes and Teddy Hunt.

You can learn more by taking a look at the Running with Rifles Wiki.[runningwithrifles.gamepedia.com]

Common to all these legacy game modes is that they only can be played through dedicated servers. By reading this guide, you will learn how to set up such a server and run any of the game modes mentioned above. You will also get knowledge about configuring various server parameters.

This guide is aimed at Windows users only. Make sure to read through and understand the instructions before attempting to follow out the steps. Also see the troubleshooting tips at the end of the guide.

Port Forwarding
Before you proceed, keep in mind that you need to port forward in order to host a dedicated server on your computer. Without doing so, other computers won't be able to connect to your server. You can read more about port forwarding here.[superuser.com]

For instructions on how to port forward, take a look at this page.[portforward.com]Find your router and follow the instructions.

This is what the port forwarding rule for RWR looks like on my router. The interface will differ between routers, but the basic principles are pretty much the same.

  • First you give your forwarded port a name. In my case, it's RWR.
  • Choose UDP as your protocol.
  • The interface where you choose which port(s) to open probably won't look the same on your router. In any case, I've chosen to go with port 1234, but you can open any port you want.
  • The Destination IP is your IPv4 Adress. You can find out what it is by doing the following:
    Press the Windows Key and R at the same time Type cmd in the window and press Enter In the Command Prompt, type ipconfig and press Enter

Pick the correct IPv4 Adress depending on if you are connected by WiFi or Ethernet. Keep in mind that if you port forward using, for example, the Ethernet IPv4, you have to be connected by Ethernet when hosting the server. The same goes for a wireless connection. You can create port forwarding rules for both Ethernet and WiFi if you want.

Getting Started
When you have gotten the port forwarding out of the way, it's time to start working towards setting up the dedicated server. As of the 1.70 update, Deathmatch and Minimodes have been ported to AngelScript. This means they can be launched directly from the server console in the root folder, instead of through run_dedicated_server.bat below. Regardless of which game mode you want to play, start off by downloading the following zip file.

https://www.dropbox.com/s/p7emfsngwtm3xe5/dedicated_server.zip?dl=0

It contains the following files:


Head over to the RunningWithRifles root folder, default location being
C:\Program Files (x86)\Steam\steamapps\common\RunningWithRifles
and do the following:
  • Place tools in the root folder. It's necessary in order to execute php scripts.

  • Place commands.xml in the root folder. This file will come in handy later when launching servers. Instead of typing the entire name of the script you want to run, you'll be able to use an alias.

  • Place geoinfo.xml in the root folder, and edit it using Notepad or any other software of your liking. Replace Greyland with your preferred location. This file determines what will show in the Country column in the server list.[rwr.runningwithrifles.com]

  • Place run_dedicated_server.bat in the root folder. This is where you'll later launch your Team Elimination or Teddy Hunt server. You can change the name if you want, but make sure to keep the .bat extension.

At last, you want to head over to
C:\Program Files (x86)\Steam\steamapps\common\RunningWithRifles\media\packages\vanilla\scripts.legacy

You will see a file named admin_settings.example.php. Take a copy of this file and rename the copy to admin_settings.php. Open the file and add your in-game name to it, while removing the others. The name should be UPPERCASE. This will make you an admin on your server.

At this point, you have completed all general steps required to host a dedicated server. Next up, we will take a look at how you launch each respective game mode.

Team Elimination
First off is Team Elimination. Before launching the server, you need to customize the server settings. Navigate to
C:\Program Files (x86)\Steam\steamapps\common\RunningWithRifles\media\packages\vanilla\scripts.legacy

Take a copy of the file server_settings_team_elimination.example.php and rename the copy to server_settings_team_elimination.php. Open this file with Notepad, it will look like this:


This is where you customize the server settings.
  • Choose a name for your server.
  • Make sure to set the port to the same one you port forwarded.
  • The comment will show up in the Comment column in the server list.
  • If you want your server to show up in the server list, set register_in_serverlist to 1.
  • To regulate the amount of players on your server, add
    " max_players='12'" .
    like in the image above. This parameter is not a part of the default file. Replace 12 with the player count you want.

Once you have customized the server settings, you are ready to launch the server. Open run_dedicated_server.bat, which you put in the root folder earlier, by double clicking on it. When it's done loading, type te in the console and press Enter. After some further loading, type /start as prompted. Your server is now running and can be found in the public server list. Type exit in the console to take the server down.




You can edit the amount of RP and XP every player will start with when joining the server, as well as disabling FoV (enabled by default). Head over to
C:\Program Files (x86)\Steam\steamapps\common\RunningWithRifles\media\packages\vanilla\scripts.legacy\gamemodes\team_elimination
and open the file map_rotator_team_elimination.php.

Scroll down until you find the following section:


Change $initial_rp and $initial_xp to your liking. 0.4 corresponds to 4000 XP. You can also edit the other parameters if you want.

To disable FoV, find this part of the file:


Set "fov='1'" . to 0.


Modded Team Elimination

Now on to some more advanced stuff. You might for example want to enable a faction's stock weapons in the armory for both factions to use. In vanilla Team Elimination, each faction only has access to its own stock weapons by default. To do this, navigate to
C:\Program Files (x86)\Steam\steamapps\common\RunningWithRifles\media\packages\pvp\factions

Open common.resources. This file regulates what equipment all factions will have access to. This is what adding the M16, AK47 and G36 will look like:


You can find out the name of each weapon by for example looking at all_weapons.xml in
C:\Program Files (x86)\Steam\steamapps\common\RunningWithRifles\media\packages\vanilla\weapons

Notice the difference between the two files. In common.resources it says
<weapon key='m16a4.weapon' />, compared to <weapon file="m16a4.weapon" /> in all_weapons.xml. In other words, you can't blindly copy weapons from all_weapons.xml to common.resources as it won't work. Also keep in mind that you can only enable stock faction weapons in the armory using this method. These weapons are enabled in the armory by default, which is not the case with rare ones.

To add rare weapons, you need to create a mod where you include the .weapon file for the rare gun. With the .weapon file you can make the rare weapon available in the armory. The mod then has to be distributed to the people who are going to play on your Team Elimination server. The Pepperdust in PVP1_v2 is an example of this.

This brings us to the next point. You might want to play a custom map on your Team Elimination server. PVP1_v2, which is available on Steam Workshop, is currently the only existing one. Launching any vanilla map on your TE server will not work.

https://steamcommunity.com/sharedfiles/filedetails/?id=938694617

Start off by downloading the map above. Then make your way to
C:\Program Files (x86)\Steam\steamapps\common\RunningWithRifles\media\packages
and take a backup of the pvp folder. Store it somewhere safe.

Next, head to
C:\Program Files (x86)\Steam\steamapps\workshop\content\270150\938694617\media\packages
Copy the pvp folder and use it to replace the one you just backed up.

Navigate to
C:\Program Files (x86)\Steam\steamapps\common\RunningWithRifles\media\packages\vanilla\scripts.legacy\gamemodes\team_elimination
and open map_rotator_team_elimination.php.

Scroll down to this section of the file and replace pvp1 with pvp1_v2


Now you are done. Launch Team Elimination and the server should run PVP1_v2 instead of PVP1, which is the vanilla map in Team Elimination.

If you want, you can create a .txt file named steam_workshop_items.txt and place it in the root folder. Open it and add the following number:
938694617

This will make clients automatically download PVP1_v2 from the Workshop when attempting to join your server for the first time.

Deathmatch
Unlike Team Elimination, Deathmatch can now be launched directly in the server console. Navigate to
C:\Program Files (x86)\Steam\steamapps\common\RunningWithRifles\media\packages\deathmatch\scripts
Then open open start_deathmatch_server.as and edit the server parameters to your liking. Refer to the earlier image of server parameters for Team Elimination.

When you have customized the server settings, head to
C:\Program Files (x86)\Steam\steamapps\common\RunningWithRifles
and open rwr_server.exe Type dm in the console once it's done loading. After some further loading, your server should be running. Take the server down by typing exit in the console.

FoV is enabled by default in Deathmatch. If you want to turn it off, make your way to
C:\Program Files (x86)\Steam\steamapps\common\RunningWithRifles\media\packages\deathmatch\scripts
and open map_rotator_deathmatch.as.

Scroll towards the bottom of the file. It should look like this:


Disable FoV by setting " fov='1'"; to 0.

In the same file you can change the initial XP and RP for each player. Scroll up a bit until you see this section:


Edit match.m_initialXp and match.m_initialRp to your liking. XP and RP reset at every map change.

Deathmatch can be played on four maps; map15 (Islet of Eflen), map11 (Copehill Down), map7 (Power Junction) and map16 (Green Coast). The map rotation is random, but you can edit the round timer for each map. The default time is 30 minutes. Find this part of the file (in this case for map15):


Add =1200 like on the image above and replace 1200 with the time of your choice (in seconds).

If you want to change the round timer for all maps at once, make your way back to
C:\Program Files (x86)\Steam\steamapps\common\RunningWithRifles\media\packages\deathmatch\scripts
and open start_deathmatch_server.as.

Replace 1800.0; with the time you want (in seconds).


Unlike Team Elimination, you can enable rare weapons in Deathmatch and have them show up in the armory for other players, without having to make a mod. To do this, navigate to
C:\Program Files (x86)\Steam\steamapps\common\RunningWithRifles\media\packages\deathmatch\scripts
and open weapons.xml.

Add a weapon by pasting this:
<weapon file="microgun.weapon"> <commonness value="0.0003" in_stock="1" /> </weapon>
into the file, like on the image below.



Replace microgun.weapon with the name of the rare gun. Refer to all_weapons.xml in
C:\Program Files (x86)\Steam\steamapps\common\RunningWithRifles\media\packages\vanilla\weapons

Set in_stock to 1 if you want the gun to show up in the armory. Commoness value is the probability of a player randomly respawning with the gun. If you want, you can have a gun not show up in the armory and instead increase the commoness value.

By default you can't respawn with the rare guns you add, although this can be changed. Add this additional parameter to be able to respawn with the rare gun:

<weapon file="microgun.weapon"> <commonness value="0.0003" in_stock="1" can_respawn_with="1" /> </weapon>

The price and XP requirement for guns can't be edited with this method though, so make sure to increase the starting XP/RP.

When adding weapons to the file, make sure that there are no duplicates. If no weapons show up in the armory when you have launched the server, there's a syntax error. As the file is an .xml, you can easily see if there are any syntax errors by opening the file in your browser. If the page is blank, something is wrong. Also see check.bat at the end of the guide.

Minimodes
Minimodes is also launched from the server console. Navigate to
C:\Program Files (x86)\Steam\steamapps\common\RunningWithRifles\media\packages\minimodes\scripts
Open start_minimodes.as and customize it to your liking. For details, refer to the corresponding step for Team Elimination.

Launch the server by opening rwr_server.exe and typing mini in the console once it's done loading. Your server should be running after some further loading. Take the server down by typing exit in the console.

FoV is enabled in Minimodes by default. You can turn it off by opening stage_minimodes.as, which is located in the same folder. Scroll towards the bottom of the file.

It should look like this:


To disable FoV, set "fov='1'"; to 0.

Here you can also change the amount of XP and RP every player will start with. Right above the FoV parameter, you can see the following section:


Change m_initialXp and m_initialRp to your liking. XP and RP reset at every new substage.

Minimodes consists of different substages: Team Deathmatch, King of the Hill and Teddy Hunt, which are played across three different maps: map6 (Rattlesnake Crescent), map1 (Moorland Trenches) and map15 (Islet of Eflen). The map rotation is random.

You can also customize things such as the round timer for each substage, or how many teddies you have to deliver to win Teddy Hunt. Open gamemode_minimodes.as, provided you're still in
C:\Program Files (x86)\Steam\steamapps\common\RunningWithRifles\media\packages\minimodes\scripts



First off is Team Deathmatch. You can change the round timer by replacing
m_tdmMaxTime = 900.0;
with the time of your liking.

Edit the number of kills required to win by changing
m_tdmMaxScore = 5;
Note: this is an initial number, it increases with the player count.


Next is King of the Hill. Change the round timer with
m_kothMaxTime = 900.0;

Edit the time required to win by holding the objective, by editing
m_kothDefenceTime = 180.0;


Last up is Teddy Hunt. Customize the maximum round time by changing
m_thMaxTime = 900.0;

Edit how many teddy bears that have to be delivered to the armory in order to win, by changing
m_thMaxScore = 3;

Teddy Hunt
Lastly we have Teddy Hunt. This mode can be played either as 2-Team Teddy Hunt or 3-Team Teddy Hunt.

Customize server settings by making your way to
C:\Program Files (x86)\Steam\steamapps\common\RunningWithRifles\media\packages\teddy_hunt\scripts

Copy and rename server_settings_team_teddy_hunt.example.php and server_settings_3-faction_team_teddy_hunt.example.php using the same course of action as with the other game modes. Edit the files as you want. Look at the corresponding step for Team Elimination for details.

Now open run_dedicated_server.bat. When it's done loading, type either of the following:
tth2 for 2-Team Teddy Hunt tth3 for 3-Team Teddy Hunt
After some further loading, your server should be running.

To edit initial XP/RP and enable FoV (disabled by default), make your way to
C:\Program Files (x86)\Steam\steamapps\common\RunningWithRifles\media\packages\vanilla\scripts.legacy\gamemodes\minimodes
and open stage_minimodes.php.

Scroll down to the bottom of the file. It should look like this:


To enable FoV, add the following parameter to the file, like in the image above:
" fov='1'" .

Here you can also change the amount of XP and RP every player will start with. Right above the FoV parameter, you can see the following section:


Change $initial_xp and $initial_rp to your liking. XP and RP reset at every new substage.

You can change the round timer and the amount of delivered teddy bears required to win, by heading to
C:\Program Files (x86)\Steam\steamapps\common\RunningWithRifles\media\packages\teddy_hunt\scripts
and opening start_team_teddy_hunt.php.

You will see the following section:


Modify th_max_time and th_max_score to your liking. The time is in seconds. Here you can also edit the number of players needed to leave the warmup stage and launch the actual game mode. Keep in mind that you can always force a start by typing /start in the in-game chat.

The process of customizing these settings for 3-Team Teddy Hunt is exactly the same. Just work with start_3-faction_team_teddy_hunt.php instead.

Note: When hosting a TTH server, your game might crash at 65% when loading a new map. This happens randomly for unknown reasons.

Conclusion
That's all this guide has to offer. You should now know how to set up a dedicated server and run Team Elimination, Deathmatch, Minimodes and Teddy Hunt. As well as customizing some server parameters regarding these game modes.

Visit the Running with Rifles Wiki[runningwithrifles.gamepedia.com] for some additional information about dedicated server hosting.

If you run into any issues, read the instructions one more time and preform the steps again.

Check.bat is a really convenient file. It scans all files located in scripts.legacy and detects syntax errors. As this is the folder where you customize some server settings, there is quite a lot of room for potential typos. Double click the file and see what it has to say. Of course, it's located in the scripts.legacy folder.

At some point, you might also want to verify integrity of your game files. If you have messed up a file or just want to reset all files back to their original state, this is the way to go. Keep in mind that this will restore all changes you have made to the game files. However, it will not delete foreign files you have placed in the game directory.

Note: It's always a good idea to take a backup of a file you will be modifying extensively.

Sometimes the server will remain visible in the server list, even though you have shut it down. In that case, just launch the same game mode again and close the server using the exit command. That should do the trick.

Lastly, I should mention that my capability to directly help out with possible issues regarding the guide will be limited. Although, if you think any part of the guide is unclear, make sure to voice your opinion down below so I can improve the instructions and consequently make the guide comprehensible for everyone!

Good luck with your dedicated server hosting!

10 Comments
ღMarcos de Amor✡ Aug 15, 2021 @ 12:23pm 
Thanks, I did it right then (put my name on all lines kkkkk). I'm still going to apply new commands, to find out if this admin.php will work, thank you friend!
ElaN  [author] Aug 15, 2021 @ 2:17am 
Keep the array line and it shouldn't matter where you put your name. I don't know if admin_settings.php works in invasion if that is what you're trying to do, though. There is this file called admin.xml mentioned in the old RWR forum update posts which you might want to try instead. See e.g. http://www.runningwithrifles.com/phpBB3/viewtopic.php?f=4&t=3431
ღMarcos de Amor✡ Aug 14, 2021 @ 3:17pm 
A question, when changing the name of the administrators, should I keep that "array()"?. And by the way, does it matter if I put my name on any of the lines?
ღMarcos de Amor✡ Aug 13, 2021 @ 6:39pm 
Figured out how to spawn armory_mobile and armored_truck in both factions on the Invasion server (just to make a fun PvP mode), if anyone needs just call :rwrcommander:
ღMarcos de Amor✡ Aug 11, 2021 @ 11:08am 
I'm grateful, I've been digging through the files and getting a sense, if that's what it seems, all the maps already have to be rotated, but some cannot have their parameters edited. But you helped a lot with this guide friend, my sincere thanks :rwrcommander:
ElaN  [author] Aug 11, 2021 @ 11:05am 
I have no knowledge of how to add new maps to an invasion server, so I'm afraid that I won't be able to help you out. Your best bet would probably be to seek help in the RWR Discord server instead.
ღMarcos de Amor✡ Aug 10, 2021 @ 7:41pm 
thank you bro! Helped a lot. I create a brazillian Invasion server with no problems. I was just wondering how to add more maps to the server
EvanMirror Feb 8, 2020 @ 7:07pm 
I get it! Thanks for your help, I want to convey my sincere gratitude for your guide.:Mirro_KetsunoAna:
ElaN  [author] Feb 8, 2020 @ 5:55am 
I never messed around with invasion servers so I won't be able to give any detailed descriptions. However, just launching an invasion server isn't much of a difference compared to the pvp game modes. Start by heading to \RunningWithRifles\media\packages\vanilla\scripts and modify the server parameters in start_invasion.as. Then open commands.xml (downloaded from the dropbox link in the guide) and change the first command from start_my_invasion.as to start_invasion.as. After that the server can be launched by typing "inva" (without the quotation marks) in rwr_server.exe. I hope this answers your question.
EvanMirror Feb 8, 2020 @ 2:17am 
hey,I'm wondering how to create the Invasion server, could you please help me?
Your guide is really helpful,thanks a lot:steamhappy: