Resource:Mapcycler: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
m (Added TODO)
(Updated)
Line 1: Line 1:
The map cycler automatically rotates gamemodes and maps based on a serverside configuration XML.
'''The map cycler is still a WIP, so some of this info may get outdated'''


==Cycler configuration XML==
The map cycler automatically rotates gamemodes and maps based on a serverside XML listing, end-round map votes, or at random.
 
==Adding gamemode round code==
Wherever your gamemode finishes (e.g one team wins, time runs out), add this line:
<syntaxhighlight lang="lua">
triggerEvent("onRoundFinished", getResourceRootElement(getThisResource()))
</syntaxhighlight>
 
==List mode==
===Cycler configuration XML===
The cycler configuration XML will be placed somewhere in the server directory. For now, this is:
The cycler configuration XML will be placed somewhere in the server directory. For now, this is:
   mods/deathmatch/resources/mapcycler/mapcycle.xml
   mods/deathmatch/resources/mapcycler/mapcycle.xml
Line 16: Line 25:
</syntaxhighlight>
</syntaxhighlight>


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).
Supported list types are '''sequential''' (the default type, will loop the game list sequentially) and '''shuffle''' (will loop the list in a random order, without repeating items).


Each game ''must'' specify a '''mode'''. '''map''' is optional (since a gamemode may run without maps), '''rounds''' defaults to an infinite number of rounds.
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:
<syntaxhighlight lang="lua">
triggerEvent("onRoundFinished", getResourceRootElement(getThisResource()))
</syntaxhighlight>


This will notify the cycler that the round has ended.
This will notify the cycler that the round has ended.


==Commands==
===Commands===
'''nextmap''' (outputs the next mode/map)
'''nextmap''' (outputs the next mode/map)


'''nextmode''' (same as previous one)
'''nextmode''' (same as previous one)


'''skipmap''' (cycles to the next mode/map)
'''skipmap''' (admin only; cycles to the next mode/map)
 
==Vote mode==
The vote mode starts a poll to chose between a set of randomly picked modes with a compatible map (or none, for map-less gamemodes) each.
 
===Commands===
'''skipmap''' (admin only; cycles to the next mode/map)


==TODO==
==TODO==
*The cycler doesn't handle manual gamemode changes properly yet (currently ignores them).
*Add random mode
*Add a way to wish for a next map in vote/random modes
*Add a timelimit to deal with gamemodes without rounds?

Revision as of 13:07, 21 November 2007

The map cycler is still a WIP, so some of this info may get outdated

The map cycler automatically rotates gamemodes and maps based on a serverside XML listing, end-round map votes, or at random.

Adding gamemode round code

Wherever your gamemode finishes (e.g one team wins, time runs out), add this line:

triggerEvent("onRoundFinished", getResourceRootElement(getThisResource()))

List mode

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 list types are sequential (the default type, will loop the game list sequentially) and shuffle (will loop the list in a random order, without repeating items).

Each game must specify a mode. map is optional (since a gamemode may run without maps), rounds defaults to an infinite number of rounds.

This will notify the cycler that the round has ended.

Commands

nextmap (outputs the next mode/map)

nextmode (same as previous one)

skipmap (admin only; cycles to the next mode/map)

Vote mode

The vote mode starts a poll to chose between a set of randomly picked modes with a compatible map (or none, for map-less gamemodes) each.

Commands

skipmap (admin only; cycles to the next mode/map)

TODO

  • Add random mode
  • Add a way to wish for a next map in vote/random modes
  • Add a timelimit to deal with gamemodes without rounds?