Running With Rifles Wiki
Advertisement
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.

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.

THE FOLLOWING TEXT HAS TO BE ADAPTED FOR TEAM ELIMINATION AND TEDDY HUNT ONLY!

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 
pause

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: https://www.dropbox.com/s/ejzteh5oo4er80o/php_rwr.zip?dl=0

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:

<command_aliases>
 	<alias name="inva" command="start_script start_my_invasion.as"/>  
 	<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/start_campaign.as"/>
 	<alias name="lab" command="start_script ../../lab_defense/scripts/start_defense_server.as"/>    
 	<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 start_rotator.as media/packages/ww2_invasion"/>	                    
</command_aliases>

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:

<?php
function get_start_server_command() {
	// CUSTOMIZE YOUR SERVER SETTINGS HERE
	$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'>".

		"</command>";

	return $command;
}
?> 
Advertisement