[rtcw.co.uk logo] homelink


Map rotations & Campaigns


Setting up a rotation for stopwatch, objective and campaign are all similar, the major difference is for a campign, you first need to make the campaign file before there is any point putting it into the rotation. If you have any experience with making scripts for a Q3 engine game it should be pretty easy to understand a map rotation. The basic premise is once a map is completed, it looks to run the cvar "nextmap". The way a map rotation works is hence to simply set what "nextmap" is.

the "watchdog" is some check Splashdamage coded in, if the game senses a map is not loaded, it automatically runs watchdog command, so it makes sense to set watchdog to re-load the map rotation.

You can put the map rotation whereever you like, aslong as it is being "exec'ed". For example, you can put it straight into the main server configuration file, or have it in a seperate file (say, rotation.cfg) which is then called at the end of the configuration file (for example, exec rotation.cfg). See Server Configuration - server.cfg.

Rotations, like any Q3 game script, have lots of lines starting "//". This just denotes a comment for the human reader, the computer skips these lines completely.

This is an example of a stopwatch rotation:

// STOPWATCH ROTATION

// WATCHDOG
set com_watchdog_cmd "vstr m1r1 ; say watchdog found no map running - restarted mapcycle"


// MAP

set b_mapscriptdirectory etpromapscripts

set m1r1 "g_gametype 3; map oasis; set nextmap vstr m1r2"
set m1r2 "map_restart 0; set nextmap vstr m2r1"

set m2r1 "g_gametype 3; map goldrush; set nextmap vstr m2r2"
set m2r2 "map_restart 0; set nextmap vstr m3r1"

set m3r1 "g_gametype 3; map radar; set nextmap vstr m3r2"
set m3r2 "map_restart 0; set nextmap vstr m4r1"

set m4r1 "g_gametype 3; map railgun; set nextmap vstr m4r2"
set m4r2 "map_restart 0; set nextmap vstr m5r1"

set m5r1 "g_gametype 3; map supplydepot; set nextmap vstr m5r2"
set m5r2 "map_restart 0; set nextmap vstr m6r1"

set m6r1 "g_gametype 3; map caen; set nextmap vstr m6r2"
set m6r2 "map_restart 0; set nextmap vstr m1r1"

vstr m1r1

// END STOPWATCH ROTATION

m1r1 and so on are known as a string library, kind of like a name given to a string of commands - tell the game to run the 'name' and it runs the string of commands associated with it. What basically happens here is the engine stores these lines kind of like "m1r1 command means: set g_gametype to 3, load map oasis and set 'nextmap' to run 'm1r2'". The very last line of the rotation is "vstr m1r1", which tells the engine to actually execute the line m1r1, which will startup the map rotation. Hence: g_gametype is set to 3, Oasis is loaded, and once the round of Oasis is finished, it runs "nextmap" which has been set to run m1r2, whereupon the map is restarted the the map cycle continues.

Note the "set b_mapscriptdirectory etpromapscripts". This should only be used if the server is running ETPro mod, and you want to make use of the map modification scripts supplied with ETPro - allies can dynamite the back door on battery, spawn in the CP building on Fueldump and so on. If you dont want this, or are not running ETPro mod, just remove this line.

For a campaign rotation, it is fairly similar up to this point. Here is an example of a roation that runs both of the official campaigns, one after the other:

// CAMPAIGN ROTATION - official campaigns

// WATCHDOG
set com_watchdog_cmd "vstr d_initial ; say watchdog found no map running - restarted mapcycle"

// MAP

set d1 "campaign cmpgn_northafrica ; set nextcampaign vstr d2"
set d2 "campaign cmpgn_centraleurope ; set nextcampaign vstr d1"

set d_initial "set g_gametype 4 ; map oasis ; set nextcampaign vstr d2"
vstr d_initial

// END CAMPAIGN ROTATION

Notice the similarity with the stopwatch rotation - really its almost exactly the same. The important things to notice is that: g_gametype is 4, and the campaign mode version of nextmap is "nextcampaign". Secondly, also notice the first campaign being loaded is northafrica, which starts with Oasis, and in the d_initial line the map there (which is first loaded) is also Oasis.


Custom Campaigns

This is the big hassle with campaigns, the ET system isnt exactly optimal.

First you have to make the cmpaign file. To do this you basically make a new .txt document with notepad, and then rename it so the extension is changed to ".campaign", for example mycustom.campaign. In that file basically cut & paste the following, and modify to suit what you want.

