Creating A Map Rotation With Alternating Gametypes.

I’ve been asked several times by different people how to setup an Elite Force map rotation that alternates between gametypes.

Provided here is an example of a simple map rotation consisting of 4 maps and 4 different games. Free For All (all Weapons), Capture The Flag (all Weapons), Capture The Flag (Disintegration), and Free For All Disintegration. And back to the First Free For All All Weapons map.

First off here is the map rotation.

// FFA
set m1 "set g_gametype 0;set g_pModDisintegration 0;map HM_CAM;set nextmap vstr m2"// CTF All Weapons
set m2 "set g_gametype 4;set g_pModDisintegration 0;map CTF_VOY1;set nextmap vstr m3"// CTF Disintegration
set m3 "set g_gametype 4;set g_pModDisintegration 1;map CTF_VOY2;set nextmap vstr m4"// Free For All Disintegration
set m4 "set g_gametype 0;set g_pModDisintegration 1;map HM_NOON;set nextmap vstr m1"

// Set the map rotation in motion
vstr m1

Now lets take a look at what we’ve done.

If you don’t know anything about quake 3/EF map rotations, this should be a good primer.

The most simplest form of a map rotation looks something like this:


set m1 "map HM_NOON;set nextmap vstr m2"
set m2 "map CTF_VOY1;set nextmap vstr m3"
set m3 "map CTF_VOY2;set nextmap vstr m4"
vstr m1

First thing is you are setting m1 as the first map. Once set in the configuration, everything in the quotes after m1 will be executed. The commands are separated by a semi-colin (;).

To execute m1 you use the vstr command (e.g. vstr m1). You’ll usually see the vstr XXX command at the end of the map rotation lines in the configuration. In the above example, if you wanted to play CTF_VOY2 and have the server pick up on the rotation afterwards, you would type something like /rcon vstr m3 instead of map ctf_voy2.

By calling vstr m3 the server then knows what to do after CTF_VOY2 is done running. In our example that would be to go to the nextmap which is vstr m4.

Make sense so far?

So now we have a basic idea of how a map rotation works. You can take the Quake 3 engine’s scripting abilities to extremes and come up with some wacky stuff if you put your mind to it. But lets keep it simple and stick with our original example, the rotation that switches between gametypes.

Again:

// FFA
set m1 "set g_gametype 0;set g_pModDisintegration 0;map HM_CAM;set nextmap vstr m2"// CTF All Weapons
set m2 "set g_gametype 4;set g_pModDisintegration 0;map CTF_VOY1;set nextmap vstr m3"// CTF Disintegration
set m3 "set g_gametype 4;set g_pModDisintegration 1;map CTF_VOY2;set nextmap vstr m4"// Free For All Disintegration
set m4 "set g_gametype 0;set g_pModDisintegration 1;map HM_NOON;set nextmap vstr m1"

// Set the map rotation in motion
vstr m1

Let break apart a single line of the rotation to figure out whats going on. Lets look at:

// FFA
set m1 "set g_gametype 0;set g_pModDisintegration 0;map HM_CAM;set nextmap vstr m2"

So we’ve set m1 and everything in the quotes will be executed when m1 is called. We know the commands are separated by semi-colins, so lets break down the commands in the quotes…

set g_gametype 0;

First thing we do is set the gametype. 0 is free for all. You can set any gametype here. This command is probably already in your server configuration above the map rotation somewhere. That’s ok, where just changing it again.

set g_pModDisintegration 0;

next we set the built in mod value for disintegration to make sure it’s turned off (0) here. Because we want all weapons.

map HM_CAM;

Next we specify what map to load. This is pretty straight forward, you’re probably used to typing this sort of thing into the console.

And finally…

set nextmap vstr m2

We tell the server what to run after the match is over, in this case it’s M2, the second map in the rotation.

Hope that’s helps out all the folks who have asked me about this.

About Shafe

Brian Shaffer is a veteran programmer, programming professionally since 1991. His first gaming computer was a Commodore Vic-20 in the 80s. Shafe founded The Beer Garden on October 23, 2004 and continues to run and maintain it along with several members of the gaming community.