XML/Scenario

Back to XML Overview

Scenarios are special types of battles where the creator can modify the game from its regular style, and even add Lua scripting.

difficulty
This is the displayed difficulty, as a number from 0-5. It does not affect the scenario in any way, and is only used to display what YOU think the difficulty should be classified as. The default english difficulties are:
 * 0 = Very Easy
 * 1= Easy
 * 2= Medium
 * 3= Hard
 * 4= Very Hard
 * 5= Insane

players
This is a list of the players in this game, where each player gets their own &lt;player /&gt; tag. Attributes are control, which is either human, cpu, or cpu-ultra cpu-easy and cpu-mega. If it is closed the slot is closed and not used no matter which other settings follow. MegaGlest also adds the option of a network player. This asserts who controls that player, and one must be human and one must be some brand of cpu. In MegaGlest you can also edit the resource_multiplier</tt> for the cpu.

The faction is the name of the faction (must all be in the same techtree), and the team is the team number for the purpose of placing players on the same or different teams (players with the same number are allies, while different numbers are enemies).

map
The name of the map to use. It should exist in the player's maps folder or you can also have the map inside the scenario's folder itself, to allow the map to be used for the scenario only, without appearing in the regular game menu.

tileset
The name of the tileset to use. Note that it must exist in the user's tileset folder.

tech-tree
The techtree to use for the scenario. The existing factions for each player must exist in it.

fog-of-war
An optional value. If true</tt>, fog of war and the shroud of darkness will be displayed as normal, if false</tt>, there will be no fog of war nor the shroud of darkness. Finally explored</tt> will remove the shroud of darkness, but keep the fog of war.

default-resources
If true, the faction XML will be used to define the starting resources. If false, they start with no resources and you must use Lua to specify the resources to give. Generally on for non-scripted scenarios.

default-units
If true, the faction XML will be used to define the starting units. If false, they start with no units and you must use Lua to specify the units to give. Generally on for non-scripted scenarios.

default-victory-conditions
If true, the game is won or lost by defeating all the opponents (or more specifically, all the opponent's units which have a be-built skill). If false, the game only ends when the Lua script tells it to. Generally on for non-scripted scenarios.

scripts
Lua code will go in children tags of scripts. The exact Lua code available depends on the engine used, but the XML tags are all the same. Lua code will be executed based on what tag it is in.