{
name "my custom campaign"
shortname "cmpgn_mycustom"
description "www.rtcw.co.uk public:*6 map campaign.**All welcome, have fun. No greifing, laming or spamming spawns.**ETpro map scripts in use! Can dynamite back door on battery & spawn in garage on Fueldump.**Maps:*Radar, Oasis, Railgun, Battery, Goldrush, Fueldump.**Admins: #rtcw.servers on Quakenet IRC, dg@jolt.co.uk or www.rtcw.co.uk/forums"
maps "radar;oasis;railgun;battery;goldrush;fueldump"
mapTC 374 374
type "wolfmp"
}
[Loading screen]

"name" and "description" is what appears in the loading screen, also "mapTC" is the co-ordinates for centering the map there. With the description, a * makes it continue on the next line, a bit like <br> html tags. See the image, though note there the name was set as "sixmapi".

"shortname" is important, it is what is used to load the map - notice "campaign cmpgn_centraleurope" on the campaign rotation above. "maps" are of course the maps used in the campaign, note you cannot use more than 10 maps in a campaign.

You're not done quite yet. Now you have to put the file in a folder called "scripts" (just make it anywhere) and then zip all this up into a zipfile, which you then rename the .zip extension to .pk3. This has to be done with "recurse folder names" or similar option ticked - basically if you unzip this file it should make a folder called scripts that contains the .campaign file.

Since this means there is a customised .pk3 file loaded on the server, clients will have to download it. Players will need to have ET set to allow downloads, and the server must also have sv_allowdownloads set to 1 (if you are using http redirect, include the campaign file at the file host). By the way, campaign files are automatically loaded even if the campaign is not run, so players connecting to ANY server running from the same ET install will all need the campaign file...

Just for another irritating annoyance, a few custom maps aren't really 100% compatible with campaigns at all, and some maps (including officials) dont work properly at the start or end of campaigns... It's not hard to quickly check though, simply load ET and select to host server, selecting campaign mode and then the map you're thinking of starting off with - you will get a message if the map isnt setup to start a campaign. Radar and Oasis are both safe maps to start off campaigns, while Goldrush and Fueldump are safe for ending campaigns on.

Making the campaign .pk3 of course just creates what the campaign is, you still need to tell the server to run it, so you need a map/campaign rotation. The rotation itself is identical to the one shown previously, except this time the "campaign" command is set to "cmpgn_mycustom" (which is what we set shortname to in the example .campaign file). The other difference is there is only one campaign running, so only the one line for it. Just to repeat myself, notice our custom campaign starts with the map Radar, so the map being loaded on the campaign rotation (below) is also Radar.
// CAMPAIGN ROTATION - custom

// WATCHDOG
set com_watchdog_cmd "vstr d_initial ; say watchdog found no map running - restarted mapcycle"

// MAP

set d1 "campaign cmpgn_mycustom ; set nextcampaign vstr d1"

set d_initial "set g_gametype 4 ; map radar ; set nextcampaign vstr d1"
vstr d_initial

// END CAMPAIGN ROTATION

You can find an example 6 map campaign here if you would find it easier to just edit as you like (be sure to change the actual file name and 'shortname' to something unique to your server, else you may create havok for any players who already have campaign files with the same names - remember to then change the campaign rotation so it uses your new names!)


MORE troubles? Please take note of the .PK3 Count Bug!

Highboy's has a webpage script setup to make you a custom campaign nice and simple, but its not too great if it's lacking a map you wish to use, or arent too keen on the little advert... Update - Highboys is dead back by popular demand, another such script by someone else can be found here. Alternately, a downloadable program which appears to be able to make any custom rotation or campign is the Map Rotation Creator, though I've never tried it myself - I find it's better to be able to do it yourself because then you can do exactly what you want, and can easily find the problem if something is wrong.

ETPro campaigns note: ETPro added server cvar "b_campaignfile":

new: b_campaignFile allows admin to specify specific campaign file, to prevent server from referencing every pk3 on the server and forcing players to download every referenced pk3 on the server
For more info try this thread.


Map Names
oasis
battery
goldrush
radar
railgun
fueldump

For custom maps check their documentation, if there is any. Else, usually it will be the filename, without the .pk3 extension - however some mappers dont follow this convention and you may have to open the .pk3 file with winzip or whatever, and find the filename of the .bsp file inside.

Campaign Names
cmpgn_northafrica (Oasis, Battery, Goldrush)
cmpgn_centraleurope (Radar, Railgun, Fueldump)

Shuffling Teams
If you want to have the server automatically shuffle teams, simply insert the shuffle_teams command it into the rotation script - in the right place.



<< BACK: Server Configuration |


Contents

Enemy Territory & RTCW UK