openarena

A map rotation script is a series of commands which server admins pre-configure to have the game cycle between different maps automatically. Map change happens after match end, or in case players successfully vote for nextmap (/callvote nextmap unless that's disabled in g_votenames), or in case server admin enters /vstr nextmap command.

Map rotation scripts are supported since the original Q3A, and should work with most mods.

How-to

A map rotation script is made of a series of user-generated cvars (variables), and each one contains a few commands: each one loads a map and then sets the "nextmap" variable telling it has to "run" another user-generated cvar next. The last one sets the first one as next. Then there is a commad which "runs" the first one, starting the loop. You usually write down those user generated variables in a cfg file, then you "exec" it, and the rotation starts.

A classic rotation script is structured as follows:

set <first_variable> "map <first_map>; set nextmap vstr <second_variable>"
set <second_variable> "map <second_map>; set nextmap vstr <third_variable>"
...
set <last_variable> "map <last_map>; set nextmap vstr <first_variable>"
vstr <first_variable>

Let's translate into an example with real maps:

// Map rotation script
set m1 "map aggressor; set nextmap vstr m2"
set m2 "map oa_dm1; set nextmap vstr m3"
set m3 "map wrackdm17; set nextmap vstr m1" 
vstr m1 // start loop at m1

This would play aggressor, then oa_dm1, then wrackdm17, then aggressor, then oa_dm1 and so on...

"Vstr" is the command which "executes" a cvar like its content was typed directly in command console. "m1", "m2", "m3" are the names of the user-generated cvars we are using: you can name them as you wish (a1, a2, a3... loop1, loop2, loop3... d1, d2, d3..., etc.), as long as you don't use the names of existing variables or commands. The quotes mark the beginning and the end of the content of each cvar. The ; separates commands within the same line. Whatever follows // is considered a "comment" and not parsed.

You may type the script directly in console... but the most common behavior is to prepare the rotation script externally, using a text editor to create a plain text file to be placed under your baseoa (or current mod) folder[1] (e.g. myrotation.cfg), then start OpenArena (full game or dedicated server binaries) and use the command console to run the configuration file which contains the rotation script, such as /exec myrotation or /exec myrotation.cfg

It is possible for the server admin to "jump" directly to a step of the loop, after the configuration file has been executed once, by typing /vstr <variablename> in console (where <variablename> is one of the variables you used in your rotation script, such as "m2" or "loop3" or "a1"... it depends from the names you choose!). Then the cycle will continue normally from there onwards.

Changing game options between matches

See also: Basic game options, Special game options, Configuration examples.

Map rotation scripts can be used to change A LOT of things between matches! Not only map, but also fraglimit, timelimit, capturelimit, players' speed, dmflags, instant-gib option, etc. etc. etc. You may even use it to just change settings between matches, while loading the same map every time.

What you need to do is to add the settings you wish to change, followed by ";", usually before the "map <mapname>" commands in the script.

Let's modify the previous example this way:

// Map rotation script
set m1 "timelimit 10; map aggressor; set nextmap vstr m2"
set m2 "timelimit 8; map oa_dm1; set nextmap vstr m3"
set m3 "timelimit 5; map wrackdm17; set nextmap vstr m1" 
vstr m1 // start loop at m1

This script would make the match last 10 minutes when playing in aggressor map, 8 minutes when playing in oa_dm1, 5 minutes in wrackdm17, 10 minutes in aggressor, 8 minutes in oa_dm1 and so on...

This example shows how to manage changing multiple settings:

// Map rotation script
set m1 "g_knockback 1000; g_instantgib 1; map aggressor; set nextmap vstr m2" // 1000 is default knockback (the "push" you receive by weapons)
set m2 "g_instantgib 0; g_rockets 1; g_gravitymodifier 0.8; map oa_dm1; set nextmap vstr m3"
set m3 "g_rockets 0; g_gravitymodifier 1.0; g_knockback 1200; map wrackdm17; set nextmap vstr m1" // 1.0 is default gravitymodifier
vstr m1 // start loop at m1

This would play aggressor map in instantgib mode, then oa_dm1 in all rockets mode and low gravity modifier, then wrackdm17 with higher knockback, then aggressor in instantgib mode, then oa_dm1 in all rockets mode and low gravity modifier and so on.

As you can see, each step first cares about "undoing" the settings from the previous step that it doesn't need. As the whole script is a loop, the last step acts as "previous" for the fist one, so the first step "undoes" the settings of the last one which it doesn't need.

Keep in mind

Notes

  1. Under either your basepath (OA installation folder) or homepath (OA settings and autodownload folder).
  2. A note about customizing command line parameters for Windows 10 "pinned to taskbar" shortcuts: after you pinned a program to the taskbar, you have to right-click on it, then right-click on the program name, and then edit the command line there. That shortcut .lnk actually sits in %appdata%\Microsoft\Internet Explorer\Quick Launch\User Pinned\TaskBar or %appdata%\Microsoft\Internet Explorer\Quick Launch\User Pinned\ImplicitAppShortcuts.
    If instead you want to create and customize an OpenArena shortcut on the right area of Windows 10 Start Menu, you first need to manually create the link into %AppData%\Microsoft\Windows\Start Menu\Programs (for your user only) or %ProgramData%\Microsoft\Windows\Start Menu\Programs (for all users), then customize that link file properties to add the desired parameters to the command line, then open the Start Menu (it should now appear in all programs list on the left... if not, try rebooting), right-click on it and "pin to Start".

See also