Running With Rifles Wiki

TODO: since version 1.70, most game modes have been converted to angelscript (only teddy hunt and team elimination are still PHP!), this section needs to be updated accordingly!

game modes are started with a script. Back in the days, all were PHP but since workshop release, the campaign/invasion scripts have been entirely ported to AngelScript. In the meanwhile, since version 1.70, also "dominance", "minimodes" and "deathmatch" have been ported to AngelScript.


Here is an example about how to start deathmatch:[ | ]

Created a *.bat file (just a text file with the extension *.bat) in your RWR folder and add this into that file:

rwr_server pipes debug_output 

PS: if you start an AngelScript script (thus not PHP, such as e.g. invasion), you don't need to create that *.bat file but you can directly execute the rwr_server.exe and proceed to the next step.

Unpack this file in your game directory to have the PHP binaries to be able to execute the php scripts:

exectute that batch file by double clicking it and a server console will appear. In there you can now launch the script you want, e.g. deathmatch but typing:

start_script ../scripts.legacy/start_deathmatch.php

The older PHP scripts are all located in the "scripts.legacy" folder, the AngelScript scripts in the "scripts" folder.

you can also create a file called "commands.xml" in your RWR folder with an alias for every mode to avoid having to type too much. This is an excerpt of mine:

 	<alias name="inva" command="start_script"/>  
 	<alias name="domi" command="start_script ../scripts.legacy/start_classic.php"/> 
 	<alias name="dm" command="start_script ../scripts.legacy/start_deathmatch.php"/> 
 	<alias name="te" command="start_script ../scripts.legacy/start_team_elimination.php"/>
 	<alias name="tth2" command="start_script ../../teddy_hunt/scripts/start_team_teddy_hunt.php" />
 	<alias name="tth3" command="start_script ../../teddy_hunt/scripts/start_3-faction_team_teddy_hunt.php"/>  
 	<alias name="mini" command="start_script ../scripts.legacy/start_minimodes.php"/>
 	<alias name="rwd" command="start_script ../../Running_with_the_Dead_campaign/scripts/"/>
 	<alias name="lab" command="start_script ../../lab_defense/scripts/"/>    
 	<alias name="racing" command="change_map lab_racing/maps/racing; execute start_server_racing.xml"/>
 	<alias name="carball" command="change_map football/maps/football; execute start_server_carball.xml"/>
	<alias name="ww2" command="start_script media/packages/ww2_invasion"/>	                    

if you type "dm" without the brackets into your server console it will launch the deathmatch script with the default server settings. You might want to customize those by e.g. specifying the port and the server name. Those files are usually in the same folder than the script file itself. In our example it's called server_settings_deathmatch.example.php. Best is you duplicate that file and rename it to like "server_settings_deathmatch.php" so that in case of a game update the *example* file won't be overwritten. the deathmatch script and the others as well, include the *example* file on default and also the one I specified. If you want to name the server setting file differently, you will have to also change the line in start_deathmatch.php to have the file inclusion pointing to your custom server setting file.

This line is:

include_once(get_include_with_fallback("server_settings_deathmatch.php", "server_settings_deathmatch.example.php"));

As for my server_settings_deathmatch.php file, it looks like this:

function get_start_server_command() {
	$command = 
		"<command class='start_server' " .
		"	server_name='Deathmatch Jack' " .
		"	server_port='1666' ".
		"	comment='pure PvP server' ".
		"	url='' ".
		"	register_in_serverlist='1'".
		"	mode='DM'".
    " max_players='16'" .
		"	persistency='match'>".


	return $command;