Resource:Mapcycler
The map cycler automatically rotates gamemodes and maps based on a serverside configuration XML.
Cycler configuration XML
The cycler configuration XML will be placed somewhere in the server directory. For now, this is:
mods/deathmatch/resources/mapcycler/mapcycle.xml
A gamemode cycle is defined as follows:
<cycle type="shuffle"> <game map="ctf-canals" mode="ctf" rounds="3"/> <game map="as-heist" mode="assault" rounds="2"/> <game map="i69-laputa" mode="Interstate69" rounds="2"/> <game map="sewers" mode="stealth" rounds="2"/> <game map="as-sharks" mode="assault" rounds="1"/> </cycle>
Supported types are sequential (the default type, will loop the game list sequentially) and shuffle (will loop the list in a random order, without repeating).
Each game must specify a mode. map is optional (since a gamemode may run without maps), rounds defaults to an infinite number of rounds.
Adding gamemode round code
Wherever your gamemode finishes (e.g one team wins, time runs out), add this line:
triggerEvent("onRoundFinished", getResourceRootElement(getThisResource()))
This will notify the cycler that the round has ended.
Commands
nextmap (outputs the next mode/map)
nextmode (same as previous one)
skipmap (cycles to the next mode/map)
TODO
- The cycler doesn't handle manual gamemode changes properly yet (currently ignores them).