Difference between revisions of "ReplayWML"
From The Battle for Wesnoth Wiki
(→The [command] tag) |
(Highlight tags) |
||
Line 5: | Line 5: | ||
The following tags are recognized: | The following tags are recognized: | ||
− | * '''[start]''' is used to initialize the replay so that generated random numbers can be saved. | + | * '''[start]''': is used to initialize the replay so that generated random numbers can be saved. |
− | * '''[move]''' the player moved a unit. | + | * '''[move]''': the player moved a unit. |
− | ** '''[source]''' the location the unit moved to. | + | ** '''[source]''': the location the unit moved to. |
− | ** '''[destination]''' the location the unit moved from. | + | ** '''[destination]''': the location the unit moved from. |
− | * '''[recruit]''' the player recruited a unit. | + | * '''[recruit]''': the player recruited a unit. |
− | ** ''value'' the index number of the recruited unit. (Index numbers start at 0 and include all recruitable units in alphabetical order.) | + | ** '''value''': the index number of the recruited unit. (Index numbers start at 0 and include all recruitable units in alphabetical order.) |
− | ** ''x'' and ''y'' the castle tile the unit is recruited on. | + | ** '''x''' and '''y''': the castle tile the unit is recruited on. |
− | * '''[recall]''' the player recalled a unit. Same keys as [recruit], except that the index is in order of level, followed by required XP to advance. | + | * '''[recall]''': the player recalled a unit. Same keys as [recruit], except that the index is in order of level, followed by required XP to advance. |
− | * '''[attack]''' the player attacked. | + | * '''[attack]''': the player attacked. |
− | ** ''weapon'' the index number of the weapon. Weapons are indexed by the unit designer. | + | ** '''weapon''': the index number of the weapon. Weapons are indexed by the unit designer. |
− | ** '''[source]''' the location of the attacking unit. | + | ** '''[source]''': the location of the attacking unit. |
− | ** '''[destination]''' the location of the defending unit. | + | ** '''[destination]''': the location of the defending unit. |
− | * '''[end_turn]''' the player ended his turn. | + | * '''[end_turn]''': the player ended his turn. |
− | * '''[fire_event]''' a specific event was raised | + | * '''[fire_event]''': a specific event was raised |
− | ** ''raise'' the name of the event | + | ** '''raise''': the name of the event |
− | ** '''[source]''' the location of the event | + | ** '''[source]''': the location of the event |
− | ** '''[set_variable]''' set WML variable(s) before firing | + | ** '''[set_variable]''': set WML variable(s) before firing |
− | *** ''name'' the name of the variable | + | *** '''name''': the name of the variable |
− | *** ''value'' a string value (literal) | + | *** '''value''': a string value (literal) |
− | * '''[choose]''' the player was given an option by the scenario. | + | * '''[choose]''': the player was given an option by the scenario. |
− | ** ''value'' the index number of the option chosen. Index numbers are given by the scenario designer. | + | ** '''value''': the index number of the option chosen. Index numbers are given by the scenario designer. |
− | * '''[random]''' if the action required a random number, this describes the random number that was generated. In 1.0.x, nested '''[random]''' tags are used and only one is allowed at this level. In 1.1.x, a '''[random]''' tag is used at this level for each value. | + | * '''[random]''': if the action required a random number, this describes the random number that was generated. In 1.0.x, nested '''[random]''' tags are used and only one is allowed at this level. In 1.1.x, a '''[random]''' tag is used at this level for each value. |
− | ** ''value'' list of generated random values. In 1.1.x only a single value can be used. | + | ** '''value''': list of generated random values. In 1.1.x only a single value can be used. |
− | ** '''[results]''' used for '''[attack]''' commands. Describes the results of the battle. | + | ** '''[results]''': used for '''[attack]''' commands. Describes the results of the battle. |
− | *** ''chance'' the percent chance that the attack had to hit. | + | *** '''chance''': the percent chance that the attack had to hit. |
− | *** ''damage'' the amount of damage that the attack would do if it hits. | + | *** '''damage''': the amount of damage that the attack would do if it hits. |
− | *** ''dies'' whether the defender dies from the hit. | + | *** '''dies''': whether the defender dies from the hit. |
− | *** ''hits'' whether the attack hits. | + | *** '''hits''': whether the attack hits. |
− | ** '''[random]''' additional lists of generated random values. '''[random]''' has the same format as the first '''[random]''' and describes the other numbers that were generated. | + | ** '''[random]''': additional lists of generated random values. '''[random]''' has the same format as the first '''[random]''' and describes the other numbers that were generated. . |
== See Also == | == See Also == |
Revision as of 13:12, 19 February 2008
The [command] tag
The [command] tag is used to specify an action in a replay.
The following tags are recognized:
- [start]: is used to initialize the replay so that generated random numbers can be saved.
- [move]: the player moved a unit.
- [source]: the location the unit moved to.
- [destination]: the location the unit moved from.
- [recruit]: the player recruited a unit.
- value: the index number of the recruited unit. (Index numbers start at 0 and include all recruitable units in alphabetical order.)
- x and y: the castle tile the unit is recruited on.
- [recall]: the player recalled a unit. Same keys as [recruit], except that the index is in order of level, followed by required XP to advance.
- [attack]: the player attacked.
- weapon: the index number of the weapon. Weapons are indexed by the unit designer.
- [source]: the location of the attacking unit.
- [destination]: the location of the defending unit.
- [end_turn]: the player ended his turn.
- [fire_event]: a specific event was raised
- raise: the name of the event
- [source]: the location of the event
- [set_variable]: set WML variable(s) before firing
- name: the name of the variable
- value: a string value (literal)
- [choose]: the player was given an option by the scenario.
- value: the index number of the option chosen. Index numbers are given by the scenario designer.
- [random]: if the action required a random number, this describes the random number that was generated. In 1.0.x, nested [random] tags are used and only one is allowed at this level. In 1.1.x, a [random] tag is used at this level for each value.
- value: list of generated random values. In 1.1.x only a single value can be used.
- [results]: used for [attack] commands. Describes the results of the battle.
- chance: the percent chance that the attack had to hit.
- damage: the amount of damage that the attack would do if it hits.
- dies: whether the defender dies from the hit.
- hits: whether the attack hits.
- [random]: additional lists of generated random values. [random] has the same format as the first [random] and describes the other numbers that were generated. .