Resource:Mapcycler: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
(New page: 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 ...)
 
mNo edit summary
 
(7 intermediate revisions by 2 users not shown)
Line 1: Line 1:
The map cycler automatically rotates gamemodes and maps based on a serverside configuration XML.
{{Resource page}}
The map cycler automatically rotates gamemodes and maps based on a serverside XML listing, end-round map votes, or at random.


==Cycler configuration XML==
==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.
 
==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==
===Commands===
Wherever your gamemode finishes (e.g one team wins, time runs out), add this line:
'''nextmap''' (outputs the next mode/map)
<syntaxhighlight lang="lua">
 
triggerEvent("onRoundFinished", getResourceRootElement(getThisResource()))
'''nextmode''' (same as previous one)
</syntaxhighlight>
 
'''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.


This will notify the cycler that the round has ended.
===Commands===
'''skipmap''' (admin only; cycles to the next mode/map)


==Commands==
==Random mode==
'''nextmap''' (outputs the next mode/map)
The vote mode picks a new mode at random when the rounds finishes.


'''nextmode''' (same as previous one)
===Commands===
'''skipmap''' (admin only; cycles to the next mode/map)


'''skipmap''' (cycles to the next mode/map)
[[ru:Resource:Mapcycler]]

Latest revision as of 14:04, 16 May 2012

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()))

This will notify the cycler that the round has ended.

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.

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)

Random mode

The vote mode picks a new mode at random when the rounds finishes.

Commands

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