<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.wesnoth.org/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Denispir</id>
	<title>The Battle for Wesnoth Wiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.wesnoth.org/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Denispir"/>
	<link rel="alternate" type="text/html" href="https://wiki.wesnoth.org/Special:Contributions/Denispir"/>
	<updated>2026-04-14T21:54:34Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.31.16</generator>
	<entry>
		<id>https://wiki.wesnoth.org/index.php?title=StandardLocationFilter&amp;diff=65054</id>
		<title>StandardLocationFilter</title>
		<link rel="alternate" type="text/html" href="https://wiki.wesnoth.org/index.php?title=StandardLocationFilter&amp;diff=65054"/>
		<updated>2019-11-10T19:53:52Z</updated>

		<summary type="html">&lt;p&gt;Denispir: Added &amp;quot;Attributes&amp;quot; section (and removed __NOTOC__ !!!)&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{WML Tags}}&lt;br /&gt;
From [[FilterWML]], this is the standard way of filtering on locations.&lt;br /&gt;
The term [[StandardLocationFilter]] means that the set of such keys and tags (see below) can appear at that point. Sometimes a [[StandardLocationFilter]] needs to be included in a [filter_location] tag. There are however many tags which accept the [[StandardLocationFilter]] directly as an argument such as [store_locations]. Generally, if the tag [filter_location] is not mentioned to be a possible subtag of the outer tag in question, then don't put it.&lt;br /&gt;
&lt;br /&gt;
== Attributes ==&lt;br /&gt;
The following attributes and sub-tags are permitted:&lt;br /&gt;
&lt;br /&gt;
* '''time_of_day''': filter matches only on a given time of day (one of lawful, chaotic, or neutral). Note: ''chaotic'', ''lawful'', and ''neutral''; these are not times of day, these are ''alignments''. To match against 'dawn', 'dusk', 'first watch' etc., use the '''time_of_day_id''' key described below.&lt;br /&gt;
* '''time_of_day_id''': this accepts a list of one or more actual times of day, separated by commas. These IDs are taken from '''data/core/macros/schedules.cfg'''. Permissible values are case-sensitive: dawn, morning, afternoon, dusk, first_watch, second_watch, indoors, underground and deep_underground.&lt;br /&gt;
* '''terrain''': comma separated list of terrains. (See also: [[#Filtering_Terrains|Filtering Terrains]]).&lt;br /&gt;
* '''x,y''': the same as in the unit filter; supports any range ([[StandardLocationFilter#Notes_about_Coordinate_Usage|notes]])&lt;br /&gt;
* '''location_id''': {{DevFeature1.13|?}} Matches a special location set in the map. This can also be a side number to match that side's starting location. Note: this does not accept a comma separated list, one has to use [or] tags. {{DevFeature1.15|0}} Accepts a comma separated list.&lt;br /&gt;
* '''area''': matches locations assigned to the [[DirectActionsWML#.5Btime_area.5D|[time_area]]] with the given id.&lt;br /&gt;
* '''include_borders''': {{DevFeature1.13|0}} whether the SLF will include border hexes or not. Will override the default behavior of the tag this appears in.&lt;br /&gt;
* '''[filter]''' with a [[StandardUnitFilter]] as argument; if present a unit must also be there&lt;br /&gt;
* '''owner_side''': If a valid side number, restricts stored locations to villages belonging to this side. If 0, restricts to all unowned locations (the whole map except villages which belong to some valid side). A hex is considered a village if and only if its [ [[TerrainWML|terrain_type]] ]gives_income= parameter was set to yes (which means a side can own that hex).&lt;br /&gt;
* '''[filter_vision]''': this tests whether or not the location is currently visible&lt;br /&gt;
** '''visible''': yes or no, default yes. &amp;quot;yes&amp;quot; filters for visible locations, &amp;quot;no&amp;quot; filters for invisible locations.&lt;br /&gt;
** '''respect_fog''': yes or no, default yes. &amp;quot;yes&amp;quot; filters for locations that are clear of both fog and shroud, &amp;quot;no&amp;quot; filters for locations that are clear of shroud.&lt;br /&gt;
** [[StandardSideFilter]] tags and keys as arguments. If there is *at least one* matching side which can see the location then the filter matches, and otherwise it fails to match.&lt;br /&gt;
*'''[filter_owner]''': If present, inline owner_side= is ignored. Restricts stored locations to villages, each of which must belong to any of the matching sides. If no sides match, restricts to unowned villages (and only these).&lt;br /&gt;
**'''[[StandardSideFilter]]''' tags and keys as arguments&lt;br /&gt;
* '''find_in''': name of an array or container variable; if present, the location will not match unless it is also found stored in the variable&lt;br /&gt;
* '''radius''': matches if any location within the radius matches this filter ([[StandardLocationFilter#Notes_about_Radius_Usage|notes]])&lt;br /&gt;
* '''[filter_radius]''': a standard location filter; normally the radius extends outwards from matching locations one step at a time without checking any additional information-- however, if this tag is present, the radius will be restricted so that it can only expand outwards in the directions where it passes the given location filter&lt;br /&gt;
* '''[and]''': an extra location filter. Unless a location matches the [and] filter, then it will be excluded. ''Note: [and],[or],and [not] extra location filters are considered after everything else in the containing filter (except radius, which is considered last in 1.3.8 and greater); they are then processed in the order encountered.''&lt;br /&gt;
* '''[or]''': an extra location filter. If a location matches the [or] filter, then it will count as a match regardless of conditions in previous filters or the containing filter.&lt;br /&gt;
* '''[not]''': an extra location filter. If a location matches the [not] filter, then that location will be excluded.&lt;br /&gt;
* '''[filter_adjacent_location]''': a standard location filter; if present the correct number of adjacent locations must match this filter&lt;br /&gt;
** '''count''': a number, range, or comma separated range; default &amp;quot;1-6&amp;quot;&lt;br /&gt;
** '''adjacent''': a comma separated list of directions; default &amp;quot;n,ne,se,s,sw,nw&amp;quot; (see [[#Directions|notes]])&lt;br /&gt;
* '''formula''': {{DevFeature1.13|5}} a [[Wesnoth Formula Language]] formula. Some terrain-specific variables, for example &amp;quot;light&amp;quot; and &amp;quot;castle&amp;quot;, can be used in the filter [[#Wesnoth_Formula_Language|(see list below)]].&lt;br /&gt;
* '''lua_function''': {{DevFeature1.13|5}} the name of a [[LuaWML|Lua]] function in the global environment that takes arguments &amp;lt;code&amp;gt;x, y&amp;lt;/code&amp;gt; and returns true if the given location matches the filter. Non-global functions can now be used here by building a dot-separated &amp;quot;path&amp;quot;. Note that this is not actually interpreted as Lua code even though it superficially resembles it, so using a Lua keyword in the path will work, for example &amp;quot;my_filter_functions.goto&amp;quot; will correctly use the function which in actual Lua code would need to be referenced as &amp;lt;code&amp;gt;my_filter_functions[&amp;quot;goto&amp;quot;]&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==Notes about Coordinate Usage==&lt;br /&gt;
&lt;br /&gt;
When specifying coordinates, the following keys are used:&lt;br /&gt;
* '''x''': the first coordinate&lt;br /&gt;
* '''y''': the second coordinate&lt;br /&gt;
&lt;br /&gt;
While some locations should only be one hex (like the starting position of a unit),&lt;br /&gt;
others filter over multiple hexes.&lt;br /&gt;
The following syntax is used to filter over multiple hexes:&lt;br /&gt;
&lt;br /&gt;
Dashes('''-''') are used to have the location be a range of hexes.&lt;br /&gt;
There must be values before and after the dash;&lt;br /&gt;
everything in between these numbers (inclusively) is part of the range.&lt;br /&gt;
&lt;br /&gt;
Commas(''',''') are used to separate coordinates into a list.&lt;br /&gt;
The '''x''' and '''y''' lists are then paired up, with each pair representing one hex or range. &lt;br /&gt;
E.g. in order to specify multiple locations 1,4 and 2,5, use:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang='wml'&amp;gt;&lt;br /&gt;
[tag]&lt;br /&gt;
    x=1,2&lt;br /&gt;
    y=4,5&lt;br /&gt;
[/tag]&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You should have the same number of commas in each list, and both '''x''' and '''y''' are always lists. For example, this does not mean the locations (1,4) and (2,4):&lt;br /&gt;
&amp;lt;syntaxhighlight lang='wml'&amp;gt;&lt;br /&gt;
[tag]&lt;br /&gt;
    x=1,2&lt;br /&gt;
    y=4    # bad example, implementation-defined behavior&lt;br /&gt;
[/tag]&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A pair can have a single value for one coordinate and a range for the other. This matches (1,4) and the entire column from (2,1) downwards:&lt;br /&gt;
&amp;lt;syntaxhighlight lang='wml'&amp;gt;&lt;br /&gt;
[tag]&lt;br /&gt;
    x=1,    2&lt;br /&gt;
    y=4,1-999&lt;br /&gt;
[/tag]&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Providing only '''x''' or only '''y''' is valid. This matches the entire columns from (1,1) and (2,1) downwards:&lt;br /&gt;
&amp;lt;syntaxhighlight lang='wml'&amp;gt;&lt;br /&gt;
[tag]&lt;br /&gt;
    x=1,2&lt;br /&gt;
[/tag]&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note: although the ordering of locations in a list generally does not matter,&lt;br /&gt;
the action '''[move_unit_fake]''' takes in a list of hexes,&lt;br /&gt;
and moves an image onto each of those hexes in order.&lt;br /&gt;
&lt;br /&gt;
==Notes about Radius Usage==&lt;br /&gt;
If you aren't storing any locations successfully, it may be because you put the radius or filters in the wrong place for them to combine correctly.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang='wml'&amp;gt;&lt;br /&gt;
[have_location]&lt;br /&gt;
    terrain=Gg^Vh&lt;br /&gt;
    [and]&lt;br /&gt;
        x=$x1&lt;br /&gt;
        y=$y1&lt;br /&gt;
       radius=1&lt;br /&gt;
    [/and]&lt;br /&gt;
[/have_location]&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note that the use of [and] here causes the radius to have a very different meaning. Normally, all of the criteria besides radius are checked, producing a set of hexes to which the radius is applied. This means, for example, that if you're trying to find &amp;quot;a hex without a unit on it within 5 hexes of (15, 23)&amp;quot;, the code:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang='wml'&amp;gt;&lt;br /&gt;
[have_location]&lt;br /&gt;
    x,y=15,23&lt;br /&gt;
    radius=5 # oops... this time it won't work as expected&lt;br /&gt;
    [not]&lt;br /&gt;
        [filter]&lt;br /&gt;
        [/filter]&lt;br /&gt;
    [/not]&lt;br /&gt;
[have_location]&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
will not work! First, it looks for a hex with x=15, y=23 without a unit on it. Then, it returns that hex and all hexes within 5 of it. If (15, 23) happens to be occupied, then it will return no hexes, because &amp;quot;all hexes within 5 hexes of (no hexes)&amp;quot; is still &amp;quot;no hexes&amp;quot;. Instead, put an [and] around the x,y and radius requirements, and it will separately find &amp;quot;(15, 23) and all hexes within 5 of it&amp;quot; and &amp;quot;each of those hexes that doesn't have a unit on it&amp;quot;, producing the desired result.&lt;br /&gt;
&lt;br /&gt;
== Directions ==&lt;br /&gt;
&lt;br /&gt;
Some attributes expect a direction or list of directions. Valid base directions are n, ne, nw, s, se, sw, and there are three operators supported as well:&lt;br /&gt;
&lt;br /&gt;
* To take the opposite direction, use - (eg -n is the same as s)&lt;br /&gt;
* {{DevFeature1.13|2}} To rotate clockwise, use :cw (eg n:cw is the same as ne)&lt;br /&gt;
* {{DevFeature1.13|2}} To rotate counterclockwise, use :ccw (eg n:ccw is the same as nw)&lt;br /&gt;
&lt;br /&gt;
You can't apply multiple rotation operators - for example, &amp;quot;n:cw:ccw&amp;quot; is not a valid direction. If for some reason you really need multiple rotations, you can use parentheses (so, &amp;quot;(n:cw):ccw&amp;quot; is valid and is the same as n). Similarly, &amp;quot;--n&amp;quot; is not valid, but &amp;quot;-(-n)&amp;quot; is valid and is the same as n.&lt;br /&gt;
&lt;br /&gt;
This syntax is mainly useful when used in conjunction with variable substitution in the adjacent key in [filter_adjacent_location] and in [filter_adjacent] (in [[StandardUnitFilter]]), but will work anywhere a direction is expected. For example, using [modify_unit] to change a unit's direction:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang='wml'&amp;gt;&lt;br /&gt;
[modify_unit]&lt;br /&gt;
    [filter]&lt;br /&gt;
        # ... Whatever filter you need&lt;br /&gt;
    [/filter]&lt;br /&gt;
    facing=-$this_unit.facing&lt;br /&gt;
[/modify_unit]&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
That will cause the matched units to turn around.&lt;br /&gt;
&lt;br /&gt;
== Filtering Terrains ==&lt;br /&gt;
&lt;br /&gt;
The '''terrain=''' key allows you to filter based on the terrain of a space, for example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang='wml'&amp;gt;&lt;br /&gt;
[event]&lt;br /&gt;
    [filter]&lt;br /&gt;
        [filter_location]&lt;br /&gt;
            terrain=Ch &lt;br /&gt;
        [/filter_location]&lt;br /&gt;
    [/filter]&lt;br /&gt;
[/event]&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
At some places the terrains can be filtered with a match list. This list is a comma separated list of [[TerrainCodesWML|terrain strings]] and patterns which will be processed in order. As soon as a pattern matching the reference terrain is found, the result of the filter will be determined.&lt;br /&gt;
&lt;br /&gt;
Normally, if one of the patterns matches, the filter is considered successful. However, the special pattern &amp;lt;tt&amp;gt;!&amp;lt;/tt&amp;gt; inverts this every time it is encountered &amp;amp;ndash; when inverted, the filter is considered ''unsuccessful'' when one of the patterns matches. In other words, &amp;lt;tt&amp;gt;Gg&amp;lt;/tt&amp;gt; matches only basic grass, while &amp;lt;tt&amp;gt;!,Gg&amp;lt;/tt&amp;gt; matches ''anything but'' basic grass.&lt;br /&gt;
&lt;br /&gt;
When the end of the list is reached without any matches, normally the result is an unsuccessful match. However, if the match is currently inverted, ie there are an odd number of &amp;lt;tt&amp;gt;!&amp;lt;/tt&amp;gt;, then the result is a successful match.&lt;br /&gt;
&lt;br /&gt;
An individual terrain pattern consists of two parts, the base and the overlay, separated by the &amp;lt;tt&amp;gt;^&amp;lt;/tt&amp;gt; character. The overlay (including the preceding &amp;lt;tt&amp;gt;^&amp;lt;/tt&amp;gt;) is optional; if omitted, only terrains without overlays can be matched. The pattern may end with the wildcard character &amp;lt;tt&amp;gt;*&amp;lt;/tt&amp;gt; (or be composed solely of the wildcard character). The pattern to match any terrain is &amp;lt;tt&amp;gt;*^*&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example 1:&amp;lt;/b&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
ww* matches ww, www, wwW but not WWW &amp;lt;br&amp;gt;&lt;br /&gt;
!, ww returns false if ww found and true if not &amp;lt;br&amp;gt;&lt;br /&gt;
!, ww, wa, !, aa returns false if ww or wa found and true if aa found and false if none found.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Example 2:&amp;lt;/b&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;nowiki&amp;gt;*&amp;lt;/nowiki&amp;gt;^V* matches all village-terrain &amp;lt;br&amp;gt;&lt;br /&gt;
Notice how the * can be used separately for both layers (base and overlay layers are separated by the ^-character).&lt;br /&gt;
&lt;br /&gt;
For a list of terrain types and their string codes see [[TerrainCodesWML|TerrainCodesWML]].&lt;br /&gt;
&lt;br /&gt;
== Wesnoth Formula Language ==&lt;br /&gt;
&lt;br /&gt;
When using SLF's '''formula''' attribute, the following read-only terrain properties are available:&lt;br /&gt;
&lt;br /&gt;
* '''x'''&lt;br /&gt;
* '''y'''&lt;br /&gt;
* '''loc'''&lt;br /&gt;
* '''id'''&lt;br /&gt;
* '''name'''&lt;br /&gt;
* '''editor_name'''&lt;br /&gt;
* '''description'''&lt;br /&gt;
* '''icon'''&lt;br /&gt;
* '''light'''&lt;br /&gt;
* '''village''': a boolean containing the value of [terrain_type]gives_income=&lt;br /&gt;
* '''castle'''&lt;br /&gt;
* '''keep'''&lt;br /&gt;
* '''healing''': an integer containing the value of [terrain_type]heals=&lt;br /&gt;
* '''owner'''&lt;br /&gt;
&lt;br /&gt;
For an up-to-date list, check the C++ function terrain_callable::get_value(const std::string&amp;amp; key) const.&lt;br /&gt;
&lt;br /&gt;
== Tutorial ==&lt;br /&gt;
* [http://wiki.wesnoth.org/FilterWML/Examples_-_How_to_use_Filter How To Use Filter (with examples)]&lt;br /&gt;
&lt;br /&gt;
== See Also ==&lt;br /&gt;
&lt;br /&gt;
* [[FilterWML]]&lt;br /&gt;
&lt;br /&gt;
[[Category: WML Reference]]&lt;/div&gt;</summary>
		<author><name>Denispir</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.wesnoth.org/index.php?title=DirectActionsWML&amp;diff=65037</id>
		<title>DirectActionsWML</title>
		<link rel="alternate" type="text/html" href="https://wiki.wesnoth.org/index.php?title=DirectActionsWML&amp;diff=65037"/>
		<updated>2019-11-03T16:51:02Z</updated>

		<summary type="html">&lt;p&gt;Denispir: /* [time_area] */ added id to example code, plus example usage as plain area def&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{WML Tags}}&lt;br /&gt;
== Direct actions ==&lt;br /&gt;
&lt;br /&gt;
Direct actions are actions that have a direct effect on gameplay. They can be used inside of [[EventWML|events]].&lt;br /&gt;
&lt;br /&gt;
The following tags are actions:&lt;br /&gt;
&lt;br /&gt;
=== [endlevel] ===&lt;br /&gt;
Ends the scenario.&lt;br /&gt;
* '''result''': before the scenario is over, all events with ''name=result'' are triggered. If ''result=victory'', the player progresses to the next level (i.e., the next scenario in single player); if ''result=defeat'', the game returns to the main menu. &lt;br /&gt;
&lt;br /&gt;
When the result is &amp;quot;victory&amp;quot; the following keys can be used:&lt;br /&gt;
* '''bonus''': whether the player should get bonus gold (maximum possible gold that could have been earned by waiting the level out). The default is bonus=yes. {{DevFeature1.13|2}} Alternatively, a number, defining the bonus multiple (1.0 meaning full).&lt;br /&gt;
* '''carryover_report''': whether the player should receive a summary of the scenario outcome, the default is carryover_report=yes.&lt;br /&gt;
* '''save''': whether a start-of-scenario save should be created for the next scenario, the default is save=yes. Do not confuse this with saving of replays for the current scenario.&lt;br /&gt;
* '''replay_save''': whether a replay save for the current scenario is allowed, the default is replay_save=yes. If yes, the player's settings in preferences will be used to determine if a replay is saved. If no, will override and not save a replay.&lt;br /&gt;
* '''linger_mode''': If ...=yes, the screen is greyed out and there's the possibility to save before advancing to the next scenario, the default is linger_mode=yes.&lt;br /&gt;
* '''reveal_map''': (Multiplayer only) (Default is 'yes') If 'no', shroud doesn't disappear when game ended.&lt;br /&gt;
* '''next_scenario''': (default specified in '''[scenario]''' tag) the ID of the next scenario that should be played.  All units that side 1 controls at this point become available for recall in ''next_scenario''.&lt;br /&gt;
* '''carryover_percentage''': by default 80% of the gold is carried over to the next scenario, with this key the amount can be changed.&lt;br /&gt;
* '''carryover_add''': if yes the gold will be added to the starting gold the next scenario, if no the next scenario will start with the amount of the current scenario (after taxes) or the minimum in the next scenario. Default is no.&lt;br /&gt;
* '''music''': (default specified in '''[scenario]''' or '''[game_config]''' tags) a comma-separated list of music tracks from which one will be chosen and played once after any events related to the end of level result are executed; by default, victory_music is used on victory, and defeat_music on defeat.&lt;br /&gt;
* '''end_credits''': Whether to display the credits screen at the end of a single-player campaign. Defaults to ''yes''. Note that this has cumulative effects over the campaign - it persists even if the endlevel does not trigger the end of the campaign. See also [[CampaignWML]].&lt;br /&gt;
* '''end_text''': (translatable) Text that is shown centered in a black screen at the end of a campaign. Defaults to &amp;quot;The End&amp;quot;. Note that this has cumulative effects over the campaign - it persists even if the endlevel does not trigger the end of the campaign. See also [[CampaignWML]].&lt;br /&gt;
* '''end_text_duration''': Delay, in milliseconds, before displaying the game credits at the end of a campaign. In other words, for how much time '''end_text''' is displayed on screen. Defaults to 3500. Note that this has cumulative effects over the campaign - it persists even if the endlevel does not trigger the end of the campaign. See also [[CampaignWML]].&lt;br /&gt;
* &amp;lt;strike&amp;gt;'''[next_scenario_settings]''': Any tags or attribute children of this optional argument to [endlevel] are merged into the scenario/multiplayer tag of the *next* scenario. This allows you to e.g. reconfigure the [side] tags or settings, just before load. &amp;lt;/strike&amp;gt; This feature was removed in 1.11.17, it might be redesigned and reintroduced.&lt;br /&gt;
* &amp;lt;strike&amp;gt;'''[next_scenario_append]''': Any tags of this optional argument are appended at high level to the next scenario. This is most appropriate for [event] tags, although you may find other uses. Example test scenario for these features: https://gna.org/support/download.php?file_id=20119 &amp;lt;/strike&amp;gt; This feature was removed in 1.11.17, it might be redesigned and reintroduced.&lt;br /&gt;
* '''[result]''' {{DevFeature1.13|0}} Allows specification of a side specific result, this is for competitive multiplayer scenarios/campaigns where it might happen that one player wins but another player loses.  The following attributes are accepted and have the same effect as in '''[endlevel]''':&lt;br /&gt;
** '''result'''&lt;br /&gt;
** '''bonus'''&lt;br /&gt;
** '''carryover_percentage'''&lt;br /&gt;
** '''carryover_add'''&lt;br /&gt;
&lt;br /&gt;
And there is also&lt;br /&gt;
** '''side''' The number of the side for which these results should apply.&lt;br /&gt;
&lt;br /&gt;
=== [unit] ===&lt;br /&gt;
Creates a unit (either on the map, on a recall list, or into a variable for later use.)  For syntax see [[SingleUnitWML]].&lt;br /&gt;
* {{Short Note:Predefined Macro|GENERIC_UNIT}}&lt;br /&gt;
&lt;br /&gt;
This tag can also recall an existing unit, which happens when:&lt;br /&gt;
* the '''id=''' attribute is used&lt;br /&gt;
* a unit with that '''id=''' already exists&lt;br /&gt;
* (might be unnecessary) the existing unit is on the side's recall list&lt;br /&gt;
in this case, the unit is recalled at the '''x,y=''' or '''location_id=''' given, and any other data in the tag is ignored.&lt;br /&gt;
&lt;br /&gt;
Campaign authors: a usual way to recall plot-necessary heroes is to use a macro with the data for creating that hero. This helps during debugging, because you can skip to scenarios and the recall-or-create functionality means that any units which are normally met in a previous scenario are automatically created (otherwise some scenarios may be an instant loss). This can only be used for units that must survive the previous scenarios, as it would recreate units if they died in a previous scenario.&lt;br /&gt;
For example,&lt;br /&gt;
[https://github.com/wesnoth/wesnoth/blob/1.14.7/data/campaigns/Heir_To_The_Throne/utils/httt_utils.cfg#L685 HttT's NEED_DELFADOR macro].&lt;br /&gt;
&lt;br /&gt;
=== [recall] ===&lt;br /&gt;
Recalls a unit taking into account any [http://wiki.wesnoth.org/SingleUnitWML filter_recall] of the leader.   The unit is recalled free of charge, and is placed near its leader, e.g., if multiple leaders are present, near the first found which would be able to normally recall it.&lt;br /&gt;
&lt;br /&gt;
If neither a valid map location is provided nor a leader on the map would be able to recall it, the tag is ignored.&lt;br /&gt;
 &lt;br /&gt;
* [[StandardUnitFilter]]: the first matching unit will be recalled.  If no units match this tag is ignored. Do not use a [filter] tag. If a comma separated list is given, every unit currently considered for recall is checked against all the types (not each single one of the types against all units).&lt;br /&gt;
* '''x,y''': the unit is placed here instead of next to the leader.&lt;br /&gt;
* '''show''': yes/no, default yes: whether the unit is animated (faded in) or instantly displayed&lt;br /&gt;
* '''fire_event''': boolean yes|no (default no); whether any according prerecall or recall events shall be fired.&lt;br /&gt;
* '''check_passability''': (boolean yes|no, default yes): If yes, checks for terrain passability when placing the unit (a nearby passable hex is chosen).&lt;br /&gt;
* '''[secondary_unit]''': {{DevFeature1.13|?}} If present and show=yes, a matching unit will be chosen and their recruiting animation played.&lt;br /&gt;
&lt;br /&gt;
=== [teleport] ===&lt;br /&gt;
Teleports a unit on map. {{Short Note:Predefined Macro|TELEPORT_UNIT}}&lt;br /&gt;
* '''[filter]''': [[StandardUnitFilter]] the first unit matching this filter will be teleported.&lt;br /&gt;
* '''x,y''': the hex to teleport to. If that hex is occupied, the closest unoccupied hex will be used instead.&lt;br /&gt;
* '''clear_shroud''': should shroud be cleared on arrival&lt;br /&gt;
* '''animate''': should a teleport animation be played (if the unit doesn't have a teleport animation, it will fade out/fade in)&lt;br /&gt;
* '''check_passability''': (boolean yes|no, default yes): normally, units will not be teleported into terrain that is impassable for them. Setting this attribute to &amp;quot;no&amp;quot; permits it.&lt;br /&gt;
&lt;br /&gt;
(Note: There is also a ability named teleport, see [[AbilitiesWML]].)&lt;br /&gt;
&lt;br /&gt;
=== [terrain_mask] ===&lt;br /&gt;
Changes the terrain on the map.  See [[TerrainMaskWML]].&lt;br /&gt;
&lt;br /&gt;
=== [terrain] ===&lt;br /&gt;
Changes the terrain on the map.&lt;br /&gt;
* '''terrain''': the character of the terrain to use.  See [[TerrainCodesWML]] to see what letter a type of terrain uses.&lt;br /&gt;
* [[StandardLocationFilter]]. This [[StandardLocationFilter]]'s terrain= key is used for the new terrain, filtering by terrain can be done with a nested [[StandardLocationFilter]]: [and]terrain=terrain_string_to_be_filtered_for.&lt;br /&gt;
* '''layer''': (overlay|base|both, default=both) only change the specified layer.&lt;br /&gt;
* '''replace_if_failed''': (default=no) When replacing just one layer failed, try to replace the whole terrain. If '''terrain''' is an overlay only terrain, use the default_base as base layer. If the terrain has no default base, do nothing.&lt;br /&gt;
&lt;br /&gt;
If you want to remove the overlays from a terrain and leave only the base, use:&lt;br /&gt;
 layer=overlay&lt;br /&gt;
 terrain=&amp;quot;^&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Note:&amp;lt;/b&amp;gt; When a hex changes from a village terrain to a non-village terrain, and a team owned that village it loses that village. When a hex changes from a non-village terrain to a village terrain and there is a unit on that hex it does not automatically capture the village. The reason for not capturing villages it that there are too many choices to make; should a unit lose its movement points, should capture events be fired. It is easier to do this as wanted by the author in WML.&lt;br /&gt;
&lt;br /&gt;
=== [gold] ===&lt;br /&gt;
Gives sides gold.&lt;br /&gt;
* '''amount''': the amount of gold to give.&lt;br /&gt;
* '''side''': (default=1) the number of the side to give the gold to. Can be a comma-separated list of sides. note: Default side=1 for empty side= is deprecated.&lt;br /&gt;
* [[StandardSideFilter]] tags and keys; default for empty side= is all sides, as usual in a SSF.&lt;br /&gt;
&lt;br /&gt;
=== [unstore_unit] ===&lt;br /&gt;
This action allows placing into the game, either on the map or in a recall list, a unit defined or stored in a WML variable. It may be useful in different contexts:&lt;br /&gt;
* To replace on the map a unit after having operated a change. Some changes can only or more easily be performed in a WML variable (possibly also using Lua). For instance: new ability, magical full healing, special damage amount from a custom weapon... This usage is rather common.&lt;br /&gt;
* To place into the game a unit,usually a hero, at the moment it enters the story (possibly the very start of a campaign). this is for units which are directly defined in a WML variable, using [unit] with the key &amp;quot;to_variable&amp;quot;. This usage is rather uncommon, but good practice for code structure and clarity.&lt;br /&gt;
* To replace into the game a unit which was stored for a while in a variable, for instance to make it reapper in a later scenario.&lt;br /&gt;
The variable is not cleared. To unstore units from an array variable, iterate over the array. See [[SyntaxWML]] and [[VariablesWML/How to use variables]] for more information about variable usage. See also [[InternalActionsWML#.5Bstore_unit.5D|[store_unit]]], [[ConditionalActionsWML|For]], [[ConditionalActionsWML#.5Bwhile.5D|[while]]] and [[InternalActionsWML#.5Bclear_variable.5D|[clear_variable]]].&lt;br /&gt;
&lt;br /&gt;
* '''variable''': The main key, required to indicate the name of the variable.&lt;br /&gt;
&lt;br /&gt;
Placement keys:&lt;br /&gt;
* '''x''' ,'''y''': A position on the map, or else on recall list (read further). The action normally just uses (x,y) values in the variable, otherwise they be indicated here, or override the original ones. To put the unit on the recall list of the unit's side, use &amp;quot;x,y=recall,recall&amp;quot; will (to change the side, change first $unit.side in the variable).&lt;br /&gt;
* '''find_vacant''' (yes|no, default no): Whether the unit should be placed on the nearest vacant tile to its specified location. If this is set to 'no' (default), then any unit on the same tile as the unit being unstored will be destroyed. ''(Note: Shouldn't the default value be changed to yes, to avoid this danger, and directly allow the feature below.)''&lt;br /&gt;
* '''check_passability''' (yes|no, default yes): Works in cooperation with find_vacant, which for this must have the value 'yes'. If check_passability also has the value 'yes', then the terrain is checked to be passable for the unit, else a neighbour tile is searched to place it. ''(Note: Shouldn't the default value be changed to yes, since it is crazy to place a unit in a cave wall for instance.)'' '''''(exits on versions 1.9 and later only)'''''.&lt;br /&gt;
&lt;br /&gt;
Text keys (they are probably useful only which have been stored into a WML variable to operate some change (ex: special damage amount, and then immediately replaced on map):&lt;br /&gt;
* '''text''': (translatable) A floating text to display above the unit, such as a damage amount.&lt;br /&gt;
* '''male_text''', '''female_text''': {{DevFeature1.13|2}} (translatable) gender-specific versions of the above&lt;br /&gt;
* '''red''', '''green''', '''blue''': (default=0,0,0) the color of the text. Values vary from 0-255. You may find it convenient to use the {COLOR_HARM} or {COLOR_HEAL} macro instead. (Use {COLOR_HARM} or {COLOR_HEAL} instead of the whole red,green,blue= line.)&lt;br /&gt;
&lt;br /&gt;
Advancement:&lt;br /&gt;
* '''advance''': (default=yes) if yes the unit is advanced if it has enough XP. When modifying XP make sure to do it from inside a [[EventWML#Multiplayer_safety|synchronized event]] or it may lead to OOS errors especially when several advancement paths exist. Note that advance and post advance events are called, so infinite loops can happen.&lt;br /&gt;
* '''animate''': (boolean yes|no, default yes) This is relevant only for a unit placed on the map, and which advances. Whether a unit animation defined for when they advance should be played (&amp;quot;levelout&amp;quot; and &amp;quot;levelin&amp;quot;, or fade to white and back).&lt;br /&gt;
* '''fire_event''' (yes|no, default no): Whether any advance/post advance events shall be fired if an advancement takes place, no effect otherwise.&lt;br /&gt;
&lt;br /&gt;
Units can be unstored with negative (or zero) hit points. This can be useful if modifying a unit in its last_breath event (as the unit's death is already the next step), but tends to look wrong in other cases. In particular, it is possible to have units with negative hit points in play. Such units are aberrations, subject to unusual behavior as the game compensates for them. (For example, such units are currently automatically hit&amp;amp;ndash;and killed&amp;amp;ndash;in combat.) The details of the unusual behavior are subject to change between stable releases without warning.&lt;br /&gt;
&lt;br /&gt;
=== [allow_recruit] ===&lt;br /&gt;
Allows a side to recruit units it couldn't previously recruit.&lt;br /&gt;
* '''type''': the types of units that the side can now recruit.&lt;br /&gt;
* '''side''': (default=1) the number of the side that is being allowed to recruit the units. This can be a comma-separated list note: Default side=1 for empty side= is deprecated.&lt;br /&gt;
* [[StandardSideFilter]] tags and keys; default for empty side= is all sides, as usual in a SSF.&lt;br /&gt;
&lt;br /&gt;
=== [allow_extra_recruit] ===&lt;br /&gt;
Allows a leader to recruit units it couldn't previously recruit.&lt;br /&gt;
These types add to the types the leader can recruit because of [side]recruit=.&lt;br /&gt;
* '''extra_recruit''': the types of units that the unit can now recruit.&lt;br /&gt;
* '''[[StandardUnitFilter]]''': All units matching this filter are modified. Does not match on recall list units.&lt;br /&gt;
&lt;br /&gt;
=== [disallow_recruit] ===&lt;br /&gt;
Prevents a side from recruiting units it could previously recruit.&lt;br /&gt;
* '''type''': the types of units that the side can no longer recruit. {{DevFeature1.13|0}} If omitted, all recruits for matching sides will be disallowed.&lt;br /&gt;
* '''side''': (default=1) the number of the side that may no longer recruit the units. This can be a comma-separated list note: Default side=1 for empty side= is deprecated.&lt;br /&gt;
* [[StandardSideFilter]] tags and keys; default for empty side= is all sides, as usual in a SSF.&lt;br /&gt;
&lt;br /&gt;
=== [disallow_extra_recruit] ===&lt;br /&gt;
Prevents a leader from recruiting units it could previously recruit.&lt;br /&gt;
* '''extra_recruit''': the types of units that the side can no longer recruit.&lt;br /&gt;
* '''[[StandardUnitFilter]]''': All units matching this filter are modified. Does not match on recall list units.&lt;br /&gt;
&lt;br /&gt;
=== [set_recruit] ===&lt;br /&gt;
Sets the units a side can recruit.&lt;br /&gt;
* '''recruit''': the types of units that the side can now recruit.&lt;br /&gt;
* '''side''': The number of the side that is having its recruitment set. This can be a comma-separated list.&lt;br /&gt;
* [[StandardSideFilter]] tags and keys; default for empty side= is all sides, as usual in a SSF.&lt;br /&gt;
&lt;br /&gt;
=== [set_extra_recruit] === &lt;br /&gt;
Sets the units a leader can recruit.&lt;br /&gt;
* '''extra_recruit''': the types of units that the leader can now recruit.&lt;br /&gt;
* '''[[StandardUnitFilter]]''': All units matching this filter are modified. Does not match on recall list units.&lt;br /&gt;
&lt;br /&gt;
=== [modify_side] ===&lt;br /&gt;
Modifies some details of a given side in the middle of a scenario.  '''The following listed properties are the only properties that [modify_side] can affect!'''&lt;br /&gt;
* '''side''': (default=1) the number of the side that is to be changed. note: Default side=1 for empty side= is deprecated.&lt;br /&gt;
* '''[filter_side]''' with a [[StandardSideFilter]] as argument&lt;br /&gt;
* '''income''': the income given at the begining of each turn.&lt;br /&gt;
* '''recruit''': a list of unit types, replacing the side's current recruitment list.&lt;br /&gt;
* '''team_name''': the team in which the side plays the scenario.&lt;br /&gt;
* '''user_team_name''': a translatable string representing the team's description. This has no effect on alliances. Defaults to ''team_name''.&lt;br /&gt;
* '''side_name''': {{DevFeature1.13|?}} a translatable string representing the side leader's description.&lt;br /&gt;
* '''gold''': the amount of gold the side owns.&lt;br /&gt;
* '''village_gold''': the income setting per village for the side.&lt;br /&gt;
* '''controller''': the identifier string of the side's controller. Uses the same syntax of the ''controller'' key in the [[SideWML|[side]]] tag. warning: in multiplayer, changing the controller of a side might result in OOS during some events like, for example 'side_turn_end'; see [https://github.com/wesnoth/wesnoth/issues/2563 issue #2563].&lt;br /&gt;
* '''fog''': a boolean string (yes/no) describing the status of Fog for the side.&lt;br /&gt;
* '''shroud''': a boolean string describing the status of Shroud for the side.&lt;br /&gt;
* '''hidden''': a boolean string specifying whether side is shown in status table.&lt;br /&gt;
* '''color''': a team color range specification, name (e.g. &amp;quot;red&amp;quot;, &amp;quot;blue&amp;quot;), or number (e.g. &amp;quot;1&amp;quot;, &amp;quot;2&amp;quot;) for this side. The default color range names, numbers, and definitions can be found in data/core/team_colors.cfg.&lt;br /&gt;
* '''[ai]''': sets/changes AI parameters for the side. Only parameters that are specified in the tag are changed, this does not reset others to their default values. Uses the same syntax as described in [[AiWML]].  Note that [modify_side][ai] works for all simple AI parameters and some, but not all, of the composite ones. If in doubt, use [http://wiki.wesnoth.org/AiWML#Adding_and_Deleting_Aspects_with_the_.5Bmodify_ai.5D_Tag [modify_ai]] instead, which always works. {{DevFeature1.13|?}} If this contains an '''ai_algorithm''', the AI parameters will be reset to those of the indicated AI before adding any additional parameters included in the tag. In other words, this allows replacing the AI config rather than appending to it.&lt;br /&gt;
* '''switch_ai''': replaces a side ai with a new AI from specified file(ignoring those AI parameters above). Path to file follows the usual WML convention.&lt;br /&gt;
* '''reset_maps''': If set to &amp;quot;yes&amp;quot;, then the shroud is spread to all hexes, covering the parts of the map that had already been explored by the side, including hexes currently seen. (Seen hexes will be cleared at the end of most events; they can also be manually cleared with {{tag|InterfaceActionsWML|redraw}}.) This is only effective if shroud is on, but this is evaluated after shroud= (and before shroud_data=).&lt;br /&gt;
* '''reset_view''': If set to &amp;quot;yes&amp;quot;, then the fog of war is spread to all hexes, covering the parts of the map that had already been seen this turn by the side, including hexes currently seen, excluding hexes affected by multi-turn {{tag|DirectActionsWML|lift_fog}}. (Seen hexes will be cleared at the end of most events; they can also be manually cleared with {{tag|InterfaceActionsWML|redraw}}.) This is only effective if fog is on, but this is evaluated after fog=.&lt;br /&gt;
* '''share_maps''': change the share_maps side attribute. Be sure to use shroud=yes for that side and have it as an ally&lt;br /&gt;
* '''share_view''': change the share_view side attribute. Be sure to use fog=yes for that side and have it as an ally&lt;br /&gt;
* '''share_vision''': change both the above at the same time&lt;br /&gt;
* '''shroud_data''': changes to the side's shroud, using the same format as when defining the [side].&lt;br /&gt;
* '''suppress_end_turn_confirmation''': Boolean value controlling whether or not a player is asked for confirmation when skipping a turn.&lt;br /&gt;
* '''scroll_to_leader''': Boolean value controlling whether or not the game view scrolls to the side leader at the start of their turn when present.&lt;br /&gt;
* '''flag''': Flag animation for villages owned by this side (see [[SideWML|[side]]]).&lt;br /&gt;
* '''flag_icon''': Flag icon used for this side in the status bar (see [[SideWML|[side]]]).&lt;br /&gt;
* '''village_support''': The number of unit levels this side is able to support (does not pay upkeep on) per village it controls.&lt;br /&gt;
* '''defeat_condition''' {{DevFeature1.13|0}}: When the side is considered defeated (see [[SideWML|[side]]]).&lt;br /&gt;
&lt;br /&gt;
=== [modify_turns] ===&lt;br /&gt;
Modifies the turn limit in the middle of a scenario.&lt;br /&gt;
* '''value''': the new turn limit.&lt;br /&gt;
* '''add''': if used instead of ''value'', specifies the number of turns to add to the current limit (can be negative).&lt;br /&gt;
* '''current''': changes the current turn number after applying turn limit modifications, if any. It is not possible to change the turn number to exceed the turn limit (1 &amp;lt;= current turns &amp;lt;= max turns).&lt;br /&gt;
&lt;br /&gt;
=== [allow_end_turn] ===&lt;br /&gt;
Allows human players to end their turn through the user interface if they were previously affected by the '''[disallow_end_turn]''' action. This action doesn't take any arguments.&lt;br /&gt;
&lt;br /&gt;
=== [disallow_end_turn] ===&lt;br /&gt;
Disallows human players to end their turn through the user interface. This action doesn't require arguments.&lt;br /&gt;
* '''reason''' (translatable): {{DevFeature1.15|0}} Allows to optionally specify a reason.&lt;br /&gt;
&lt;br /&gt;
=== [capture_village] ===&lt;br /&gt;
Changes the ownership of a village.&lt;br /&gt;
* [[StandardLocationFilter]]: all village locations matching the filter are affected.&lt;br /&gt;
* '''side''': the side that takes control of the village. This side needs to have a leader (canrecruit=yes). If the side key is not given, the village will become neutral (unless [filter_side] is present, in which case that side fiter decides, see below).&lt;br /&gt;
* '''[filter_side]''' with [[StandardSideFilter]] tags and keys as arguments; if both this tag and inline side= are present it's an error. Otherwise, the first matching side gets ownership (or the village becomes neutral if none match).&lt;br /&gt;
* '''fire_event''' (boolean yes|no, default: no): Whether any capture events shall be fired.&lt;br /&gt;
&lt;br /&gt;
=== [kill] ===&lt;br /&gt;
Removes all units (including units in a recall list) that match the filter from the game.&lt;br /&gt;
* [[StandardUnitFilter]]: Selection criterion; do not use a [filter] tag.&lt;br /&gt;
* '''animate''' (default 'no'): if 'yes', displays the unit dying (fading away). {{DevFeature1.13|8}} If '''[secondary_unit]''' is given, also plays the victory animation of that unit.&lt;br /&gt;
* '''fire_event''' (default 'no'): if 'yes', triggers any appropriate 'die' events (See [[EventWML]]). Note that events are only fired for killed units that have been on the map (as opposed to recall list).&lt;br /&gt;
* '''[secondary_unit]''' with a [[StandardUnitFilter]] as argument. Do not use a [filter] tag. Has an effect only if fire_event=yes ({{DevFeature1.13|8}} or if it has a victory animation and animate=yes). The first on-map unit matching the filter becomes second_unit in any fired die and last breath events. If an on-map unit matches and if there are several units killed with a single [kill] tag, second_unit is this same unit for all of them. If no on-map unit matches or [secondary_unit] isn't present, the variable second_unit in each of the die and last breath events is always the same as the variable unit (the dying unit).&lt;br /&gt;
* '''[primary_attack]''', '''[secondary_attack]''' {{DevFeature1.13|8}} The attacks to use for matching the animation. Useful for example on the wose, whose death animation depends on the damage type it was killed by.&lt;br /&gt;
&lt;br /&gt;
=== [move_unit] ===&lt;br /&gt;
Moves a unit along a path on the map. The path can be specified exactly, or as a series of waypoints that the unit will pass through.&lt;br /&gt;
* [[StandardUnitFilter]] as argument; do not use a [filter] tag. All units matching the filter are moved. If the target location is occupied, the nearest free location is chosen.&lt;br /&gt;
* '''to_x''' (unsigned integer): The units are moved to this x coordinate. Can be a comma-separated list, in which case the unit follows this given path during the move.&lt;br /&gt;
* '''to_y''' (unsigned integer): The units are moved to this y coordinate. Can be a comma-separated list.&lt;br /&gt;
* '''dir''' (string): {{DevFeature1.15|0}} Performs a relative movement instead of an absolute movement. For example, dir=n,n,nw will move two spaces north and then one space to the northwest. This is used instead of '''to_x''' and '''to_y'''.&lt;br /&gt;
* '''to_location''': {{DevFeature1.15|0}} Moves matching units to locations placed in the map editor with the &amp;quot;New Location&amp;quot; button. Can be a comma-separated list. This is used instead of '''to_x''' and '''to_y'''.&lt;br /&gt;
* '''fire_event''' (optional, boolean yes|no, default no): Whether any according moveto events shall be fired. The target location ($x1, $y1 in the event) may not be the same location that the unit was tried to be moved to, if the original target location is occupied or impassable.&lt;br /&gt;
* '''check_passability''' (boolean yes|no, default yes): Whether the terrain the unit is moved to should be checked for suiting the unit. (If it does not, a nearby suitable hex is chosen.)&lt;br /&gt;
* '''force_scroll''': Whether to scroll the map or not even when [[InterfaceActionsWML#.5Block_view.5D|[lock_view]]] is in effect or ''Follow Unit Actions'' is disabled in ''Advanced Preferences''. Defaults to using [[InterfaceActionsWML#.5Bmove_unit_fake.5D|[move_unit_fake]]]'s default value.&lt;br /&gt;
&lt;br /&gt;
=== [modify_ai] ===&lt;br /&gt;
Changes AI objects (aspects, goals, candidate actions or stages) for a specified side. See [[Modifying_AI_Components#The_.5Bmodify_ai.5D_Tag|Modifying AI Components]] for full description.&lt;br /&gt;
&lt;br /&gt;
* '''action''' (string): Takes values 'add', 'change', 'delete' or 'try_delete' to do just that for the AI object.&lt;br /&gt;
* '''path''' (string): Describes which AI object is to be modified.  &lt;br /&gt;
* '''[facet]''', '''[goal]''', '''[candidate_action]''' or '''[stage]''': Details about the AI object to be modified.&lt;br /&gt;
* [[StandardSideFilter]] tags and keys; default for empty side= is all sides, as usual in a SSF.&lt;br /&gt;
&lt;br /&gt;
=== [modify_unit] ===&lt;br /&gt;
works similar to the MODIFY_UNIT macro.&lt;br /&gt;
* '''[filter]''' with a [[StandardUnitFilter]] as argument. All units matching this filter are modified. Matches on recall list units too.&lt;br /&gt;
* '''[object]''', '''[trait]''', {{DevFeature1.13|5}} '''[advancement]''' - The given modifications will be immediately applied to all units matching the filter.&lt;br /&gt;
** '''delayed_variable_substitution''' {{DevFeature1.13|5}} (boolean yes|no, default no): If set to &amp;quot;yes&amp;quot;, the wml block contained in this [object], [trait], or [advancement] is not variable-substituted at execution time of the event containing this [modify_unit]. You need this for any effect that uses variable substitution or when using [effect][filter] with a $this_unit. {{DevFeature1.13|9}} This is no longer needed when adding ABILITY_TELEPORT, ABILITY_LEADERSHIP or SPECIAL_BACKSTAB.&lt;br /&gt;
** Do not use a '''[modifications]''' tag, as this may skip some of the special-case handling for newly added objects, traits and advancements.&lt;br /&gt;
* '''[effect]''' {{DevFeature1.13|6}} Applies the effect directly to the unit.&lt;br /&gt;
* Accepts generally the syntax inside of wml unit variables created by [store_unit] which can be viewed in a savefile or by using the [[CommandMode|inspect command]]. Cannot remove things or add/alter unit animations. Subtags with the same name must be written in the correct order to match them with the tag they are supposed to modify. Note that keys will be processed in arbitrary order, which may cause problems if you use formulas that depend on other formulas. To work around this you may need to use the tag twice with the same filter.&lt;br /&gt;
example usage (see also the test scenario):&lt;br /&gt;
&amp;lt;syntaxhighlight lang='wml'&amp;gt;&lt;br /&gt;
[modify_unit]&lt;br /&gt;
  [filter]&lt;br /&gt;
    x,y=38,6&lt;br /&gt;
  [/filter]&lt;br /&gt;
  hitpoints=10&lt;br /&gt;
  {TRAIT_HEALTHY}&lt;br /&gt;
[/modify_unit]&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The unit which is currently modified is accessible via $this_unit, e.g. hitpoints = &amp;quot;$($this_unit.hitpoints / 2)&amp;quot; to set the hitpoints of all units to half of their particular maxima. This this_unit variable is independent from the this_unit variable available in the SUF used to determine which units to modify (first all matching units are gathered, and then all those are modified).&lt;br /&gt;
&lt;br /&gt;
'''Note:''' Some some properties of the units are reset sometimes (for example when the unit advances or when [remove_object] is called), so it's usually better to change them with [object] ([object] inside [modify_unit]) than to change those properties directly via [modify_unit]. The following properties are _not_ reset in [remove_object] and are thus safe to use directly in [modify_unit]:&lt;br /&gt;
* '''side'''&lt;br /&gt;
* '''gender'''&lt;br /&gt;
* '''name'''&lt;br /&gt;
* '''canrecruit'''&lt;br /&gt;
* '''unrenamable'''&lt;br /&gt;
* '''extra_recruit'''&lt;br /&gt;
* '''[variables]'''&lt;br /&gt;
* '''facing'''&lt;br /&gt;
* '''goto_x, goto_y'''&lt;br /&gt;
* '''hitpoints'''&lt;br /&gt;
* '''experience'''&lt;br /&gt;
* '''moves'''&lt;br /&gt;
* '''[status]''' (not sure on this one)&lt;br /&gt;
* '''attacks_left'''&lt;br /&gt;
* '''role'''&lt;br /&gt;
&lt;br /&gt;
=== [transform_unit] ===&lt;br /&gt;
Transforms every unit on the map matching the filter to the given unit type. Keeps intact hit points, experience and status. If the unit is transformed to a non-living type (undead or mechanical), it will be also unpoisoned. Hit points will be changed if necessary to respect the transformed unit's maximum hit points.&lt;br /&gt;
* [[StandardUnitFilter]]: do not use a [filter] tag.&lt;br /&gt;
* '''transform_to''': the unit type in which all the units matching the filter will be transformed. If missing, the units will follow their normal advancement.&lt;br /&gt;
&lt;br /&gt;
=== [petrify] ===&lt;br /&gt;
&lt;br /&gt;
* [[StandardUnitFilter]] as an argument. Do not use a [filter] tag. All units matching this filter are petrified. Recall list units are included.&lt;br /&gt;
&lt;br /&gt;
=== [unpetrify] ===&lt;br /&gt;
* [[StandardUnitFilter]] as an argument. Do not use a [filter] tag. All units matching this filter are unpetrified. Recall list units are included.&lt;br /&gt;
&lt;br /&gt;
=== [object] ===&lt;br /&gt;
Gives some unit an object which modifies their stats in some way.&lt;br /&gt;
* '''id''': (Optional) allows the item to be removed later. By default, an object with a defined ID can only be picked up once per scenario, even if it is removed later or first_time_only=no is set for the event. You can remove this restriction by setting take_only_once=no. For filtering objects, it might be simpler to use a custom key such as item_id. The id string can contain only letters, numbers and underscores.&lt;br /&gt;
* '''take_only_once''': (default yes) {{DevFeature1.13|6}} If set to &amp;quot;no&amp;quot;, the object's ID does not prevent it from being taken more than once.&lt;br /&gt;
* '''delayed_variable_substitution''' (boolean yes|no, default no): If set to &amp;quot;yes&amp;quot;, the wml block contained in this [object] is not variable-substituted at execution time of the event where this [object] is within.  You need this for any effect that uses variable substitution or when using [effect][filter] with a $this_unit. {{DevFeature1.13|9}} This is no longer needed when adding ABILITY_TELEPORT, ABILITY_LEADERSHIP or SPECIAL_BACKSTAB.&lt;br /&gt;
* '''[effect]''': one or more effect elements may be listed.  See [[EffectWML]] for a description of [effect].&lt;br /&gt;
* '''duration''':&lt;br /&gt;
**if 'scenario', effects only last until the end of the scenario.&lt;br /&gt;
**if 'forever' or not set, effects never wear off.&lt;br /&gt;
** if 'turn', effects only last until the start of the unit's next turn (when the unit refreshes movement and attacks). (Like other start-of-turn behavior, objects with a duration of &amp;quot;turn&amp;quot; won't expire before turn 2.)&lt;br /&gt;
** {{DevFeature1.13|1}} if 'turn end' or 'turn_end', effects only last until the end of the unit's next turn (exactly like the slowed status).&lt;br /&gt;
* '''[filter]''' with a [[StandardUnitFilter]] as argument. The first unit found that matches the filter will be given the object. Only on-map units are considered. If no unit matches or no [filter] is supplied, it is tried to apply the object to the unit at the $x1,$y1 location of the event where this [object] is in. The case of no unit being at that spot is handled in the same way as no unit matching a given filter ([else] commands executed, cannot_use_message displayed). Note that units on the recall list will not be checked. To add an [object] to a unit on the recall list you have to use '''[modify_unit][object]'''.&lt;br /&gt;
* '''[then]''': a subtag that lets you execute actions if the filter conditions are met.  The most common action that should be inside here is a '''[remove_item]''' tag, but you could probably put any tags that otherwise work in a [then] tag.&lt;br /&gt;
* '''[else]''': a subtag that lets you execute actions if the filter conditions are *not* met.&lt;br /&gt;
* '''silent''': whether or not messages should be suppressed. Default is &amp;quot;no&amp;quot;. {{DevFeature1.13|2}} If no description is provided, this defaults to yes, but can still be overridden.&lt;br /&gt;
* '''image''': the displayed image of the object.&lt;br /&gt;
* '''name''': (translatable) displayed as a caption of the image.&lt;br /&gt;
&lt;br /&gt;
* '''description''': (translatable) displayed as a message of the image.&lt;br /&gt;
* '''cannot_use_message''': (translatable) displayed instead of '''description''' if no unit passes the filter test.&lt;br /&gt;
&lt;br /&gt;
=== [remove_object] ===&lt;br /&gt;
&lt;br /&gt;
{{DevFeature1.13|6}}&lt;br /&gt;
&lt;br /&gt;
Removes an object from matching units.&lt;br /&gt;
&lt;br /&gt;
* [[StandardUnitFilter]]: All units matching the filter have matching objects removed. Use no [filter] tag.&lt;br /&gt;
* '''object_id''': The id of the object to be removed.&lt;br /&gt;
&lt;br /&gt;
Note that some unit properties are not restored ideally, e.g. current unit's health reversion might not work as expected (max_hitpoints will though). {{DevFeature1.15|0}} This was fixed.&lt;br /&gt;
&lt;br /&gt;
Note that remove_object worked the following way: Step1) remove thos objects from the unit wml, Step2) Rebuild the unit to make the changes effective. Step2 implies that changes done for example via [modify_unit] (or via the [store_unit] + [set_variable] + [unstore_unit] technique) will be reset if those changes change a property that is a property of the unit type. See the note under [modify_unit] to get a list of properties that can safely be changes via [modify_unit]&lt;br /&gt;
&lt;br /&gt;
=== [remove_shroud] ===&lt;br /&gt;
Removes some shroud from the map for a certain side (only relevant for sides that have shroud=yes).&lt;br /&gt;
* '''side''': (default=1) the side for which to remove shroud. This can be a comma-separated list of sides. note: Default side=1 for empty side= is deprecated.&lt;br /&gt;
* '''[filter_side]''' with a [[StandardSideFilter]] as argument&lt;br /&gt;
* [[StandardLocationFilter]]: the range of tiles for which shroud should be removed&lt;br /&gt;
&lt;br /&gt;
=== [place_shroud] ===&lt;br /&gt;
Places some shroud on the map for a certain side (only relevant for sides that have shroud=yes).&lt;br /&gt;
* '''side''': (default=1) the side for which to place shroud. This can be a comma-separated list. note: Default side=1 for empty side= is deprecated.&lt;br /&gt;
* '''[filter_side]''' with a [[StandardSideFilter]] as argument&lt;br /&gt;
* [[StandardLocationFilter]]: the range of tiles on which shroud should be placed&lt;br /&gt;
&lt;br /&gt;
=== [lift_fog] ===&lt;br /&gt;
Lifts the fog of war from parts of the map for a certain side (only relevant for sides that have fog=yes), allowing a player to witness what occurs there even if that player has no units within vision range.&lt;br /&gt;
* '''[filter_side]''' with a [[StandardSideFilter]] indicating which sides should be affected.&lt;br /&gt;
* [[StandardLocationFilter]]: the tiles from which fog should be lifted.&lt;br /&gt;
* '''multiturn''': ''yes/no, default:no''. The default (not multiturn) causes fog to be removed in the same way that normal vision works; the cleared tiles will remain cleared until fog is recalculated (which normally happens when a side ends its turn). When multiturn is set to &amp;quot;yes&amp;quot;, the cleared tiles remain clear until {{tag||reset_fog}} cancels the clearing. This allows tiles to remain clear for multiple turns, or to be refogged before the end of the current turn (without also refogging all tiles). Multiturn lifted fog is not shared with allies (even when share_view=yes).&lt;br /&gt;
&lt;br /&gt;
=== [reset_fog] ===&lt;br /&gt;
The primary use of this tag is to remove multiturn lifted fog (created by {{tag||lift_fog}}), which causes the fog to reset to what it would have been had WML not interfered. (That is, hexes that a side's units could not see at any point this turn will be re-fogged, while seen hexes remain defogged.)&lt;br /&gt;
* '''[filter_side]''' with a [[StandardSideFilter]] indicating which sides should be affected.&lt;br /&gt;
* [[StandardLocationFilter]]: the fog reset will be restricted to these tiles.&lt;br /&gt;
* '''reset_view''': ''yes/no, default: no'' If set to &amp;quot;yes&amp;quot;, then in addition to removing multiturn fog, the side's current view is canceled (independent of the SLF). This means that all hexes will become fogged for the side unless multiturn fog exists outside the tiles selected by the SLF. Normally, one would want the currently seen hexes to become clear of fog; this is done automatically at the end of many events, and it can be done manually with {{tag|InterfaceActionsWML|redraw}}.&lt;br /&gt;
Omitting both the SSF and the SLF would cancel all earlier uses of [lift_fog].&lt;br /&gt;
Additionally setting reset_view=&amp;quot;yes&amp;quot; would cause the side's entire map to be fogged (unless an ally keeps hexes clear by sharing its view).&lt;br /&gt;
&lt;br /&gt;
=== [allow_undo] ===&lt;br /&gt;
Normally when an event with a handler fires, the player's undo stack is cleared, preventing all actions performed so far from being undone. Including this tag in the event handler prevents the stack from being cleared for this reason, allowing the player to undo actions. (However, the stack might still be cleared for other reasons, such as fog being cleared or combat occurring.) In the common cases, this means '''[allow_undo]''' allows the current action to be undone even though an event was handled. There is a less common case, though &amp;amp;mdash; specifically when handling a menu item, where there is no current action &amp;amp;mdash; and in this case, '''[allow_undo]''' means merely that earlier actions can still be undone.&lt;br /&gt;
* Using this tag in a menu item has an additional side effect in 1.11. Starting with version 1.11.1, executing a WML menu item normally counts as doing something as far as the &amp;quot;you have not started your turn yet&amp;quot; dialog is concerned. However, a menu item whose handler includes '''[allow_undo]''' will not count.&lt;br /&gt;
&lt;br /&gt;
The types of actions that can be undone are movement, recalling, and dismissing a unit from the recall list. If an action is undone, only the position (or existence) of the involved unit will be restored; any altered variables or changes to the game will remain changed after the action is undone.  It is up to the scenario designer to avoid abusing this command.&lt;br /&gt;
* Technically, if '''[allow_undo]''' is inside an '''[event]''' with ''first_time_only=yes'' (the default setting), and the user undoes the event, then the state of the game has changed in this way: the event will not fire a second time, even though the user undid the action the first time.&lt;br /&gt;
* Although recalling can be undone, recruitment can not be undone; this seems to apply even when the recruit's traits are not randomly-generated (tested on 1.12.6 and 1.14.4+dev).&lt;br /&gt;
&lt;br /&gt;
If an '''[event]''' uses both '''[allow_undo]''' and [[InternalActionsWML#.5Bfire_event.5D|'''[fire_event]''']] then the '''[allow_undo]''' must be after the '''[fire_event]'''.&lt;br /&gt;
&lt;br /&gt;
Due to a bug in 1.12 (https://gna.org/bugs/?23323) '''[allow_undo]''' should not be used in events that use one of the following things because it might cause OOS: &lt;br /&gt;
* [message] with [option]s&lt;br /&gt;
* [get_global_variable]&lt;br /&gt;
* wesnoth.synchronize_choice&lt;br /&gt;
&lt;br /&gt;
While in 1.13 using '''[allow_undo]''' together with those things won't give you a guaranteed OOS, there are some non-obvious situations where it will, for example assume the following event:&lt;br /&gt;
&lt;br /&gt;
   [event]&lt;br /&gt;
     name=&amp;quot;moveto&amp;quot;&lt;br /&gt;
     [message]&lt;br /&gt;
       message = &amp;quot;message&amp;quot;&lt;br /&gt;
       [option]&lt;br /&gt;
         label = &amp;quot;option 1&amp;quot;&lt;br /&gt;
         [command]&lt;br /&gt;
         [/command]&lt;br /&gt;
       [/option]&lt;br /&gt;
       [option]&lt;br /&gt;
         label = &amp;quot;option 2&amp;quot;&lt;br /&gt;
         [command]&lt;br /&gt;
         [/command]&lt;br /&gt;
       [/option]&lt;br /&gt;
     [/message]&lt;br /&gt;
     [allow_undo]&lt;br /&gt;
     [/allow_undo]&lt;br /&gt;
   [/event]&lt;br /&gt;
&lt;br /&gt;
It will cause OOS when the message is undone: since the event is already executed (erased) on one client only , the clients will disagree about how many choices happen during the next moveto action.&lt;br /&gt;
&lt;br /&gt;
=== [on_undo] ===&lt;br /&gt;
{{DevFeature1.13|2}}&lt;br /&gt;
Contains commands to execute when the player undoes the action which triggered the parent event.&lt;br /&gt;
*'''delayed_variable_substitution''' {{DevFeature1.13|5}}: ''yes/no, default no (always no before 1.13.5)'' As in [[EventWML]], specifies whether to perform variable substitution when the parent event is run, or when the contents are run. If delayed substitution is used, [[SyntaxWML#Automatically_Stored_Variables|automatically stored variables]] from the parent event context are available, but may occasionally have unexpected values. (In particular, $unit.x and $unit.y may not have the expected value when undoing a move event, though $x1 and $y1 should be correct.)&lt;br /&gt;
&lt;br /&gt;
Note:&lt;br /&gt;
It is not clear where whether the actionwml in [on_undo] in executed before or after the action is undone. Also, specially for enter/leave_hex events the units position when executing the [on_undo] code is usually different than when executing the original event. The recommended way to work around these issues is to refer to the unit by id instead of position and store all other needed information variables as 'upvalues'. You can also move the actual undo code to an external event. For example&lt;br /&gt;
 [event]&lt;br /&gt;
   name=&amp;quot;undo_blah&amp;quot;&lt;br /&gt;
   first_time_only=no&lt;br /&gt;
   [store_unit]&lt;br /&gt;
     id=&amp;quot;$moved_unit_id&amp;quot;&lt;br /&gt;
   [/store_unit]&lt;br /&gt;
   ... do undo stuff stuff&lt;br /&gt;
 [/event]&lt;br /&gt;
 &lt;br /&gt;
 ...&lt;br /&gt;
 ... in some other event&lt;br /&gt;
   [on_undo]&lt;br /&gt;
     # store ''upvalues&lt;br /&gt;
     {VARIABLE moved_unit_id $unit.id}&lt;br /&gt;
     # call actual undo handler&lt;br /&gt;
     [fire_event]&lt;br /&gt;
       name = &amp;quot;undo_blah&amp;quot;&lt;br /&gt;
     [/fire_event]&lt;br /&gt;
   [on_undo]&lt;br /&gt;
&lt;br /&gt;
=== [on_redo] ===&lt;br /&gt;
{{DevFeature1.13|2}}&lt;br /&gt;
Same as [on_undo], except executes the commands on redo. Note that the parent event is not triggered again on a redo.&lt;br /&gt;
&lt;br /&gt;
{{DevFeature1.13|8}} [on_redo] is deprecated and has no effect anymore.&lt;br /&gt;
&lt;br /&gt;
Note that [on_redo] is not guaranteed to be called when redoing an action, the engine might also decide to just fire the original events again.&lt;br /&gt;
&lt;br /&gt;
=== [cancel_action] ===&lt;br /&gt;
Although Wesnoth 1.12 does not have this tag, it is the default behavior of {{tag|EventWML|enter_hex}}/{{tag|EventWML|leave_hex}} events in that version.&lt;br /&gt;
&lt;br /&gt;
{{DevFeature1.13|9}} In this version, [cancel_action] is recognised, but has no effect (a bug).&lt;br /&gt;
&lt;br /&gt;
{{DevFeature1.13|11}}&lt;br /&gt;
In an {{tag|EventWML|enter_hex}}/{{tag|EventWML|leave_hex}} event, interrupt the movement, leaving the unit where it is. This is intended to be used with an event that gives the player new information, to let the player choose whether to change their plans. For example, if the player has commanded a unit to move from (1,1) to (3,3) and attack a unit on (4,4); then a [cancel_action] inside an [enter_hex] event on (2,2) would make the unit stop on (2,2). A [cancel_action] inside an [enter_hex] on (3,3) would let the player choose whether to attack.&lt;br /&gt;
&lt;br /&gt;
=== [heal_unit] ===&lt;br /&gt;
Heal a unit. The variable '''$heal_amount''' will be set to the exact number of points healed (i.e can be less than the parameter '''amount''' if the unit is fully healed). $heal_amount contains only the number of hitpoints the first unit that was found got healed.&lt;br /&gt;
*  '''[filter]''': [[StandardUnitFilter]] All matching on-map units are healed. If no filter is supplied, it is tried to take the unit at $x1, $y1.&lt;br /&gt;
*  '''[filter_second]''': [[StandardUnitFilter]] all the units matching the filter ''and'' having the ''heals'' ability will have their animation played (if ''animate'' is set to yes) for each of the units healed.&lt;br /&gt;
*  '''amount''': (integer, default full) the maximum points the unit(s) will be healed. Can't set below 1 or above max_hitpoints. If &amp;quot;full&amp;quot;, sets hitpoints to max_hitpoints. Before 1.9 the default is 0.&lt;br /&gt;
*  '''animate''': a boolean which indicate if the healing animations must be played. (default no)&lt;br /&gt;
*  '''moves''': (integer, default 0) The maximum current movement points the units will be &amp;quot;healed&amp;quot;. Can't set below 0 or above max_moves. If &amp;quot;full&amp;quot;, sets moves to max_moves.&lt;br /&gt;
* '''restore_attacks''': (boolean, default no) Whether the units' attacks_left should be reset to their max_attacks (usually 1).&lt;br /&gt;
* '''restore_statuses''': (boolean, default yes) Whether standard statuses should be reset to &amp;quot;no&amp;quot;. This affects poisoned, slowed, petrified and unhealable. Before 1.9 this is always &amp;quot;no&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
=== [harm_unit] ===&lt;br /&gt;
Harms every unit matching the filter, for the specific damage amount.&lt;br /&gt;
*  '''[filter]''': [[StandardUnitFilter]] all matching units will be harmed (required).&lt;br /&gt;
*  '''[filter_second]''': [[StandardUnitFilter]] if present, the first matching unit will attack all the units matching the filter above.&lt;br /&gt;
*  '''amount''': the amount of damage that will be done (required).&lt;br /&gt;
*  '''alignment''': (default neutral) applies an alignment to the damage, this means that if alignment=chaotic, the damage will be increased at night and reduced at day.&lt;br /&gt;
*  '''damage_type''': if present, amount will be altered by unit resistance to the damage type specified.&lt;br /&gt;
*  '''kill''': (default yes) if yes, when a harmed unit goes to or below 0 HP, it is killed; if no its HP are set to 1.&lt;br /&gt;
*  '''fire_event''': (default no) if yes, when a unit is killed by harming, the corresponding events are fired.  If yes, also the corresponding advance and post advance events are fired.&lt;br /&gt;
*  '''animate''': (default no) if yes, scrolls to each unit before harming it and plays its defense (or attack, if it's the harmer) and death animations. Special values supported, other than the usual yes and no, are &amp;quot;attacker&amp;quot;, that means only the harmer will be animated, and &amp;quot;defender&amp;quot;, that means only the harmed units will be animated. If the supplied value is yes, attacker or defender also advancement animations are played.&lt;br /&gt;
*  '''[primary_attack], [secondary_attack]''': these set the weapon against which the harmed units will defend, and that the harming unit will use to attack, respectively (notice this is the opposite of '''[filter]''' and '''[filter_second]''' above). This allows for playing specific defense and attack animations. Both tags are expected to contain a [[FilterWML#Filtering_Weapons|Standard Weapon Filter]].&lt;br /&gt;
*  '''delay''': if animate=yes, sets the delay (in milliseconds, default 500) between each unit harming.&lt;br /&gt;
*  '''variable''': if present, the damage caused to the unit, altered by resistances, will be stored in a WML array with the given name, under the &amp;quot;harm_amount&amp;quot; key.&lt;br /&gt;
*  '''poisoned, slowed, petrified, unhealable''': (default no) if yes, every harmed unit that doesn't already have such status will have it set.&lt;br /&gt;
*  '''experience''': if yes, and there is a harmer, experience will be attributed like in regular combat.&lt;br /&gt;
*  '''resistance_multiplier''': the harmed unit's resistance is multiplied by the supplied value; this means that a value lower than 1 increases it, and a value greater than 1 decreases it. Default value is 1, that means no modification.&lt;br /&gt;
&lt;br /&gt;
=== [time_area] ===&lt;br /&gt;
How a day should progress in a given area. Everywhere not specified in a [time_area] tag is affected by the [time] tags in the [scenario] tag.&lt;br /&gt;
* [[StandardLocationFilter]]: the locations to affect. ''note: only for [event][time_area]s - at scenario toplevel [time_area] does not support [[StandardLocationFilter]], only location ranges''&lt;br /&gt;
* '''[time]''': one or more tags describing the new schedule, see [[TimeWML]].&lt;br /&gt;
* '''id''': an unique identifier assigned to a time_area. Optional, unless you want to remove the time_area later. Can be a comma-separated list when removing time_areas, see below.&lt;br /&gt;
* '''remove''': (boolean) yes/no value. Indicates whether the specified time_area should be removed. Requires an identifier. If no identifier is used, however, all time_areas are removed.&lt;br /&gt;
* '''current_time''': The time slot number (starting with zero) active at the creation of the area.&lt;br /&gt;
&lt;br /&gt;
''Example:'' (caves in parts of a map)&lt;br /&gt;
 [time_area]&lt;br /&gt;
     id = cave_area&lt;br /&gt;
     x = 1-2,4-5&lt;br /&gt;
     y = 1-2,1-2&lt;br /&gt;
     {UNDERGROUND}&lt;br /&gt;
 [/time_area]&lt;br /&gt;
&lt;br /&gt;
An id also allows using [time_area] to define plain areas, usable for event location filters: in this usage, we don't need a time, indeed (is this the reason why the key ''time'' is not required?). Example:&lt;br /&gt;
[code]&lt;br /&gt;
    # A unit standing on a glyph is fully cured:&lt;br /&gt;
    [time_area]&lt;br /&gt;
        id = glyphs&lt;br /&gt;
    x = 9,14&lt;br /&gt;
    y = 11,3&lt;br /&gt;
    [/time_area]&lt;br /&gt;
    [event]&lt;br /&gt;
        name = moveto&lt;br /&gt;
        first_time_only=no&lt;br /&gt;
        [filter]&lt;br /&gt;
            side = 1&lt;br /&gt;
            [filter_location]&lt;br /&gt;
                area = glyphs&lt;br /&gt;
            [/filter_location]&lt;br /&gt;
        [/filter]&lt;br /&gt;
        ...&lt;br /&gt;
[/code]&lt;br /&gt;
&lt;br /&gt;
=== [remove_time_area] ===&lt;br /&gt;
&lt;br /&gt;
{{DevFeature1.13|2}}&lt;br /&gt;
&lt;br /&gt;
This is a syntactic shortcut for [time_area] remove=.&lt;br /&gt;
* '''id''': Comma-separated list of time area ids to remove.&lt;br /&gt;
&lt;br /&gt;
=== [end_turn] ===&lt;br /&gt;
End the current side's turn. The current event is finished before the turn is ended. Also, if the current event (where the tag appears) has been fired by another event, that event (and the complete stack of other possible parent events) is ended before [end_turn] comes into affect. Also, events following the event stack that fired [end_turn] are not omitted (e.g. [end_turn] is used by a side turn event and a turn refresh event does something afterwards).&lt;br /&gt;
&lt;br /&gt;
=== [replace_map] ===&lt;br /&gt;
&lt;br /&gt;
Replaces the entire map.&lt;br /&gt;
* '''map''': Content of a wesnoth map file. example:&lt;br /&gt;
 map=&amp;quot;{campaigns/Heir_To_The_Throne/maps/01_The_Elves_Besieged.map}&amp;quot;&lt;br /&gt;
* '''map_file''': {{DevFeature1.13|?}} Path to a Wesnoth map file; can be used instead of '''map'''. The file will be loaded when the tag is executed, rather than being embedded wholesale in the preprocessed WML.&lt;br /&gt;
* '''expand''': if 'yes', allows the map size to increase. The expansion direction is currently always bottom-right.&lt;br /&gt;
* '''shrink''': if 'yes', allows the map size to decrease. If the map size is reduced, any units that would no longer be on the map due to its coordinates no longer existing will be put into the recall list.&lt;br /&gt;
Note: When a hex changes from a village terrain to a non-village terrain, and a team owned that village it loses that village. When a hex changes from a non-village terrain to a village terrain and there is a unit on that hex it does not automatically capture the village. The reason for not capturing villages it that there are too many choices to make; should a unit lose its movement points, should capture events be fired. It is easier to do this as wanted by the author in WML.&lt;br /&gt;
&lt;br /&gt;
=== [replace_schedule] ===&lt;br /&gt;
Replace the time of day schedule of the entire scenario.&lt;br /&gt;
* [[TimeWML]]: the new schedule.&lt;br /&gt;
* '''current_time''': The time slot number (starting with zero) active at schedule replacement.&lt;br /&gt;
&lt;br /&gt;
=== [tunnel] ===&lt;br /&gt;
&lt;br /&gt;
Create a tunnel between some locations, later usable by units to move from source hex to target hex (using the movement cost of unit on the target terrain).&lt;br /&gt;
&lt;br /&gt;
'''Behavior Change as of Wesnoth 1.13.6:''' Vision is now possible (and enabled by default) through tunnels and allied units on the exit hex do not block a tunnel by default any more. This is done in order for moves through tunnels to be consistent with other moves. The previous behavior can still be accomplished by using the new optional keys listed below.&lt;br /&gt;
&lt;br /&gt;
* '''[filter]''': (required) [[StandardUnitFilter]] the units which can use the tunnel. Leave empty for &amp;quot;all units&amp;quot;.&lt;br /&gt;
* '''[source]''': (required) [[StandardLocationFilter]] the source hex(es).&lt;br /&gt;
* '''[target]''': (required) [[StandardLocationFilter]] the target hex(es).&lt;br /&gt;
* '''id''': (optional) identifier for the tunnel, to allow removing.&lt;br /&gt;
* '''remove''': (boolean, default: no)  If yes, removes all defined tunnels with the same ID (then only id= is necessary).&lt;br /&gt;
* '''bidirectional''': (boolean, default: yes) If yes, creates also a tunnel in the other direction. &lt;br /&gt;
* '''always_visible''': (boolean, default: no) If yes, the possible movement of enemies under fog can be seen.&lt;br /&gt;
* '''allow_vision''': (boolean, default: yes) {{DevFeature1.13|6}} If no, vision through a tunnel is not possible. Note that in that case the tunnel cannot be used if the tunnel exit is under shroud (which previously was ''always'' the case).&lt;br /&gt;
* '''pass_allied_units''': (boolean, default: yes) {{DevFeature1.13|6}} If no, allied (including own) units on the exit hex block a tunnel.&lt;br /&gt;
* '''delayed_variable_substitution''' (boolean, default: yes): If yes, the WML block contained in this [tunnel] is not variable-substituted at execution time of the event where this [tunnel] is within. Instead, variables are substituted when the tunnel is used by a unit. See [[EventWML#Nested_Events]]&lt;br /&gt;
&lt;br /&gt;
(Note: The tunnel tag can also be used inside the [[AbilitiesWML|[teleport]]] ability, without remove= and id=).&lt;br /&gt;
&lt;br /&gt;
=== [do_command] ===&lt;br /&gt;
&lt;br /&gt;
{{DevFeature1.13|0}}&lt;br /&gt;
&lt;br /&gt;
Executes a command, specified using the same syntax as a [command] tag in [[ReplayWML]]. Not all [command]'s are valid: only these are accepted&lt;br /&gt;
&lt;br /&gt;
* [attack]&lt;br /&gt;
* [move]&lt;br /&gt;
* [recruit]&lt;br /&gt;
* [recall]&lt;br /&gt;
* [disband]&lt;br /&gt;
* [fire_event]&lt;br /&gt;
* [lua_ai] {{DevFeature1.13|12}} This has been removed and is replaced with [custom_command]&lt;br /&gt;
&lt;br /&gt;
The tags corresponding to player actions generally use the same codepath as if a player had ordered it. That means for example that only moves that player would be allowed to do are possible, and movement is interrupted when sighting enemy unit.&lt;br /&gt;
&lt;br /&gt;
One purpose of this tag is to allow scripting of noninteractive scenarios -- without a tag like this, this might require elaborate mechanisms to coerce ais in order to test these code paths.&lt;br /&gt;
&lt;br /&gt;
This command should always be replay safe.&lt;br /&gt;
&lt;br /&gt;
=== [put_to_recall_list] ===&lt;br /&gt;
&lt;br /&gt;
{{DevFeature1.13|0}}&lt;br /&gt;
&lt;br /&gt;
Puts a unit to the recall list of its side.&lt;br /&gt;
* '''[[StandardUnitFilter]]''': the unit(s) to get put to the recall list.&lt;br /&gt;
* '''heal''': (default=no) Whether the unit should be refreshed, similar to the unit moving to the recall list at the end of a scenario.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Useful Macros ==&lt;br /&gt;
There are some predefined macros that you find useful for direct actions. You can find a complete list along with a detailed explanation of how they work [http://www.wesnoth.org/macro-reference.xhtml here].&lt;br /&gt;
* '''{MOVE_UNIT}''': Moves a unit to another location in the map and the player sees the movement (unlike [teleport])&lt;br /&gt;
* '''{FULL_HEAL}''': Brings a unit to full HP&lt;br /&gt;
* '''{LOYAL_UNIT}''': Create a loyal unit&lt;br /&gt;
* '''{MODIFY_TERRAIN_MASK}''': Modify an area of terrain&lt;br /&gt;
&lt;br /&gt;
== See Also ==&lt;br /&gt;
&lt;br /&gt;
* [[InternalActionsWML]]&lt;br /&gt;
* [[InterfaceActionsWML]]&lt;br /&gt;
* [[EventWML]]&lt;br /&gt;
* [[ReferenceWML]]&lt;br /&gt;
&lt;br /&gt;
[[Category: WML Reference]]&lt;br /&gt;
[[Category: ActionsWML]]&lt;/div&gt;</summary>
		<author><name>Denispir</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.wesnoth.org/index.php?title=DirectActionsWML&amp;diff=65035</id>
		<title>DirectActionsWML</title>
		<link rel="alternate" type="text/html" href="https://wiki.wesnoth.org/index.php?title=DirectActionsWML&amp;diff=65035"/>
		<updated>2019-11-03T10:36:56Z</updated>

		<summary type="html">&lt;p&gt;Denispir: /* [unstore_unit] */ numerous changes of text and structure for  clarity&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{WML Tags}}&lt;br /&gt;
== Direct actions ==&lt;br /&gt;
&lt;br /&gt;
Direct actions are actions that have a direct effect on gameplay. They can be used inside of [[EventWML|events]].&lt;br /&gt;
&lt;br /&gt;
The following tags are actions:&lt;br /&gt;
&lt;br /&gt;
=== [endlevel] ===&lt;br /&gt;
Ends the scenario.&lt;br /&gt;
* '''result''': before the scenario is over, all events with ''name=result'' are triggered. If ''result=victory'', the player progresses to the next level (i.e., the next scenario in single player); if ''result=defeat'', the game returns to the main menu. &lt;br /&gt;
&lt;br /&gt;
When the result is &amp;quot;victory&amp;quot; the following keys can be used:&lt;br /&gt;
* '''bonus''': whether the player should get bonus gold (maximum possible gold that could have been earned by waiting the level out). The default is bonus=yes. {{DevFeature1.13|2}} Alternatively, a number, defining the bonus multiple (1.0 meaning full).&lt;br /&gt;
* '''carryover_report''': whether the player should receive a summary of the scenario outcome, the default is carryover_report=yes.&lt;br /&gt;
* '''save''': whether a start-of-scenario save should be created for the next scenario, the default is save=yes. Do not confuse this with saving of replays for the current scenario.&lt;br /&gt;
* '''replay_save''': whether a replay save for the current scenario is allowed, the default is replay_save=yes. If yes, the player's settings in preferences will be used to determine if a replay is saved. If no, will override and not save a replay.&lt;br /&gt;
* '''linger_mode''': If ...=yes, the screen is greyed out and there's the possibility to save before advancing to the next scenario, the default is linger_mode=yes.&lt;br /&gt;
* '''reveal_map''': (Multiplayer only) (Default is 'yes') If 'no', shroud doesn't disappear when game ended.&lt;br /&gt;
* '''next_scenario''': (default specified in '''[scenario]''' tag) the ID of the next scenario that should be played.  All units that side 1 controls at this point become available for recall in ''next_scenario''.&lt;br /&gt;
* '''carryover_percentage''': by default 80% of the gold is carried over to the next scenario, with this key the amount can be changed.&lt;br /&gt;
* '''carryover_add''': if yes the gold will be added to the starting gold the next scenario, if no the next scenario will start with the amount of the current scenario (after taxes) or the minimum in the next scenario. Default is no.&lt;br /&gt;
* '''music''': (default specified in '''[scenario]''' or '''[game_config]''' tags) a comma-separated list of music tracks from which one will be chosen and played once after any events related to the end of level result are executed; by default, victory_music is used on victory, and defeat_music on defeat.&lt;br /&gt;
* '''end_credits''': Whether to display the credits screen at the end of a single-player campaign. Defaults to ''yes''. Note that this has cumulative effects over the campaign - it persists even if the endlevel does not trigger the end of the campaign. See also [[CampaignWML]].&lt;br /&gt;
* '''end_text''': (translatable) Text that is shown centered in a black screen at the end of a campaign. Defaults to &amp;quot;The End&amp;quot;. Note that this has cumulative effects over the campaign - it persists even if the endlevel does not trigger the end of the campaign. See also [[CampaignWML]].&lt;br /&gt;
* '''end_text_duration''': Delay, in milliseconds, before displaying the game credits at the end of a campaign. In other words, for how much time '''end_text''' is displayed on screen. Defaults to 3500. Note that this has cumulative effects over the campaign - it persists even if the endlevel does not trigger the end of the campaign. See also [[CampaignWML]].&lt;br /&gt;
* &amp;lt;strike&amp;gt;'''[next_scenario_settings]''': Any tags or attribute children of this optional argument to [endlevel] are merged into the scenario/multiplayer tag of the *next* scenario. This allows you to e.g. reconfigure the [side] tags or settings, just before load. &amp;lt;/strike&amp;gt; This feature was removed in 1.11.17, it might be redesigned and reintroduced.&lt;br /&gt;
* &amp;lt;strike&amp;gt;'''[next_scenario_append]''': Any tags of this optional argument are appended at high level to the next scenario. This is most appropriate for [event] tags, although you may find other uses. Example test scenario for these features: https://gna.org/support/download.php?file_id=20119 &amp;lt;/strike&amp;gt; This feature was removed in 1.11.17, it might be redesigned and reintroduced.&lt;br /&gt;
* '''[result]''' {{DevFeature1.13|0}} Allows specification of a side specific result, this is for competitive multiplayer scenarios/campaigns where it might happen that one player wins but another player loses.  The following attributes are accepted and have the same effect as in '''[endlevel]''':&lt;br /&gt;
** '''result'''&lt;br /&gt;
** '''bonus'''&lt;br /&gt;
** '''carryover_percentage'''&lt;br /&gt;
** '''carryover_add'''&lt;br /&gt;
&lt;br /&gt;
And there is also&lt;br /&gt;
** '''side''' The number of the side for which these results should apply.&lt;br /&gt;
&lt;br /&gt;
=== [unit] ===&lt;br /&gt;
Creates a unit (either on the map, on a recall list, or into a variable for later use.)  For syntax see [[SingleUnitWML]].&lt;br /&gt;
* {{Short Note:Predefined Macro|GENERIC_UNIT}}&lt;br /&gt;
&lt;br /&gt;
This tag can also recall an existing unit, which happens when:&lt;br /&gt;
* the '''id=''' attribute is used&lt;br /&gt;
* a unit with that '''id=''' already exists&lt;br /&gt;
* (might be unnecessary) the existing unit is on the side's recall list&lt;br /&gt;
in this case, the unit is recalled at the '''x,y=''' or '''location_id=''' given, and any other data in the tag is ignored.&lt;br /&gt;
&lt;br /&gt;
Campaign authors: a usual way to recall plot-necessary heroes is to use a macro with the data for creating that hero. This helps during debugging, because you can skip to scenarios and the recall-or-create functionality means that any units which are normally met in a previous scenario are automatically created (otherwise some scenarios may be an instant loss). This can only be used for units that must survive the previous scenarios, as it would recreate units if they died in a previous scenario.&lt;br /&gt;
For example,&lt;br /&gt;
[https://github.com/wesnoth/wesnoth/blob/1.14.7/data/campaigns/Heir_To_The_Throne/utils/httt_utils.cfg#L685 HttT's NEED_DELFADOR macro].&lt;br /&gt;
&lt;br /&gt;
=== [recall] ===&lt;br /&gt;
Recalls a unit taking into account any [http://wiki.wesnoth.org/SingleUnitWML filter_recall] of the leader.   The unit is recalled free of charge, and is placed near its leader, e.g., if multiple leaders are present, near the first found which would be able to normally recall it.&lt;br /&gt;
&lt;br /&gt;
If neither a valid map location is provided nor a leader on the map would be able to recall it, the tag is ignored.&lt;br /&gt;
 &lt;br /&gt;
* [[StandardUnitFilter]]: the first matching unit will be recalled.  If no units match this tag is ignored. Do not use a [filter] tag. If a comma separated list is given, every unit currently considered for recall is checked against all the types (not each single one of the types against all units).&lt;br /&gt;
* '''x,y''': the unit is placed here instead of next to the leader.&lt;br /&gt;
* '''show''': yes/no, default yes: whether the unit is animated (faded in) or instantly displayed&lt;br /&gt;
* '''fire_event''': boolean yes|no (default no); whether any according prerecall or recall events shall be fired.&lt;br /&gt;
* '''check_passability''': (boolean yes|no, default yes): If yes, checks for terrain passability when placing the unit (a nearby passable hex is chosen).&lt;br /&gt;
* '''[secondary_unit]''': {{DevFeature1.13|?}} If present and show=yes, a matching unit will be chosen and their recruiting animation played.&lt;br /&gt;
&lt;br /&gt;
=== [teleport] ===&lt;br /&gt;
Teleports a unit on map. {{Short Note:Predefined Macro|TELEPORT_UNIT}}&lt;br /&gt;
* '''[filter]''': [[StandardUnitFilter]] the first unit matching this filter will be teleported.&lt;br /&gt;
* '''x,y''': the hex to teleport to. If that hex is occupied, the closest unoccupied hex will be used instead.&lt;br /&gt;
* '''clear_shroud''': should shroud be cleared on arrival&lt;br /&gt;
* '''animate''': should a teleport animation be played (if the unit doesn't have a teleport animation, it will fade out/fade in)&lt;br /&gt;
* '''check_passability''': (boolean yes|no, default yes): normally, units will not be teleported into terrain that is impassable for them. Setting this attribute to &amp;quot;no&amp;quot; permits it.&lt;br /&gt;
&lt;br /&gt;
(Note: There is also a ability named teleport, see [[AbilitiesWML]].)&lt;br /&gt;
&lt;br /&gt;
=== [terrain_mask] ===&lt;br /&gt;
Changes the terrain on the map.  See [[TerrainMaskWML]].&lt;br /&gt;
&lt;br /&gt;
=== [terrain] ===&lt;br /&gt;
Changes the terrain on the map.&lt;br /&gt;
* '''terrain''': the character of the terrain to use.  See [[TerrainCodesWML]] to see what letter a type of terrain uses.&lt;br /&gt;
* [[StandardLocationFilter]]. This [[StandardLocationFilter]]'s terrain= key is used for the new terrain, filtering by terrain can be done with a nested [[StandardLocationFilter]]: [and]terrain=terrain_string_to_be_filtered_for.&lt;br /&gt;
* '''layer''': (overlay|base|both, default=both) only change the specified layer.&lt;br /&gt;
* '''replace_if_failed''': (default=no) When replacing just one layer failed, try to replace the whole terrain. If '''terrain''' is an overlay only terrain, use the default_base as base layer. If the terrain has no default base, do nothing.&lt;br /&gt;
&lt;br /&gt;
If you want to remove the overlays from a terrain and leave only the base, use:&lt;br /&gt;
 layer=overlay&lt;br /&gt;
 terrain=&amp;quot;^&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Note:&amp;lt;/b&amp;gt; When a hex changes from a village terrain to a non-village terrain, and a team owned that village it loses that village. When a hex changes from a non-village terrain to a village terrain and there is a unit on that hex it does not automatically capture the village. The reason for not capturing villages it that there are too many choices to make; should a unit lose its movement points, should capture events be fired. It is easier to do this as wanted by the author in WML.&lt;br /&gt;
&lt;br /&gt;
=== [gold] ===&lt;br /&gt;
Gives sides gold.&lt;br /&gt;
* '''amount''': the amount of gold to give.&lt;br /&gt;
* '''side''': (default=1) the number of the side to give the gold to. Can be a comma-separated list of sides. note: Default side=1 for empty side= is deprecated.&lt;br /&gt;
* [[StandardSideFilter]] tags and keys; default for empty side= is all sides, as usual in a SSF.&lt;br /&gt;
&lt;br /&gt;
=== [unstore_unit] ===&lt;br /&gt;
This action allows placing into the game, either on the map or in a recall list, a unit defined or stored in a WML variable. It may be useful in different contexts:&lt;br /&gt;
* To replace on the map a unit after having operated a change. Some changes can only or more easily be performed in a WML variable (possibly also using Lua). For instance: new ability, magical full healing, special damage amount from a custom weapon... This usage is rather common.&lt;br /&gt;
* To place into the game a unit,usually a hero, at the moment it enters the story (possibly the very start of a campaign). this is for units which are directly defined in a WML variable, using [unit] with the key &amp;quot;to_variable&amp;quot;. This usage is rather uncommon, but good practice for code structure and clarity.&lt;br /&gt;
* To replace into the game a unit which was stored for a while in a variable, for instance to make it reapper in a later scenario.&lt;br /&gt;
The variable is not cleared. To unstore a unit from an array variable, iterate over it. See [[SyntaxWML]] and [[VariablesWML/How to use variables]] for more information about variable usage. See also [[InternalActionsWML#.5Bstore_unit.5D|[store_unit]]], [[ConditionalActionsWML|For]], [[ConditionalActionsWML#.5Bwhile.5D|[while]]] and [[InternalActionsWML#.5Bclear_variable.5D|[clear_variable]]].&lt;br /&gt;
&lt;br /&gt;
* '''variable''': The main key, required to indicate the name of the variable.&lt;br /&gt;
&lt;br /&gt;
Placement keys:&lt;br /&gt;
* '''x''' ,'''y''': A position on the map, or else on recall list (read further). The action normally just uses (x,y) values in the variable, otherwise they be indicated here, or override the original ones. To put the unit on the recall list of the unit's side, use &amp;quot;x,y=recall,recall&amp;quot; will (to change the side, change first $unit.side in the variable).&lt;br /&gt;
* '''find_vacant''' (yes|no, default no): Whether the unit should be placed on the nearest vacant tile to its specified location. If this is set to 'no' (default), then any unit on the same tile as the unit being unstored will be destroyed. ''(Note: Shouldn't the default value be changed to yes, to avoid this danger, and directly allow the feature below.)''&lt;br /&gt;
* '''check_passability''' (yes|no, default yes): Works in cooperation with find_vacant, which for this must have the value 'yes'. If check_passability also has the value 'yes', then the terrain is checked to be passable for the unit, else a neighbour tile is searched to place it. ''(Note: Shouldn't the default value be changed to yes, since it is crazy to place a unit in a cave wall for instance.)'' '''''(exits on versions 1.9 and later only)'''''.&lt;br /&gt;
&lt;br /&gt;
Text keys (they are probably useful only which have been stored into a WML variable to operate some change (ex: special damage amount, and then immediately replaced on map):&lt;br /&gt;
* '''text''': (translatable) A floating text to display above the unit, such as a damage amount.&lt;br /&gt;
* '''male_text''', '''female_text''': {{DevFeature1.13|2}} (translatable) gender-specific versions of the above&lt;br /&gt;
* '''red''', '''green''', '''blue''': (default=0,0,0) the color of the text. Values vary from 0-255. You may find it convenient to use the {COLOR_HARM} or {COLOR_HEAL} macro instead. (Use {COLOR_HARM} or {COLOR_HEAL} instead of the whole red,green,blue= line.)&lt;br /&gt;
&lt;br /&gt;
Advancement:&lt;br /&gt;
* '''advance''': (default=yes) if yes the unit is advanced if it has enough XP. When modifying XP make sure to do it from inside a [[EventWML#Multiplayer_safety|synchronized event]] or it may lead to OOS errors especially when several advancement paths exist. Note that advance and post advance events are called, so infinite loops can happen.&lt;br /&gt;
* '''animate''': (boolean yes|no, default yes) This is relevant only for a unit placed on the map, and which advances. Whether a unit animation defined for when they advance should be played (&amp;quot;levelout&amp;quot; and &amp;quot;levelin&amp;quot;, or fade to white and back).&lt;br /&gt;
* '''fire_event''' (yes|no, default no): Whether any advance/post advance events shall be fired if an advancement takes place, no effect otherwise.&lt;br /&gt;
&lt;br /&gt;
Units can be unstored with negative (or zero) hit points. This can be useful if modifying a unit in its last_breath event (as the unit's death is already the next step), but tends to look wrong in other cases. In particular, it is possible to have units with negative hit points in play. Such units are aberrations, subject to unusual behavior as the game compensates for them. (For example, such units are currently automatically hit&amp;amp;ndash;and killed&amp;amp;ndash;in combat.) The details of the unusual behavior are subject to change between stable releases without warning.&lt;br /&gt;
&lt;br /&gt;
=== [allow_recruit] ===&lt;br /&gt;
Allows a side to recruit units it couldn't previously recruit.&lt;br /&gt;
* '''type''': the types of units that the side can now recruit.&lt;br /&gt;
* '''side''': (default=1) the number of the side that is being allowed to recruit the units. This can be a comma-separated list note: Default side=1 for empty side= is deprecated.&lt;br /&gt;
* [[StandardSideFilter]] tags and keys; default for empty side= is all sides, as usual in a SSF.&lt;br /&gt;
&lt;br /&gt;
=== [allow_extra_recruit] ===&lt;br /&gt;
Allows a leader to recruit units it couldn't previously recruit.&lt;br /&gt;
These types add to the types the leader can recruit because of [side]recruit=.&lt;br /&gt;
* '''extra_recruit''': the types of units that the unit can now recruit.&lt;br /&gt;
* '''[[StandardUnitFilter]]''': All units matching this filter are modified. Does not match on recall list units.&lt;br /&gt;
&lt;br /&gt;
=== [disallow_recruit] ===&lt;br /&gt;
Prevents a side from recruiting units it could previously recruit.&lt;br /&gt;
* '''type''': the types of units that the side can no longer recruit. {{DevFeature1.13|0}} If omitted, all recruits for matching sides will be disallowed.&lt;br /&gt;
* '''side''': (default=1) the number of the side that may no longer recruit the units. This can be a comma-separated list note: Default side=1 for empty side= is deprecated.&lt;br /&gt;
* [[StandardSideFilter]] tags and keys; default for empty side= is all sides, as usual in a SSF.&lt;br /&gt;
&lt;br /&gt;
=== [disallow_extra_recruit] ===&lt;br /&gt;
Prevents a leader from recruiting units it could previously recruit.&lt;br /&gt;
* '''extra_recruit''': the types of units that the side can no longer recruit.&lt;br /&gt;
* '''[[StandardUnitFilter]]''': All units matching this filter are modified. Does not match on recall list units.&lt;br /&gt;
&lt;br /&gt;
=== [set_recruit] ===&lt;br /&gt;
Sets the units a side can recruit.&lt;br /&gt;
* '''recruit''': the types of units that the side can now recruit.&lt;br /&gt;
* '''side''': The number of the side that is having its recruitment set. This can be a comma-separated list.&lt;br /&gt;
* [[StandardSideFilter]] tags and keys; default for empty side= is all sides, as usual in a SSF.&lt;br /&gt;
&lt;br /&gt;
=== [set_extra_recruit] === &lt;br /&gt;
Sets the units a leader can recruit.&lt;br /&gt;
* '''extra_recruit''': the types of units that the leader can now recruit.&lt;br /&gt;
* '''[[StandardUnitFilter]]''': All units matching this filter are modified. Does not match on recall list units.&lt;br /&gt;
&lt;br /&gt;
=== [modify_side] ===&lt;br /&gt;
Modifies some details of a given side in the middle of a scenario.  '''The following listed properties are the only properties that [modify_side] can affect!'''&lt;br /&gt;
* '''side''': (default=1) the number of the side that is to be changed. note: Default side=1 for empty side= is deprecated.&lt;br /&gt;
* '''[filter_side]''' with a [[StandardSideFilter]] as argument&lt;br /&gt;
* '''income''': the income given at the begining of each turn.&lt;br /&gt;
* '''recruit''': a list of unit types, replacing the side's current recruitment list.&lt;br /&gt;
* '''team_name''': the team in which the side plays the scenario.&lt;br /&gt;
* '''user_team_name''': a translatable string representing the team's description. This has no effect on alliances. Defaults to ''team_name''.&lt;br /&gt;
* '''side_name''': {{DevFeature1.13|?}} a translatable string representing the side leader's description.&lt;br /&gt;
* '''gold''': the amount of gold the side owns.&lt;br /&gt;
* '''village_gold''': the income setting per village for the side.&lt;br /&gt;
* '''controller''': the identifier string of the side's controller. Uses the same syntax of the ''controller'' key in the [[SideWML|[side]]] tag. warning: in multiplayer, changing the controller of a side might result in OOS during some events like, for example 'side_turn_end'; see [https://github.com/wesnoth/wesnoth/issues/2563 issue #2563].&lt;br /&gt;
* '''fog''': a boolean string (yes/no) describing the status of Fog for the side.&lt;br /&gt;
* '''shroud''': a boolean string describing the status of Shroud for the side.&lt;br /&gt;
* '''hidden''': a boolean string specifying whether side is shown in status table.&lt;br /&gt;
* '''color''': a team color range specification, name (e.g. &amp;quot;red&amp;quot;, &amp;quot;blue&amp;quot;), or number (e.g. &amp;quot;1&amp;quot;, &amp;quot;2&amp;quot;) for this side. The default color range names, numbers, and definitions can be found in data/core/team_colors.cfg.&lt;br /&gt;
* '''[ai]''': sets/changes AI parameters for the side. Only parameters that are specified in the tag are changed, this does not reset others to their default values. Uses the same syntax as described in [[AiWML]].  Note that [modify_side][ai] works for all simple AI parameters and some, but not all, of the composite ones. If in doubt, use [http://wiki.wesnoth.org/AiWML#Adding_and_Deleting_Aspects_with_the_.5Bmodify_ai.5D_Tag [modify_ai]] instead, which always works. {{DevFeature1.13|?}} If this contains an '''ai_algorithm''', the AI parameters will be reset to those of the indicated AI before adding any additional parameters included in the tag. In other words, this allows replacing the AI config rather than appending to it.&lt;br /&gt;
* '''switch_ai''': replaces a side ai with a new AI from specified file(ignoring those AI parameters above). Path to file follows the usual WML convention.&lt;br /&gt;
* '''reset_maps''': If set to &amp;quot;yes&amp;quot;, then the shroud is spread to all hexes, covering the parts of the map that had already been explored by the side, including hexes currently seen. (Seen hexes will be cleared at the end of most events; they can also be manually cleared with {{tag|InterfaceActionsWML|redraw}}.) This is only effective if shroud is on, but this is evaluated after shroud= (and before shroud_data=).&lt;br /&gt;
* '''reset_view''': If set to &amp;quot;yes&amp;quot;, then the fog of war is spread to all hexes, covering the parts of the map that had already been seen this turn by the side, including hexes currently seen, excluding hexes affected by multi-turn {{tag|DirectActionsWML|lift_fog}}. (Seen hexes will be cleared at the end of most events; they can also be manually cleared with {{tag|InterfaceActionsWML|redraw}}.) This is only effective if fog is on, but this is evaluated after fog=.&lt;br /&gt;
* '''share_maps''': change the share_maps side attribute. Be sure to use shroud=yes for that side and have it as an ally&lt;br /&gt;
* '''share_view''': change the share_view side attribute. Be sure to use fog=yes for that side and have it as an ally&lt;br /&gt;
* '''share_vision''': change both the above at the same time&lt;br /&gt;
* '''shroud_data''': changes to the side's shroud, using the same format as when defining the [side].&lt;br /&gt;
* '''suppress_end_turn_confirmation''': Boolean value controlling whether or not a player is asked for confirmation when skipping a turn.&lt;br /&gt;
* '''scroll_to_leader''': Boolean value controlling whether or not the game view scrolls to the side leader at the start of their turn when present.&lt;br /&gt;
* '''flag''': Flag animation for villages owned by this side (see [[SideWML|[side]]]).&lt;br /&gt;
* '''flag_icon''': Flag icon used for this side in the status bar (see [[SideWML|[side]]]).&lt;br /&gt;
* '''village_support''': The number of unit levels this side is able to support (does not pay upkeep on) per village it controls.&lt;br /&gt;
* '''defeat_condition''' {{DevFeature1.13|0}}: When the side is considered defeated (see [[SideWML|[side]]]).&lt;br /&gt;
&lt;br /&gt;
=== [modify_turns] ===&lt;br /&gt;
Modifies the turn limit in the middle of a scenario.&lt;br /&gt;
* '''value''': the new turn limit.&lt;br /&gt;
* '''add''': if used instead of ''value'', specifies the number of turns to add to the current limit (can be negative).&lt;br /&gt;
* '''current''': changes the current turn number after applying turn limit modifications, if any. It is not possible to change the turn number to exceed the turn limit (1 &amp;lt;= current turns &amp;lt;= max turns).&lt;br /&gt;
&lt;br /&gt;
=== [allow_end_turn] ===&lt;br /&gt;
Allows human players to end their turn through the user interface if they were previously affected by the '''[disallow_end_turn]''' action. This action doesn't take any arguments.&lt;br /&gt;
&lt;br /&gt;
=== [disallow_end_turn] ===&lt;br /&gt;
Disallows human players to end their turn through the user interface. This action doesn't require arguments.&lt;br /&gt;
* '''reason''' (translatable): {{DevFeature1.15|0}} Allows to optionally specify a reason.&lt;br /&gt;
&lt;br /&gt;
=== [capture_village] ===&lt;br /&gt;
Changes the ownership of a village.&lt;br /&gt;
* [[StandardLocationFilter]]: all village locations matching the filter are affected.&lt;br /&gt;
* '''side''': the side that takes control of the village. This side needs to have a leader (canrecruit=yes). If the side key is not given, the village will become neutral (unless [filter_side] is present, in which case that side fiter decides, see below).&lt;br /&gt;
* '''[filter_side]''' with [[StandardSideFilter]] tags and keys as arguments; if both this tag and inline side= are present it's an error. Otherwise, the first matching side gets ownership (or the village becomes neutral if none match).&lt;br /&gt;
* '''fire_event''' (boolean yes|no, default: no): Whether any capture events shall be fired.&lt;br /&gt;
&lt;br /&gt;
=== [kill] ===&lt;br /&gt;
Removes all units (including units in a recall list) that match the filter from the game.&lt;br /&gt;
* [[StandardUnitFilter]]: Selection criterion; do not use a [filter] tag.&lt;br /&gt;
* '''animate''' (default 'no'): if 'yes', displays the unit dying (fading away). {{DevFeature1.13|8}} If '''[secondary_unit]''' is given, also plays the victory animation of that unit.&lt;br /&gt;
* '''fire_event''' (default 'no'): if 'yes', triggers any appropriate 'die' events (See [[EventWML]]). Note that events are only fired for killed units that have been on the map (as opposed to recall list).&lt;br /&gt;
* '''[secondary_unit]''' with a [[StandardUnitFilter]] as argument. Do not use a [filter] tag. Has an effect only if fire_event=yes ({{DevFeature1.13|8}} or if it has a victory animation and animate=yes). The first on-map unit matching the filter becomes second_unit in any fired die and last breath events. If an on-map unit matches and if there are several units killed with a single [kill] tag, second_unit is this same unit for all of them. If no on-map unit matches or [secondary_unit] isn't present, the variable second_unit in each of the die and last breath events is always the same as the variable unit (the dying unit).&lt;br /&gt;
* '''[primary_attack]''', '''[secondary_attack]''' {{DevFeature1.13|8}} The attacks to use for matching the animation. Useful for example on the wose, whose death animation depends on the damage type it was killed by.&lt;br /&gt;
&lt;br /&gt;
=== [move_unit] ===&lt;br /&gt;
Moves a unit along a path on the map. The path can be specified exactly, or as a series of waypoints that the unit will pass through.&lt;br /&gt;
* [[StandardUnitFilter]] as argument; do not use a [filter] tag. All units matching the filter are moved. If the target location is occupied, the nearest free location is chosen.&lt;br /&gt;
* '''to_x''' (unsigned integer): The units are moved to this x coordinate. Can be a comma-separated list, in which case the unit follows this given path during the move.&lt;br /&gt;
* '''to_y''' (unsigned integer): The units are moved to this y coordinate. Can be a comma-separated list.&lt;br /&gt;
* '''dir''' (string): {{DevFeature1.15|0}} Performs a relative movement instead of an absolute movement. For example, dir=n,n,nw will move two spaces north and then one space to the northwest. This is used instead of '''to_x''' and '''to_y'''.&lt;br /&gt;
* '''to_location''': {{DevFeature1.15|0}} Moves matching units to locations placed in the map editor with the &amp;quot;New Location&amp;quot; button. Can be a comma-separated list. This is used instead of '''to_x''' and '''to_y'''.&lt;br /&gt;
* '''fire_event''' (optional, boolean yes|no, default no): Whether any according moveto events shall be fired. The target location ($x1, $y1 in the event) may not be the same location that the unit was tried to be moved to, if the original target location is occupied or impassable.&lt;br /&gt;
* '''check_passability''' (boolean yes|no, default yes): Whether the terrain the unit is moved to should be checked for suiting the unit. (If it does not, a nearby suitable hex is chosen.)&lt;br /&gt;
* '''force_scroll''': Whether to scroll the map or not even when [[InterfaceActionsWML#.5Block_view.5D|[lock_view]]] is in effect or ''Follow Unit Actions'' is disabled in ''Advanced Preferences''. Defaults to using [[InterfaceActionsWML#.5Bmove_unit_fake.5D|[move_unit_fake]]]'s default value.&lt;br /&gt;
&lt;br /&gt;
=== [modify_ai] ===&lt;br /&gt;
Changes AI objects (aspects, goals, candidate actions or stages) for a specified side. See [[Modifying_AI_Components#The_.5Bmodify_ai.5D_Tag|Modifying AI Components]] for full description.&lt;br /&gt;
&lt;br /&gt;
* '''action''' (string): Takes values 'add', 'change', 'delete' or 'try_delete' to do just that for the AI object.&lt;br /&gt;
* '''path''' (string): Describes which AI object is to be modified.  &lt;br /&gt;
* '''[facet]''', '''[goal]''', '''[candidate_action]''' or '''[stage]''': Details about the AI object to be modified.&lt;br /&gt;
* [[StandardSideFilter]] tags and keys; default for empty side= is all sides, as usual in a SSF.&lt;br /&gt;
&lt;br /&gt;
=== [modify_unit] ===&lt;br /&gt;
works similar to the MODIFY_UNIT macro.&lt;br /&gt;
* '''[filter]''' with a [[StandardUnitFilter]] as argument. All units matching this filter are modified. Matches on recall list units too.&lt;br /&gt;
* '''[object]''', '''[trait]''', {{DevFeature1.13|5}} '''[advancement]''' - The given modifications will be immediately applied to all units matching the filter.&lt;br /&gt;
** '''delayed_variable_substitution''' {{DevFeature1.13|5}} (boolean yes|no, default no): If set to &amp;quot;yes&amp;quot;, the wml block contained in this [object], [trait], or [advancement] is not variable-substituted at execution time of the event containing this [modify_unit]. You need this for any effect that uses variable substitution or when using [effect][filter] with a $this_unit. {{DevFeature1.13|9}} This is no longer needed when adding ABILITY_TELEPORT, ABILITY_LEADERSHIP or SPECIAL_BACKSTAB.&lt;br /&gt;
** Do not use a '''[modifications]''' tag, as this may skip some of the special-case handling for newly added objects, traits and advancements.&lt;br /&gt;
* '''[effect]''' {{DevFeature1.13|6}} Applies the effect directly to the unit.&lt;br /&gt;
* Accepts generally the syntax inside of wml unit variables created by [store_unit] which can be viewed in a savefile or by using the [[CommandMode|inspect command]]. Cannot remove things or add/alter unit animations. Subtags with the same name must be written in the correct order to match them with the tag they are supposed to modify. Note that keys will be processed in arbitrary order, which may cause problems if you use formulas that depend on other formulas. To work around this you may need to use the tag twice with the same filter.&lt;br /&gt;
example usage (see also the test scenario):&lt;br /&gt;
&amp;lt;syntaxhighlight lang='wml'&amp;gt;&lt;br /&gt;
[modify_unit]&lt;br /&gt;
  [filter]&lt;br /&gt;
    x,y=38,6&lt;br /&gt;
  [/filter]&lt;br /&gt;
  hitpoints=10&lt;br /&gt;
  {TRAIT_HEALTHY}&lt;br /&gt;
[/modify_unit]&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The unit which is currently modified is accessible via $this_unit, e.g. hitpoints = &amp;quot;$($this_unit.hitpoints / 2)&amp;quot; to set the hitpoints of all units to half of their particular maxima. This this_unit variable is independent from the this_unit variable available in the SUF used to determine which units to modify (first all matching units are gathered, and then all those are modified).&lt;br /&gt;
&lt;br /&gt;
'''Note:''' Some some properties of the units are reset sometimes (for example when the unit advances or when [remove_object] is called), so it's usually better to change them with [object] ([object] inside [modify_unit]) than to change those properties directly via [modify_unit]. The following properties are _not_ reset in [remove_object] and are thus safe to use directly in [modify_unit]:&lt;br /&gt;
* '''side'''&lt;br /&gt;
* '''gender'''&lt;br /&gt;
* '''name'''&lt;br /&gt;
* '''canrecruit'''&lt;br /&gt;
* '''unrenamable'''&lt;br /&gt;
* '''extra_recruit'''&lt;br /&gt;
* '''[variables]'''&lt;br /&gt;
* '''facing'''&lt;br /&gt;
* '''goto_x, goto_y'''&lt;br /&gt;
* '''hitpoints'''&lt;br /&gt;
* '''experience'''&lt;br /&gt;
* '''moves'''&lt;br /&gt;
* '''[status]''' (not sure on this one)&lt;br /&gt;
* '''attacks_left'''&lt;br /&gt;
* '''role'''&lt;br /&gt;
&lt;br /&gt;
=== [transform_unit] ===&lt;br /&gt;
Transforms every unit on the map matching the filter to the given unit type. Keeps intact hit points, experience and status. If the unit is transformed to a non-living type (undead or mechanical), it will be also unpoisoned. Hit points will be changed if necessary to respect the transformed unit's maximum hit points.&lt;br /&gt;
* [[StandardUnitFilter]]: do not use a [filter] tag.&lt;br /&gt;
* '''transform_to''': the unit type in which all the units matching the filter will be transformed. If missing, the units will follow their normal advancement.&lt;br /&gt;
&lt;br /&gt;
=== [petrify] ===&lt;br /&gt;
&lt;br /&gt;
* [[StandardUnitFilter]] as an argument. Do not use a [filter] tag. All units matching this filter are petrified. Recall list units are included.&lt;br /&gt;
&lt;br /&gt;
=== [unpetrify] ===&lt;br /&gt;
* [[StandardUnitFilter]] as an argument. Do not use a [filter] tag. All units matching this filter are unpetrified. Recall list units are included.&lt;br /&gt;
&lt;br /&gt;
=== [object] ===&lt;br /&gt;
Gives some unit an object which modifies their stats in some way.&lt;br /&gt;
* '''id''': (Optional) allows the item to be removed later. By default, an object with a defined ID can only be picked up once per scenario, even if it is removed later or first_time_only=no is set for the event. You can remove this restriction by setting take_only_once=no. For filtering objects, it might be simpler to use a custom key such as item_id. The id string can contain only letters, numbers and underscores.&lt;br /&gt;
* '''take_only_once''': (default yes) {{DevFeature1.13|6}} If set to &amp;quot;no&amp;quot;, the object's ID does not prevent it from being taken more than once.&lt;br /&gt;
* '''delayed_variable_substitution''' (boolean yes|no, default no): If set to &amp;quot;yes&amp;quot;, the wml block contained in this [object] is not variable-substituted at execution time of the event where this [object] is within.  You need this for any effect that uses variable substitution or when using [effect][filter] with a $this_unit. {{DevFeature1.13|9}} This is no longer needed when adding ABILITY_TELEPORT, ABILITY_LEADERSHIP or SPECIAL_BACKSTAB.&lt;br /&gt;
* '''[effect]''': one or more effect elements may be listed.  See [[EffectWML]] for a description of [effect].&lt;br /&gt;
* '''duration''':&lt;br /&gt;
**if 'scenario', effects only last until the end of the scenario.&lt;br /&gt;
**if 'forever' or not set, effects never wear off.&lt;br /&gt;
** if 'turn', effects only last until the start of the unit's next turn (when the unit refreshes movement and attacks). (Like other start-of-turn behavior, objects with a duration of &amp;quot;turn&amp;quot; won't expire before turn 2.)&lt;br /&gt;
** {{DevFeature1.13|1}} if 'turn end' or 'turn_end', effects only last until the end of the unit's next turn (exactly like the slowed status).&lt;br /&gt;
* '''[filter]''' with a [[StandardUnitFilter]] as argument. The first unit found that matches the filter will be given the object. Only on-map units are considered. If no unit matches or no [filter] is supplied, it is tried to apply the object to the unit at the $x1,$y1 location of the event where this [object] is in. The case of no unit being at that spot is handled in the same way as no unit matching a given filter ([else] commands executed, cannot_use_message displayed). Note that units on the recall list will not be checked. To add an [object] to a unit on the recall list you have to use '''[modify_unit][object]'''.&lt;br /&gt;
* '''[then]''': a subtag that lets you execute actions if the filter conditions are met.  The most common action that should be inside here is a '''[remove_item]''' tag, but you could probably put any tags that otherwise work in a [then] tag.&lt;br /&gt;
* '''[else]''': a subtag that lets you execute actions if the filter conditions are *not* met.&lt;br /&gt;
* '''silent''': whether or not messages should be suppressed. Default is &amp;quot;no&amp;quot;. {{DevFeature1.13|2}} If no description is provided, this defaults to yes, but can still be overridden.&lt;br /&gt;
* '''image''': the displayed image of the object.&lt;br /&gt;
* '''name''': (translatable) displayed as a caption of the image.&lt;br /&gt;
&lt;br /&gt;
* '''description''': (translatable) displayed as a message of the image.&lt;br /&gt;
* '''cannot_use_message''': (translatable) displayed instead of '''description''' if no unit passes the filter test.&lt;br /&gt;
&lt;br /&gt;
=== [remove_object] ===&lt;br /&gt;
&lt;br /&gt;
{{DevFeature1.13|6}}&lt;br /&gt;
&lt;br /&gt;
Removes an object from matching units.&lt;br /&gt;
&lt;br /&gt;
* [[StandardUnitFilter]]: All units matching the filter have matching objects removed. Use no [filter] tag.&lt;br /&gt;
* '''object_id''': The id of the object to be removed.&lt;br /&gt;
&lt;br /&gt;
Note that some unit properties are not restored ideally, e.g. current unit's health reversion might not work as expected (max_hitpoints will though). {{DevFeature1.15|0}} This was fixed.&lt;br /&gt;
&lt;br /&gt;
Note that remove_object worked the following way: Step1) remove thos objects from the unit wml, Step2) Rebuild the unit to make the changes effective. Step2 implies that changes done for example via [modify_unit] (or via the [store_unit] + [set_variable] + [unstore_unit] technique) will be reset if those changes change a property that is a property of the unit type. See the note under [modify_unit] to get a list of properties that can safely be changes via [modify_unit]&lt;br /&gt;
&lt;br /&gt;
=== [remove_shroud] ===&lt;br /&gt;
Removes some shroud from the map for a certain side (only relevant for sides that have shroud=yes).&lt;br /&gt;
* '''side''': (default=1) the side for which to remove shroud. This can be a comma-separated list of sides. note: Default side=1 for empty side= is deprecated.&lt;br /&gt;
* '''[filter_side]''' with a [[StandardSideFilter]] as argument&lt;br /&gt;
* [[StandardLocationFilter]]: the range of tiles for which shroud should be removed&lt;br /&gt;
&lt;br /&gt;
=== [place_shroud] ===&lt;br /&gt;
Places some shroud on the map for a certain side (only relevant for sides that have shroud=yes).&lt;br /&gt;
* '''side''': (default=1) the side for which to place shroud. This can be a comma-separated list. note: Default side=1 for empty side= is deprecated.&lt;br /&gt;
* '''[filter_side]''' with a [[StandardSideFilter]] as argument&lt;br /&gt;
* [[StandardLocationFilter]]: the range of tiles on which shroud should be placed&lt;br /&gt;
&lt;br /&gt;
=== [lift_fog] ===&lt;br /&gt;
Lifts the fog of war from parts of the map for a certain side (only relevant for sides that have fog=yes), allowing a player to witness what occurs there even if that player has no units within vision range.&lt;br /&gt;
* '''[filter_side]''' with a [[StandardSideFilter]] indicating which sides should be affected.&lt;br /&gt;
* [[StandardLocationFilter]]: the tiles from which fog should be lifted.&lt;br /&gt;
* '''multiturn''': ''yes/no, default:no''. The default (not multiturn) causes fog to be removed in the same way that normal vision works; the cleared tiles will remain cleared until fog is recalculated (which normally happens when a side ends its turn). When multiturn is set to &amp;quot;yes&amp;quot;, the cleared tiles remain clear until {{tag||reset_fog}} cancels the clearing. This allows tiles to remain clear for multiple turns, or to be refogged before the end of the current turn (without also refogging all tiles). Multiturn lifted fog is not shared with allies (even when share_view=yes).&lt;br /&gt;
&lt;br /&gt;
=== [reset_fog] ===&lt;br /&gt;
The primary use of this tag is to remove multiturn lifted fog (created by {{tag||lift_fog}}), which causes the fog to reset to what it would have been had WML not interfered. (That is, hexes that a side's units could not see at any point this turn will be re-fogged, while seen hexes remain defogged.)&lt;br /&gt;
* '''[filter_side]''' with a [[StandardSideFilter]] indicating which sides should be affected.&lt;br /&gt;
* [[StandardLocationFilter]]: the fog reset will be restricted to these tiles.&lt;br /&gt;
* '''reset_view''': ''yes/no, default: no'' If set to &amp;quot;yes&amp;quot;, then in addition to removing multiturn fog, the side's current view is canceled (independent of the SLF). This means that all hexes will become fogged for the side unless multiturn fog exists outside the tiles selected by the SLF. Normally, one would want the currently seen hexes to become clear of fog; this is done automatically at the end of many events, and it can be done manually with {{tag|InterfaceActionsWML|redraw}}.&lt;br /&gt;
Omitting both the SSF and the SLF would cancel all earlier uses of [lift_fog].&lt;br /&gt;
Additionally setting reset_view=&amp;quot;yes&amp;quot; would cause the side's entire map to be fogged (unless an ally keeps hexes clear by sharing its view).&lt;br /&gt;
&lt;br /&gt;
=== [allow_undo] ===&lt;br /&gt;
Normally when an event with a handler fires, the player's undo stack is cleared, preventing all actions performed so far from being undone. Including this tag in the event handler prevents the stack from being cleared for this reason, allowing the player to undo actions. (However, the stack might still be cleared for other reasons, such as fog being cleared or combat occurring.) In the common cases, this means '''[allow_undo]''' allows the current action to be undone even though an event was handled. There is a less common case, though &amp;amp;mdash; specifically when handling a menu item, where there is no current action &amp;amp;mdash; and in this case, '''[allow_undo]''' means merely that earlier actions can still be undone.&lt;br /&gt;
* Using this tag in a menu item has an additional side effect in 1.11. Starting with version 1.11.1, executing a WML menu item normally counts as doing something as far as the &amp;quot;you have not started your turn yet&amp;quot; dialog is concerned. However, a menu item whose handler includes '''[allow_undo]''' will not count.&lt;br /&gt;
&lt;br /&gt;
The types of actions that can be undone are movement, recalling, and dismissing a unit from the recall list. If an action is undone, only the position (or existence) of the involved unit will be restored; any altered variables or changes to the game will remain changed after the action is undone.  It is up to the scenario designer to avoid abusing this command.&lt;br /&gt;
* Technically, if '''[allow_undo]''' is inside an '''[event]''' with ''first_time_only=yes'' (the default setting), and the user undoes the event, then the state of the game has changed in this way: the event will not fire a second time, even though the user undid the action the first time.&lt;br /&gt;
* Although recalling can be undone, recruitment can not be undone; this seems to apply even when the recruit's traits are not randomly-generated (tested on 1.12.6 and 1.14.4+dev).&lt;br /&gt;
&lt;br /&gt;
If an '''[event]''' uses both '''[allow_undo]''' and [[InternalActionsWML#.5Bfire_event.5D|'''[fire_event]''']] then the '''[allow_undo]''' must be after the '''[fire_event]'''.&lt;br /&gt;
&lt;br /&gt;
Due to a bug in 1.12 (https://gna.org/bugs/?23323) '''[allow_undo]''' should not be used in events that use one of the following things because it might cause OOS: &lt;br /&gt;
* [message] with [option]s&lt;br /&gt;
* [get_global_variable]&lt;br /&gt;
* wesnoth.synchronize_choice&lt;br /&gt;
&lt;br /&gt;
While in 1.13 using '''[allow_undo]''' together with those things won't give you a guaranteed OOS, there are some non-obvious situations where it will, for example assume the following event:&lt;br /&gt;
&lt;br /&gt;
   [event]&lt;br /&gt;
     name=&amp;quot;moveto&amp;quot;&lt;br /&gt;
     [message]&lt;br /&gt;
       message = &amp;quot;message&amp;quot;&lt;br /&gt;
       [option]&lt;br /&gt;
         label = &amp;quot;option 1&amp;quot;&lt;br /&gt;
         [command]&lt;br /&gt;
         [/command]&lt;br /&gt;
       [/option]&lt;br /&gt;
       [option]&lt;br /&gt;
         label = &amp;quot;option 2&amp;quot;&lt;br /&gt;
         [command]&lt;br /&gt;
         [/command]&lt;br /&gt;
       [/option]&lt;br /&gt;
     [/message]&lt;br /&gt;
     [allow_undo]&lt;br /&gt;
     [/allow_undo]&lt;br /&gt;
   [/event]&lt;br /&gt;
&lt;br /&gt;
It will cause OOS when the message is undone: since the event is already executed (erased) on one client only , the clients will disagree about how many choices happen during the next moveto action.&lt;br /&gt;
&lt;br /&gt;
=== [on_undo] ===&lt;br /&gt;
{{DevFeature1.13|2}}&lt;br /&gt;
Contains commands to execute when the player undoes the action which triggered the parent event.&lt;br /&gt;
*'''delayed_variable_substitution''' {{DevFeature1.13|5}}: ''yes/no, default no (always no before 1.13.5)'' As in [[EventWML]], specifies whether to perform variable substitution when the parent event is run, or when the contents are run. If delayed substitution is used, [[SyntaxWML#Automatically_Stored_Variables|automatically stored variables]] from the parent event context are available, but may occasionally have unexpected values. (In particular, $unit.x and $unit.y may not have the expected value when undoing a move event, though $x1 and $y1 should be correct.)&lt;br /&gt;
&lt;br /&gt;
Note:&lt;br /&gt;
It is not clear where whether the actionwml in [on_undo] in executed before or after the action is undone. Also, specially for enter/leave_hex events the units position when executing the [on_undo] code is usually different than when executing the original event. The recommended way to work around these issues is to refer to the unit by id instead of position and store all other needed information variables as 'upvalues'. You can also move the actual undo code to an external event. For example&lt;br /&gt;
 [event]&lt;br /&gt;
   name=&amp;quot;undo_blah&amp;quot;&lt;br /&gt;
   first_time_only=no&lt;br /&gt;
   [store_unit]&lt;br /&gt;
     id=&amp;quot;$moved_unit_id&amp;quot;&lt;br /&gt;
   [/store_unit]&lt;br /&gt;
   ... do undo stuff stuff&lt;br /&gt;
 [/event]&lt;br /&gt;
 &lt;br /&gt;
 ...&lt;br /&gt;
 ... in some other event&lt;br /&gt;
   [on_undo]&lt;br /&gt;
     # store ''upvalues&lt;br /&gt;
     {VARIABLE moved_unit_id $unit.id}&lt;br /&gt;
     # call actual undo handler&lt;br /&gt;
     [fire_event]&lt;br /&gt;
       name = &amp;quot;undo_blah&amp;quot;&lt;br /&gt;
     [/fire_event]&lt;br /&gt;
   [on_undo]&lt;br /&gt;
&lt;br /&gt;
=== [on_redo] ===&lt;br /&gt;
{{DevFeature1.13|2}}&lt;br /&gt;
Same as [on_undo], except executes the commands on redo. Note that the parent event is not triggered again on a redo.&lt;br /&gt;
&lt;br /&gt;
{{DevFeature1.13|8}} [on_redo] is deprecated and has no effect anymore.&lt;br /&gt;
&lt;br /&gt;
Note that [on_redo] is not guaranteed to be called when redoing an action, the engine might also decide to just fire the original events again.&lt;br /&gt;
&lt;br /&gt;
=== [cancel_action] ===&lt;br /&gt;
Although Wesnoth 1.12 does not have this tag, it is the default behavior of {{tag|EventWML|enter_hex}}/{{tag|EventWML|leave_hex}} events in that version.&lt;br /&gt;
&lt;br /&gt;
{{DevFeature1.13|9}} In this version, [cancel_action] is recognised, but has no effect (a bug).&lt;br /&gt;
&lt;br /&gt;
{{DevFeature1.13|11}}&lt;br /&gt;
In an {{tag|EventWML|enter_hex}}/{{tag|EventWML|leave_hex}} event, interrupt the movement, leaving the unit where it is. This is intended to be used with an event that gives the player new information, to let the player choose whether to change their plans. For example, if the player has commanded a unit to move from (1,1) to (3,3) and attack a unit on (4,4); then a [cancel_action] inside an [enter_hex] event on (2,2) would make the unit stop on (2,2). A [cancel_action] inside an [enter_hex] on (3,3) would let the player choose whether to attack.&lt;br /&gt;
&lt;br /&gt;
=== [heal_unit] ===&lt;br /&gt;
Heal a unit. The variable '''$heal_amount''' will be set to the exact number of points healed (i.e can be less than the parameter '''amount''' if the unit is fully healed). $heal_amount contains only the number of hitpoints the first unit that was found got healed.&lt;br /&gt;
*  '''[filter]''': [[StandardUnitFilter]] All matching on-map units are healed. If no filter is supplied, it is tried to take the unit at $x1, $y1.&lt;br /&gt;
*  '''[filter_second]''': [[StandardUnitFilter]] all the units matching the filter ''and'' having the ''heals'' ability will have their animation played (if ''animate'' is set to yes) for each of the units healed.&lt;br /&gt;
*  '''amount''': (integer, default full) the maximum points the unit(s) will be healed. Can't set below 1 or above max_hitpoints. If &amp;quot;full&amp;quot;, sets hitpoints to max_hitpoints. Before 1.9 the default is 0.&lt;br /&gt;
*  '''animate''': a boolean which indicate if the healing animations must be played. (default no)&lt;br /&gt;
*  '''moves''': (integer, default 0) The maximum current movement points the units will be &amp;quot;healed&amp;quot;. Can't set below 0 or above max_moves. If &amp;quot;full&amp;quot;, sets moves to max_moves.&lt;br /&gt;
* '''restore_attacks''': (boolean, default no) Whether the units' attacks_left should be reset to their max_attacks (usually 1).&lt;br /&gt;
* '''restore_statuses''': (boolean, default yes) Whether standard statuses should be reset to &amp;quot;no&amp;quot;. This affects poisoned, slowed, petrified and unhealable. Before 1.9 this is always &amp;quot;no&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
=== [harm_unit] ===&lt;br /&gt;
Harms every unit matching the filter, for the specific damage amount.&lt;br /&gt;
*  '''[filter]''': [[StandardUnitFilter]] all matching units will be harmed (required).&lt;br /&gt;
*  '''[filter_second]''': [[StandardUnitFilter]] if present, the first matching unit will attack all the units matching the filter above.&lt;br /&gt;
*  '''amount''': the amount of damage that will be done (required).&lt;br /&gt;
*  '''alignment''': (default neutral) applies an alignment to the damage, this means that if alignment=chaotic, the damage will be increased at night and reduced at day.&lt;br /&gt;
*  '''damage_type''': if present, amount will be altered by unit resistance to the damage type specified.&lt;br /&gt;
*  '''kill''': (default yes) if yes, when a harmed unit goes to or below 0 HP, it is killed; if no its HP are set to 1.&lt;br /&gt;
*  '''fire_event''': (default no) if yes, when a unit is killed by harming, the corresponding events are fired.  If yes, also the corresponding advance and post advance events are fired.&lt;br /&gt;
*  '''animate''': (default no) if yes, scrolls to each unit before harming it and plays its defense (or attack, if it's the harmer) and death animations. Special values supported, other than the usual yes and no, are &amp;quot;attacker&amp;quot;, that means only the harmer will be animated, and &amp;quot;defender&amp;quot;, that means only the harmed units will be animated. If the supplied value is yes, attacker or defender also advancement animations are played.&lt;br /&gt;
*  '''[primary_attack], [secondary_attack]''': these set the weapon against which the harmed units will defend, and that the harming unit will use to attack, respectively (notice this is the opposite of '''[filter]''' and '''[filter_second]''' above). This allows for playing specific defense and attack animations. Both tags are expected to contain a [[FilterWML#Filtering_Weapons|Standard Weapon Filter]].&lt;br /&gt;
*  '''delay''': if animate=yes, sets the delay (in milliseconds, default 500) between each unit harming.&lt;br /&gt;
*  '''variable''': if present, the damage caused to the unit, altered by resistances, will be stored in a WML array with the given name, under the &amp;quot;harm_amount&amp;quot; key.&lt;br /&gt;
*  '''poisoned, slowed, petrified, unhealable''': (default no) if yes, every harmed unit that doesn't already have such status will have it set.&lt;br /&gt;
*  '''experience''': if yes, and there is a harmer, experience will be attributed like in regular combat.&lt;br /&gt;
*  '''resistance_multiplier''': the harmed unit's resistance is multiplied by the supplied value; this means that a value lower than 1 increases it, and a value greater than 1 decreases it. Default value is 1, that means no modification.&lt;br /&gt;
&lt;br /&gt;
=== [time_area] ===&lt;br /&gt;
How a day should progress in a given area. Everywhere not specified in a [time_area] tag is affected by the [time] tags in the [scenario] tag.&lt;br /&gt;
* [[StandardLocationFilter]]: the locations to affect. ''note: only for [event][time_area]s - at scenario toplevel [time_area] does not support [[StandardLocationFilter]], only location ranges''&lt;br /&gt;
* '''[time]''': one or more tags describing the new schedule, see [[TimeWML]].&lt;br /&gt;
* '''id''': an unique identifier assigned to a time_area. Optional, unless you want to remove the time_area later. Can be a comma-separated list when removing time_areas, see below.&lt;br /&gt;
* '''remove''': (boolean) yes/no value. Indicates whether the specified time_area should be removed. Requires an identifier. If no identifier is used, however, all time_areas are removed.&lt;br /&gt;
* '''current_time''': The time slot number (starting with zero) active at the creation of the area.&lt;br /&gt;
&lt;br /&gt;
''Example:'' (caves in parts of a map)&lt;br /&gt;
 [time_area]&lt;br /&gt;
     x=1-2,4-5&lt;br /&gt;
     y=1-2,1-2&lt;br /&gt;
     {UNDERGROUND}&lt;br /&gt;
 [/time_area]&lt;br /&gt;
&lt;br /&gt;
=== [remove_time_area] ===&lt;br /&gt;
&lt;br /&gt;
{{DevFeature1.13|2}}&lt;br /&gt;
&lt;br /&gt;
This is a syntactic shortcut for [time_area] remove=.&lt;br /&gt;
* '''id''': Comma-separated list of time area ids to remove.&lt;br /&gt;
&lt;br /&gt;
=== [end_turn] ===&lt;br /&gt;
End the current side's turn. The current event is finished before the turn is ended. Also, if the current event (where the tag appears) has been fired by another event, that event (and the complete stack of other possible parent events) is ended before [end_turn] comes into affect. Also, events following the event stack that fired [end_turn] are not omitted (e.g. [end_turn] is used by a side turn event and a turn refresh event does something afterwards).&lt;br /&gt;
&lt;br /&gt;
=== [replace_map] ===&lt;br /&gt;
&lt;br /&gt;
Replaces the entire map.&lt;br /&gt;
* '''map''': Content of a wesnoth map file. example:&lt;br /&gt;
 map=&amp;quot;{campaigns/Heir_To_The_Throne/maps/01_The_Elves_Besieged.map}&amp;quot;&lt;br /&gt;
* '''map_file''': {{DevFeature1.13|?}} Path to a Wesnoth map file; can be used instead of '''map'''. The file will be loaded when the tag is executed, rather than being embedded wholesale in the preprocessed WML.&lt;br /&gt;
* '''expand''': if 'yes', allows the map size to increase. The expansion direction is currently always bottom-right.&lt;br /&gt;
* '''shrink''': if 'yes', allows the map size to decrease. If the map size is reduced, any units that would no longer be on the map due to its coordinates no longer existing will be put into the recall list.&lt;br /&gt;
Note: When a hex changes from a village terrain to a non-village terrain, and a team owned that village it loses that village. When a hex changes from a non-village terrain to a village terrain and there is a unit on that hex it does not automatically capture the village. The reason for not capturing villages it that there are too many choices to make; should a unit lose its movement points, should capture events be fired. It is easier to do this as wanted by the author in WML.&lt;br /&gt;
&lt;br /&gt;
=== [replace_schedule] ===&lt;br /&gt;
Replace the time of day schedule of the entire scenario.&lt;br /&gt;
* [[TimeWML]]: the new schedule.&lt;br /&gt;
* '''current_time''': The time slot number (starting with zero) active at schedule replacement.&lt;br /&gt;
&lt;br /&gt;
=== [tunnel] ===&lt;br /&gt;
&lt;br /&gt;
Create a tunnel between some locations, later usable by units to move from source hex to target hex (using the movement cost of unit on the target terrain).&lt;br /&gt;
&lt;br /&gt;
'''Behavior Change as of Wesnoth 1.13.6:''' Vision is now possible (and enabled by default) through tunnels and allied units on the exit hex do not block a tunnel by default any more. This is done in order for moves through tunnels to be consistent with other moves. The previous behavior can still be accomplished by using the new optional keys listed below.&lt;br /&gt;
&lt;br /&gt;
* '''[filter]''': (required) [[StandardUnitFilter]] the units which can use the tunnel. Leave empty for &amp;quot;all units&amp;quot;.&lt;br /&gt;
* '''[source]''': (required) [[StandardLocationFilter]] the source hex(es).&lt;br /&gt;
* '''[target]''': (required) [[StandardLocationFilter]] the target hex(es).&lt;br /&gt;
* '''id''': (optional) identifier for the tunnel, to allow removing.&lt;br /&gt;
* '''remove''': (boolean, default: no)  If yes, removes all defined tunnels with the same ID (then only id= is necessary).&lt;br /&gt;
* '''bidirectional''': (boolean, default: yes) If yes, creates also a tunnel in the other direction. &lt;br /&gt;
* '''always_visible''': (boolean, default: no) If yes, the possible movement of enemies under fog can be seen.&lt;br /&gt;
* '''allow_vision''': (boolean, default: yes) {{DevFeature1.13|6}} If no, vision through a tunnel is not possible. Note that in that case the tunnel cannot be used if the tunnel exit is under shroud (which previously was ''always'' the case).&lt;br /&gt;
* '''pass_allied_units''': (boolean, default: yes) {{DevFeature1.13|6}} If no, allied (including own) units on the exit hex block a tunnel.&lt;br /&gt;
* '''delayed_variable_substitution''' (boolean, default: yes): If yes, the WML block contained in this [tunnel] is not variable-substituted at execution time of the event where this [tunnel] is within. Instead, variables are substituted when the tunnel is used by a unit. See [[EventWML#Nested_Events]]&lt;br /&gt;
&lt;br /&gt;
(Note: The tunnel tag can also be used inside the [[AbilitiesWML|[teleport]]] ability, without remove= and id=).&lt;br /&gt;
&lt;br /&gt;
=== [do_command] ===&lt;br /&gt;
&lt;br /&gt;
{{DevFeature1.13|0}}&lt;br /&gt;
&lt;br /&gt;
Executes a command, specified using the same syntax as a [command] tag in [[ReplayWML]]. Not all [command]'s are valid: only these are accepted&lt;br /&gt;
&lt;br /&gt;
* [attack]&lt;br /&gt;
* [move]&lt;br /&gt;
* [recruit]&lt;br /&gt;
* [recall]&lt;br /&gt;
* [disband]&lt;br /&gt;
* [fire_event]&lt;br /&gt;
* [lua_ai] {{DevFeature1.13|12}} This has been removed and is replaced with [custom_command]&lt;br /&gt;
&lt;br /&gt;
The tags corresponding to player actions generally use the same codepath as if a player had ordered it. That means for example that only moves that player would be allowed to do are possible, and movement is interrupted when sighting enemy unit.&lt;br /&gt;
&lt;br /&gt;
One purpose of this tag is to allow scripting of noninteractive scenarios -- without a tag like this, this might require elaborate mechanisms to coerce ais in order to test these code paths.&lt;br /&gt;
&lt;br /&gt;
This command should always be replay safe.&lt;br /&gt;
&lt;br /&gt;
=== [put_to_recall_list] ===&lt;br /&gt;
&lt;br /&gt;
{{DevFeature1.13|0}}&lt;br /&gt;
&lt;br /&gt;
Puts a unit to the recall list of its side.&lt;br /&gt;
* '''[[StandardUnitFilter]]''': the unit(s) to get put to the recall list.&lt;br /&gt;
* '''heal''': (default=no) Whether the unit should be refreshed, similar to the unit moving to the recall list at the end of a scenario.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Useful Macros ==&lt;br /&gt;
There are some predefined macros that you find useful for direct actions. You can find a complete list along with a detailed explanation of how they work [http://www.wesnoth.org/macro-reference.xhtml here].&lt;br /&gt;
* '''{MOVE_UNIT}''': Moves a unit to another location in the map and the player sees the movement (unlike [teleport])&lt;br /&gt;
* '''{FULL_HEAL}''': Brings a unit to full HP&lt;br /&gt;
* '''{LOYAL_UNIT}''': Create a loyal unit&lt;br /&gt;
* '''{MODIFY_TERRAIN_MASK}''': Modify an area of terrain&lt;br /&gt;
&lt;br /&gt;
== See Also ==&lt;br /&gt;
&lt;br /&gt;
* [[InternalActionsWML]]&lt;br /&gt;
* [[InterfaceActionsWML]]&lt;br /&gt;
* [[EventWML]]&lt;br /&gt;
* [[ReferenceWML]]&lt;br /&gt;
&lt;br /&gt;
[[Category: WML Reference]]&lt;br /&gt;
[[Category: ActionsWML]]&lt;/div&gt;</summary>
		<author><name>Denispir</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.wesnoth.org/index.php?title=ReferenceWML&amp;diff=65032</id>
		<title>ReferenceWML</title>
		<link rel="alternate" type="text/html" href="https://wiki.wesnoth.org/index.php?title=ReferenceWML&amp;diff=65032"/>
		<updated>2019-10-31T13:00:39Z</updated>

		<summary type="html">&lt;p&gt;Denispir: /* Other */ added PreprocessorRef&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{WML Tags}}&lt;br /&gt;
== The Wesnoth Markup Language ==&lt;br /&gt;
&lt;br /&gt;
The Wesnoth Markup Language (WML) is used to code almost everything in Wesnoth, including scenarios, units, savefiles, and the user interface layout. WML files are simple, human-readable text files, usually with the .cfg extension, with similarities to INI files and XML. A major feature in WML are macros, which are alike those found in the C language and similarily are handled by a preprocessor. Implementation-wise, WML files are handled mainly by the ''config'' class (and ''simple_wml'' in [[wesnothd]]).&lt;br /&gt;
&lt;br /&gt;
This page is a collection of pointers to different common WML structures.&lt;br /&gt;
&lt;br /&gt;
See [[BuildingScenarios]], [[BuildingCampaigns]] and [[BuildingUnits]]&lt;br /&gt;
for a tutorial style overview.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
''Note: this reference may contain slight inaccuracies, might not list all existing keys and tags or might contain some deprecated syntax. If you find that this reference doesn't give you the answer to how to implement some feature in WML, the most reliable way is to look at the WML code of existing units and campaigns that have done so.''&lt;br /&gt;
&lt;br /&gt;
== How WML works ==&lt;br /&gt;
&lt;br /&gt;
* [[SyntaxWML]] Description of WML syntax, and how to use variables&lt;br /&gt;
* [[PreprocessorRef]] the WML preprocessor syntax&lt;br /&gt;
* [[GrammarWML]] A more formal definition of the WML syntax. More useful for implementing a WML parser than for writing WML documents.&lt;br /&gt;
&lt;br /&gt;
== WML toplevel tags ==&lt;br /&gt;
&lt;br /&gt;
The following covers most of the possible toplevel tags in a typical main WML file. Some minor and dev-oriented tags (not intended for use by UMC) are omitted.&lt;br /&gt;
&lt;br /&gt;
* [[GameConfigWML]] the top level '''[game_config]''' tag&lt;br /&gt;
* [[UnitsWML]] the top level '''[units]''' tag&lt;br /&gt;
** [[UnitTypeWML]] how to describe a unit type&lt;br /&gt;
** [[AnimationWML]] how to animate units&lt;br /&gt;
* [[CampaignWML]] the top level '''[campaign]''' tag&lt;br /&gt;
* [[CoreWML]] the top level '''[core]''' tag&lt;br /&gt;
* [[ScenarioWML]] the top level tags '''[scenario]''', '''[multiplayer]''', '''[test]''', and '''[tutorial]'''&lt;br /&gt;
** [[EventWML]] how to describe an event&lt;br /&gt;
** [[SideWML]] how to describe a side&lt;br /&gt;
** [[MapGeneratorWML]] the random map generator&lt;br /&gt;
** [[TimeWML]] how to describe a day&lt;br /&gt;
** [[IntroWML]] how to describe the intro screen&lt;br /&gt;
* [[EraWML]] the top level '''[era]''' tag&lt;br /&gt;
* [[TerrainWML]] the top level '''[terrain_type]''' tag&lt;br /&gt;
* [[TerrainGraphicsWML]], the top level '''[terrain_graphics]''' tag&lt;br /&gt;
* [[ThemeWML]] the top level '''[theme]''' tag&lt;br /&gt;
* [[LanguageWML]] the top level '''[language]''' tag&lt;br /&gt;
* [[LocaleWML]] the top level '''[locale]''' tag&lt;br /&gt;
* [[HelpWML]] the top level '''[help]''' tag&lt;br /&gt;
* [[BinaryPathWML]] the top level '''[binary_path]''' tag&lt;br /&gt;
* [[FontsWML]] the top level '''[fonts]''' tag&lt;br /&gt;
* [[WesCamp#The_textdomain_declaration|Textdomains]] the '''[textdomain]''' tag&lt;br /&gt;
&lt;br /&gt;
Some other files use the WML format, but with different tags.&lt;br /&gt;
&lt;br /&gt;
* [[SavefileWML]] a description of the format of savegames&lt;br /&gt;
** [[ReplayWML]] a description of the format of player actions such as moving a unit&lt;br /&gt;
** [[StatisticalScenarioWML]] used to generate statistics of a savegame&lt;br /&gt;
* [[PblWML]] a description of the format of server-uploadable campaigns&lt;br /&gt;
* [[MultiplayerWML]] a description of the WML network protocol for the Wesnoth server&lt;br /&gt;
* [[SchemaWML]] a description of WML files that define the structure of other WML files&lt;br /&gt;
* [[DiffWML]] used to describe structural differences between preprocessed WML documents&lt;br /&gt;
* [[GUIToolkit]] creating dialogs&lt;br /&gt;
&lt;br /&gt;
== Other WML tags ==&lt;br /&gt;
&lt;br /&gt;
* [[EventWML]] how to describe an event&lt;br /&gt;
** [[FilterWML]] the construct to filter on units, locations, and weapons&lt;br /&gt;
** [[ActionWML]] to describe the actions which occur when the event is fired&lt;br /&gt;
*** [[ConditionalActionsWML]] actions that encapsulate conditional filters and the actions to execute if the conditions are met&lt;br /&gt;
*** [[DirectActionsWML]] actions that directly affect gameplay: for example creating a unit&lt;br /&gt;
**** [[SingleUnitWML]] how to describe a unit&lt;br /&gt;
*** [[InternalActionsWML]] actions that WML uses internally: for example storing a variable&lt;br /&gt;
*** [[InterfaceActionsWML]] actions that do not affect gameplay: for example displaying a message&lt;br /&gt;
*** [[LuaWML]] how to code actions with the Lua language&lt;br /&gt;
* [[AiWML]] how to describe parameters for AI&lt;br /&gt;
* [[EffectWML]] the construct to modify a unit&lt;br /&gt;
* [[AbilitiesWML]] a list of the different abilities a unit or weapon can have&lt;br /&gt;
* [[DescriptionWML]] the structure of WML coded menus like the difficulty chooser of campaigns&lt;br /&gt;
* [[EditorWML]] tags controlling the post-1.4 editor's behavior&lt;br /&gt;
&lt;br /&gt;
== Predefined macros == &lt;br /&gt;
&lt;br /&gt;
Wesnoth ships with a library of predefined macros you should find useful in writing your own WML.&lt;br /&gt;
* [https://www.wesnoth.org/macro-reference.html WML Macros] - description of all such macros.&lt;br /&gt;
&lt;br /&gt;
== Other ==&lt;br /&gt;
&lt;br /&gt;
* [[ReferenceWMLSyntax]] how this wiki and the pages it links to should be formatted&lt;br /&gt;
* [[ConventionsWML]] how to make your WML more readable&lt;br /&gt;
* [[Wml_optimisation]] how to make your WML code more efficient&lt;br /&gt;
* [[UsefulWMLFragments]] Various pieces of WML for various purposes. If you have some WML you're proud of that you think others can use, add it here.&lt;br /&gt;
* [[Maintenance tools]] for wmlindent, wmllint, wmlscope&lt;br /&gt;
* [[CommandMode]] commands are not strictly speaking part of WML, these could be a little hard to find so there's a link here.&lt;br /&gt;
* [[MultiplayerServerWML]] is used when communicating with the multiplayer server.&lt;br /&gt;
* [[CampaignServerWML]] is used when managing contributed campaigns on the campaign server.&lt;br /&gt;
* [[ImagePathFunctions]] are used when applying the color function to images, such as marking units as belonging to a team or in TerrainGraphics.&lt;br /&gt;
* [[Pango formatting]] shows ways to enrich descriptions (pango markup, which can generate basic html tags like &amp;lt;nowiki&amp;gt;&amp;lt;b&amp;gt;, &amp;lt;i&amp;gt;, &amp;lt;span&amp;gt;&amp;lt;/nowiki&amp;gt; and others).&lt;br /&gt;
* [[Wesnoth_Formula_Language]] (WFL) often used with $() formulas.&lt;br /&gt;
* [[PreprocessorRef|Syntax of preprocessor mini-language]] : symbols, macros, file inclusions...&lt;br /&gt;
&lt;br /&gt;
== See Also ==&lt;br /&gt;
&lt;br /&gt;
* [[BuildingMaps]] the text-based format for Wesnoth maps&lt;br /&gt;
* [[TerrainCodesWML]] a list of all terrains&lt;br /&gt;
* [[MultiHexTutorial]] a description of the multi-hex tiling system&lt;br /&gt;
* [[IGNFileFormat]] a description of the ignore file format&lt;br /&gt;
* [[CompatibilityStandards#Deprecation_levels_-_When_to_remove_deprecated_features|DeprecationLevels]]&lt;br /&gt;
&lt;br /&gt;
[[Category: WML Reference]]&lt;/div&gt;</summary>
		<author><name>Denispir</name></author>
		
	</entry>
</feed>