<?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=Soliton</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=Soliton"/>
	<link rel="alternate" type="text/html" href="https://wiki.wesnoth.org/Special:Contributions/Soliton"/>
	<updated>2026-04-06T15:06:38Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.31.16</generator>
	<entry>
		<id>https://wiki.wesnoth.org/index.php?title=UsefulLinks&amp;diff=74925</id>
		<title>UsefulLinks</title>
		<link rel="alternate" type="text/html" href="https://wiki.wesnoth.org/index.php?title=UsefulLinks&amp;diff=74925"/>
		<updated>2026-03-27T13:24:53Z</updated>

		<summary type="html">&lt;p&gt;Soliton: /* Battle for Wesnoth */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
!colspan=2 style='text-align:left'|&lt;br /&gt;
=== Battle for Wesnoth ===&lt;br /&gt;
|-&lt;br /&gt;
|Home Page || https://www.wesnoth.org/&lt;br /&gt;
|-&lt;br /&gt;
|GitHub Project Page || https://github.com/wesnoth/&lt;br /&gt;
|-&lt;br /&gt;
|SPI project page || https://www.spi-inc.org/projects/wesnoth/&lt;br /&gt;
|-&lt;br /&gt;
|Changelog || https://changelog.wesnoth.org/ [http://stable-changelog.wesnoth.org stable]&lt;br /&gt;
|-&lt;br /&gt;
|Compatibility-breaking changes || https://forums.wesnoth.org/viewtopic.php?t=58532&lt;br /&gt;
|-&lt;br /&gt;
|Roadmap || https://wiki.wesnoth.org/1.19_Roadmap&lt;br /&gt;
|-&lt;br /&gt;
|This wiki || [[StartingPoints|https://wiki.wesnoth.org/]]&lt;br /&gt;
|-&lt;br /&gt;
|The manual || https://manual.wesnoth.org/&lt;br /&gt;
|-&lt;br /&gt;
|Translation statistics || https://gettext.wesnoth.org/&lt;br /&gt;
|-&lt;br /&gt;
|Add-on server web interface || https://addons.wesnoth.org/ [http://stable-addons.wesnoth.org stable] [http://dev-addons.wesnoth.org dev]&lt;br /&gt;
|-&lt;br /&gt;
|Code and Content Copyright || https://wiki.wesnoth.org/Wesnoth:Copyrights&lt;br /&gt;
|-&lt;br /&gt;
|Site status || https://status.wesnoth.org&lt;br /&gt;
|-&lt;br /&gt;
|Multiplayer server statistics || https://wesnothd.wesnoth.org/&lt;br /&gt;
|-&lt;br /&gt;
|Multiplayer statistics || https://replays.wesnoth.org/dashboard/&lt;br /&gt;
|-&lt;br /&gt;
|Multiplayer replays || https://replays.wesnoth.org&lt;br /&gt;
|-&lt;br /&gt;
|Unit advancement tree || https://units.wesnoth.org/&lt;br /&gt;
|-&lt;br /&gt;
|SteamDB || https://steamdb.info/app/599390/&lt;br /&gt;
|-&lt;br /&gt;
|Forum for users and developers || https://forums.wesnoth.org/ [https://forums.wesnoth.org/search.php?search_id=newposts new posts]&lt;br /&gt;
|-&lt;br /&gt;
|List of Frequently Proposed Ideas || https://forums.wesnoth.org/viewtopic.php?f=12&amp;amp;t=34904&lt;br /&gt;
|-&lt;br /&gt;
|IRC channel (Libera.Chat) || ircs://irc.libera.chat/#wesnoth&lt;br /&gt;
|-&lt;br /&gt;
|Discord server || https://discord.gg/battleforwesnoth&lt;br /&gt;
|-&lt;br /&gt;
|IRC logs || https://wesnoth.org/irclogs/&lt;br /&gt;
|-&lt;br /&gt;
|Mastodon Account || https://fosstodon.org/@wesnoth&lt;br /&gt;
|-&lt;br /&gt;
|Project statistics || https://openhub.net/p/wesnoth [https://insights.linuxfoundation.org/project/wesnoth LFX insights]&lt;br /&gt;
|-&lt;br /&gt;
|Packages || https://repology.org/project/wesnoth/versions [https://pkgs.org/search/?q=wesnoth pkgs.org] [https://pkgdex.org/search/all/wesnoth pkgdex.org]&lt;br /&gt;
|-&lt;br /&gt;
|F-Droid || https://f-droid.org/packages/org.wesnoth.Wesnoth/&lt;br /&gt;
|-&lt;br /&gt;
!colspan=2 style='text-align:left'|&lt;br /&gt;
&lt;br /&gt;
=== Developers ===&lt;br /&gt;
|-&lt;br /&gt;
|Git web interface || https://github.com/wesnoth/wesnoth ([https://git-scm.com/ git] [https://git-scm.com/documentation doc])&lt;br /&gt;
|-&lt;br /&gt;
|Jenkins CI || https://jenkins.wesnoth.org:8443/&lt;br /&gt;
|-&lt;br /&gt;
| Github CI || https://github.com/wesnoth/wesnoth/actions&lt;br /&gt;
|-&lt;br /&gt;
|Code documentation || https://devdocs.wesnoth.org/&lt;br /&gt;
|-&lt;br /&gt;
|GUI(2) documentation || https://wiki.wesnoth.org/GUIToolkit&lt;br /&gt;
|-&lt;br /&gt;
|Lua documentation || https://wiki.wesnoth.org/LuaAPI&lt;br /&gt;
|-&lt;br /&gt;
|WML documentation || https://wiki.wesnoth.org/WML&lt;br /&gt;
|-&lt;br /&gt;
|WFL documentation || https://wiki.wesnoth.org/WFL&lt;br /&gt;
|-&lt;br /&gt;
|Mailing lists || [https://groups.io/g/wesnoth-packagers wesnoth-packagers] - [https://groups.io/g/wesnoth-translations wesnoth-translations] ([https://listengine.tuxfamily.org/wesnoth.org/ old] - [https://mailman.wesnoth.org/ oldold])&lt;br /&gt;
|-&lt;br /&gt;
|Bug/Feature tracker || https://bugs.wesnoth.org/&lt;br /&gt;
|-&lt;br /&gt;
|Patch tracker || https://patches.wesnoth.org/&lt;br /&gt;
|-&lt;br /&gt;
|wesnoth.org server stats || https://collectd.wesnoth.org&lt;br /&gt;
|-&lt;br /&gt;
|IRC channel (Libera.Chat) || ircs://irc.libera.chat/wesnoth-dev&lt;br /&gt;
|-&lt;br /&gt;
!colspan=2 style='text-align:left'|&lt;br /&gt;
&lt;br /&gt;
=== Other Links ===&lt;br /&gt;
|-&lt;br /&gt;
|1vs1 Wesnoth ladder || https://wesnoth.gamingladder.info/&lt;br /&gt;
|-&lt;br /&gt;
|Wesnoth matches with commentary || http://www.youtube.com/user/NekisBrutalWesnoth&lt;br /&gt;
|-&lt;br /&gt;
|Wesnoth campaign with commentary in german || https://www.youtube.com/playlist?list=PLc3DmuDuA2imW1vg9xXMNjGHm8VaXvEaz&lt;br /&gt;
|-&lt;br /&gt;
|WSNPP || [[WSNPP|http://wiki.wesnoth.org/WSNPP]]&lt;br /&gt;
|-&lt;br /&gt;
|Run Wesnoth online (Windows) || http://spoon.net/the-battle-for-wesnoth&lt;br /&gt;
|-&lt;br /&gt;
!colspan=2 style='text-align:left'|&lt;br /&gt;
=== Multilingual Players' Sites ===&lt;br /&gt;
|-&lt;br /&gt;
|Community in China || http://wesnoth.cn/&lt;br /&gt;
|-&lt;br /&gt;
|Polish Community || https://www.wesnoth.com.pl/forum/index.php&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
[[Category:Wesnoth Wiki]]&lt;/div&gt;</summary>
		<author><name>Soliton</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.wesnoth.org/index.php?title=ReferenceWML&amp;diff=74921</id>
		<title>ReferenceWML</title>
		<link rel="alternate" type="text/html" href="https://wiki.wesnoth.org/index.php?title=ReferenceWML&amp;diff=74921"/>
		<updated>2026-03-23T17:36:46Z</updated>

		<summary type="html">&lt;p&gt;Soliton: /* Predefined macros */&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&lt;br /&gt;
* [[VariablesWML]] How to use WML 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;
* [[AddonsWML]] Content that can be published and downloaded via the add-ons server&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;
** [[AbilitiesWML]] a list of the different abilities a unit or weapon can have&lt;br /&gt;
** [[UnitTypeWML]] how to describe a unit type&lt;br /&gt;
** [[AnimationWML]] how to animate units&lt;br /&gt;
* [[CoreWML]] the top level '''[core]''' tag&lt;br /&gt;
* [[CampaignWML]] the top level '''[campaign]''' tag&lt;br /&gt;
** [[CreditsWML]] how to describe the credits (the '''[about]''' tag)&lt;br /&gt;
* [[ScenarioWML]] the top level tags '''[scenario]''', '''[multiplayer]''', and '''[test]'''&lt;br /&gt;
** [[EventWML]] how to describe an event (the '''[event]''' tag)&lt;br /&gt;
** [[SideWML]] how to describe a side (the '''[side]''' tag)&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 (the '''[story]''' and '''[part]''' tags)&lt;br /&gt;
* [[EraWML]] the top level '''[era]''' tag&lt;br /&gt;
* [[ModificationWML]] the top level '''[modification]''' and '''[resource]''' tags&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;
* [[GettextForWesnothDevelopers#The_textdomain_tag|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;
* [[AchievementsWML]] the '''[achievement_group]''' and '''[achievement]''' tags.&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;
* [[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]] gives an overview of Wesnoth's current UI system and how to create user interfaces with it.&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 [[StandardUnitFilter|units]], [[StandardLocationFilter|locations]], [[StandardSideFilter|sides]], weapons, vision, and WML data.&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 (for uses such as placing one on the map with the '''[unit]''' tag)&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 (BfW 1.14 and earlier)&lt;br /&gt;
*** [[LuaAPI]] how to code actions with the Lua language (BfW 1.16 and later)&lt;br /&gt;
* [[AiWML]] how to describe parameters for AI (the '''[ai]''' tag)&lt;br /&gt;
* [[EffectWML]] the construct to modify a unit (the '''[effect]''' tag)&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;
* [[MusicListWML]] for playing music (see also [[Available Music]] for a list of what's available)&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;
* [https://www.wesnoth.org/macro-reference-master.html WML Macros (master)] - latest development version.&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, but they are useful for debugging it, and could be a little hard to find, so linking to them here makes sense.&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]] (IPFs) 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 using pango markup, which can use basic html style formatting tags, such as &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|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;
* [[TerrainCodeTableWML]] a list of all terrains, and [[TerrainCodesWML]], on how to use them&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;
* [[Environment_variables]] a cheat-sheet for CLI environment variables&lt;br /&gt;
* Back to [[Create]]&lt;br /&gt;
&lt;br /&gt;
[[Category: WML Reference]]&lt;/div&gt;</summary>
		<author><name>Soliton</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.wesnoth.org/index.php?title=ConditionalActionsWML&amp;diff=74919</id>
		<title>ConditionalActionsWML</title>
		<link rel="alternate" type="text/html" href="https://wiki.wesnoth.org/index.php?title=ConditionalActionsWML&amp;diff=74919"/>
		<updated>2026-03-22T18:21:17Z</updated>

		<summary type="html">&lt;p&gt;Soliton: /* [variable] */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{WML Tags}}&lt;br /&gt;
&lt;br /&gt;
Part of [[ActionWML]], Conditional Actions WML is used to describe container actions that create branching and flow control for WML. The [[#Conditional Actions|conditional actions]] act as gatekeepers, encapsulating other actions with [[#Condition Tags|conditions]] which must be met before an action can take place. These conditional actions also contain the actions which will take place if those conditions are met and, in some cases, what actions will take place if they are ''not'' met.&lt;br /&gt;
&lt;br /&gt;
== Conditional Actions ==&lt;br /&gt;
&lt;br /&gt;
These actions describe actions that should be executed only if certain conditions are met.&lt;br /&gt;
&lt;br /&gt;
=== [if] ===&lt;br /&gt;
&lt;br /&gt;
Executes actions only if the contained [[#Condition Tags|conditions]] are met.&lt;br /&gt;
&lt;br /&gt;
* [[#Condition Tags|Condition Tags]]: Conditions which must be met for the actions in the '''[then]''' tag to be executed.&lt;br /&gt;
&lt;br /&gt;
* '''[then]''': Contains [[ActionWML|actions]] which should be executed if all conditions evaluate as true ''or'' if any single '''[or]''' tag evaluates as true.&lt;br /&gt;
&lt;br /&gt;
* '''[elseif]''': {{DevFeature1.13|0}} in case that the conditions inside '''[if]''' aren't met, these tags will be evalutated one by one. If the specified conditions are met, the contained [then] tags will be executed, and the cycle will end.&lt;br /&gt;
** [[#Condition Tags|Condition Tags]]: Specifies the conditions, just like in '''[if]'''.&lt;br /&gt;
** '''[then]''': Specifies actions, exactly like the '''[then]''' tag inside '''[if]'''.&lt;br /&gt;
&lt;br /&gt;
* '''[else]''': Contains [[ActionWML|actions]] which should be executed if all condition tags in the '''[if]''' and any directly nested '''[elseif]''' all evaluate as false.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Attention''': There are tags named [if] and [else] inside [animation] (see [[AnimationWML#.5Bif.5D_and_.5Belse.5D|AnimationWML]]), which have a different syntax.&lt;br /&gt;
&lt;br /&gt;
Example usage:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=wml&amp;gt;&lt;br /&gt;
[if]&lt;br /&gt;
   [variable]&lt;br /&gt;
      name=we.gold&lt;br /&gt;
      greater_than=$they.gold&lt;br /&gt;
   [/variable]&lt;br /&gt;
   [elseif]&lt;br /&gt;
      [variable]&lt;br /&gt;
         name=we.gold&lt;br /&gt;
         equals=$they.gold&lt;br /&gt;
      [/variable]&lt;br /&gt;
      [then]&lt;br /&gt;
         [message]&lt;br /&gt;
            message=This should be fair!&lt;br /&gt;
         [/message]&lt;br /&gt;
      [/then]&lt;br /&gt;
   [/elseif]&lt;br /&gt;
   [else]&lt;br /&gt;
      [message]&lt;br /&gt;
         message=This will not be easy!&lt;br /&gt;
      [/message]&lt;br /&gt;
   [/else]&lt;br /&gt;
[/if]&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== [switch] ===&lt;br /&gt;
&lt;br /&gt;
The '''[switch]''' tag is a special case because it does not use [[#Condition Tags|Condition Tags]] to control whether actions are performed. Instead, it executes different sets of actions based on the value of a variable&lt;br /&gt;
&lt;br /&gt;
* '''variable''': The name of the variable to check.&lt;br /&gt;
* '''[case]''': Case tag which forms a block containing:&lt;br /&gt;
** '''value''': The value to test the variable's value against. This can be a comma separated list of values.&lt;br /&gt;
** [[ActionWML|Action WML]]: Action WML to execute if the variable matches the value. (The rest of the '''[case]''' block after the '''value''' attribute.)&lt;br /&gt;
* '''[else]''': Else tag which forms a block of [[ActionWML|Action WML]] to execute if no '''[case]''' block contains a '''value''' matching the value of the '''variable'''.&lt;br /&gt;
&lt;br /&gt;
Example usage:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=wml&amp;gt;&lt;br /&gt;
[switch]&lt;br /&gt;
   variable=foo&lt;br /&gt;
   [case]&lt;br /&gt;
      value=&amp;quot;A&amp;quot;&lt;br /&gt;
      # ... WML if foo=A ...&lt;br /&gt;
   [/case]&lt;br /&gt;
   [case]&lt;br /&gt;
      value=&amp;quot;B&amp;quot;&lt;br /&gt;
      # ... WML if foo=B ...&lt;br /&gt;
   [/case]&lt;br /&gt;
   [else]&lt;br /&gt;
      # ... WML if not foo=A nor foo=B ...&lt;br /&gt;
   [/else]&lt;br /&gt;
[/switch]&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== [while] ===&lt;br /&gt;
&lt;br /&gt;
Like the '''[if]''' tag, executes actions only if conditions described in the contained [[#Condition Tags|conditions]] are met. Additionally, the '''[while]''' tag ''continues'' to execute the actions until the contained [[#Condition Tags|conditions]] are no longer met. Executes a maximum of 65536 iterations per invocation.&lt;br /&gt;
&lt;br /&gt;
* [[#Condition Tags|Condition Tags]]: Conditions which must be met for the actions in the '''[do]''' tag to be executed.&lt;br /&gt;
&lt;br /&gt;
* '''[do]''': contains [[ActionWML|actions]] that should be executed repeatedly until some condition is false. Multiple '''[do]''' tags can be used, and they will be executed in sequence on each iteration. However, there is usually no reason to do this.&lt;br /&gt;
&lt;br /&gt;
The '''[while]''' tag is useful for iterating over an array.&lt;br /&gt;
An array is a list of values.&lt;br /&gt;
The ''number''th value in the array '''array''' is stored in the WML variable '''''array''[number]'''.&lt;br /&gt;
Note that if '''number''' is the value of the variable '''variable''',&lt;br /&gt;
the expression '''$''array''[$variable]''' will return the ''number''th value in ''array''.&lt;br /&gt;
&lt;br /&gt;
==== 'FOREACH' Macro ====&lt;br /&gt;
This macro simplifies the use of a '''[while]''' tag to create a ''for-each'' iteration format. This is useful, for example, when you want to iterate over each row in a table. To use it, use the [http://www.wesnoth.org/macro-reference.xhtml#FOREACH FOREACH] and [http://www.wesnoth.org/macro-reference.xhtml#NEXT NEXT] macros. Note: This macro is deprecated; you should just use the '''[foreach]''' WML tag instead.&lt;br /&gt;
&lt;br /&gt;
==== 'REPEAT' Macro ====&lt;br /&gt;
This macro simplifies the use of a '''[while]''' tag to execute the same  [[ActionWML|actions]] repeatedly for a specified number of times. To use it, use the [http://www.wesnoth.org/macro-reference.xhtml#REPEAT REPEAT] macro.&lt;br /&gt;
&lt;br /&gt;
=== [for] ===&lt;br /&gt;
&lt;br /&gt;
{{DevFeature1.13|2}}&lt;br /&gt;
&lt;br /&gt;
Loops over an integer range. Note that, if iterating over an array to delete several elements, it is best to use '''reverse=yes''' to avoid accidentally skipping some elements.&lt;br /&gt;
&lt;br /&gt;
* '''variable''': The name of the variable containing the current index. Defaults to ''i''. If there is already a variable with this name, it will be automatically saved before the start of the loop, and reset to its previous value when the loop exits. If there wasn't a variable with that name before the loop, it will be automatically deleted, there is no need to do a '''[clear_variable]''' afterwards&lt;br /&gt;
* '''start''': The index of the first element to loop over, and sets the starting value of '''variable'''.  Defaults to 0.&lt;br /&gt;
* '''end''': The index of the final element to loop over, and sets the maximum allowed value of '''variable'''.  Defaults to '''start'''.&lt;br /&gt;
* '''step''': The value added to the current value of '''variable''' after each iteration of the loop.  Defaults to 1 if '''start''' &amp;lt; '''end''', or -1 if '''start''' &amp;gt; '''end'''.&lt;br /&gt;
** For example, if '''start=1''' and '''step=2''', then the value of '''variable''' for each iteration will be: 1, 3, 5, ...&lt;br /&gt;
* '''array''': Specify an array to iterate over.  This is a shortcut for setting '''start=0''' and '''end=$($array_name.length-1)'''&lt;br /&gt;
** If '''array''' is set, then '''start''', '''end''', and '''step''' are ignored.&lt;br /&gt;
* '''reverse''': If set to '''yes''', and '''array''' was specified, then this is a shortcut for setting '''start=$($array_name.length-1)''' and '''end=0'''.&lt;br /&gt;
* '''[do]''': The actions to execute on each iteration. As with '''[while]''', it is possible to use multiple '''[do]''' tags, but there is usually no reason to.&lt;br /&gt;
&lt;br /&gt;
=== [foreach] ===&lt;br /&gt;
&lt;br /&gt;
{{DevFeature1.13|2}}&lt;br /&gt;
&lt;br /&gt;
Loops over an array variable. This is not used to implement the {FOREACH} macro because [foreach] doesn't support adding or removing elements while looping (and will usually raise an error), use '''[for]''' instead.&lt;br /&gt;
&lt;br /&gt;
* '''array''': The array variable to loop over.&lt;br /&gt;
* '''variable''': The name of a variable which refers to the current item. Defaults to ''this_item''. Any changes made to this variable will persist in the array after the loop has completed.&lt;br /&gt;
* '''index_var''': The name of a variable which refers to the index of the current item. Defaults to ''i''. Note that this is just for information purposes and should not be used to access the array from within the loop (any such changes made will not persist).&lt;br /&gt;
* '''readonly''': If set to yes, this prevents the array from being modified in any way during the loop. (It defaults to no.) That means that changes made through the '''variable''' will ''not'' persist. Changes made through the '''index_var''' will also not persist (as normal). In effect, the array is reverted to its original state once the loop exits.&lt;br /&gt;
* '''[do]''': The actions to execute on each iteration. As with '''[while]''', it is possible to use multiple '''[do]''' tags, but there is usually no reason to.&lt;br /&gt;
&lt;br /&gt;
The '''[foreach]''' tag simulates local-scoping of its index variables. If there was already a WML variable with the same name (by default ''i'' and ''this_item'' respectively), it will be automatically saved before the start of the '''[do]''', and reset to its previous value when the loop exits.  If there wasn't a variable with that name before the loop, there is no need to do a '''[clear_variable]''' afterwards.&lt;br /&gt;
&lt;br /&gt;
It's possible to nest '''[foreach]''' loops, however 1.16 does not support using the same ''variable='' name for both loops ([https://github.com/wesnoth/wesnoth/issues/6305 issue 6305], fixed in {{DevFeature1.17|13}}).&lt;br /&gt;
&lt;br /&gt;
=== [repeat] ===&lt;br /&gt;
&lt;br /&gt;
{{DevFeature1.13|2}}&lt;br /&gt;
&lt;br /&gt;
Repeats some actions a fixed number of times. This is a completely stateless loop - there's no way to know which iteration of the loop you're on. (If you need this, use '''[for]''' instead.)&lt;br /&gt;
&lt;br /&gt;
* '''times''': The number of times to repeat the actions.&lt;br /&gt;
* '''[do]''': The actions to repeat.  As with '''[while]''', it is possible to use multiple '''[do]''' tags, but there is usually no reason to.&lt;br /&gt;
&lt;br /&gt;
=== [command] ===&lt;br /&gt;
&lt;br /&gt;
This tag is more of an Unconditional Action: when it is encountered, the [[ActionWML|actions]] in its content are simply executed once. In practice, this tag serves little purpose. However, it may be used to arrange actions together in logical groups, for example, with actions that are stored in an array and later inserted.&lt;br /&gt;
(It is also used inside of [set_menu_item] and [option] of [[InterfaceActionsWML]].)&lt;br /&gt;
&lt;br /&gt;
== Condition Tags ==&lt;br /&gt;
&lt;br /&gt;
These tags describe conditions which must be met before an action can take place. Some or all of them are used in the various [[#Conditional Actions|Conditional Actions]].&lt;br /&gt;
&lt;br /&gt;
=== [true] ===&lt;br /&gt;
&lt;br /&gt;
Represents a condition that always yields true. Takes no arguments.&lt;br /&gt;
&lt;br /&gt;
=== [false] ===&lt;br /&gt;
&lt;br /&gt;
Represents a condition that always yields false. Takes no arguments.&lt;br /&gt;
&lt;br /&gt;
=== [have_unit] ===&lt;br /&gt;
&lt;br /&gt;
A unit with greater than zero hit points matching this filter exists.&lt;br /&gt;
&lt;br /&gt;
* [[StandardUnitFilter]] '''*''': Selection criteria. Do not use a [filter] tag.&lt;br /&gt;
* '''count''': ''(Optional)'' If used, a number of units equal to the value must match the filter. Accepts a number, range, or comma separated range. If not used, the default value is &amp;quot;1-99999&amp;quot;.&lt;br /&gt;
* '''search_recall_list''': ''(Optional)'' If 'yes', search through recall list too. (Default is 'no')&lt;br /&gt;
&lt;br /&gt;
=== [have_location] ===&lt;br /&gt;
&lt;br /&gt;
A location matching this filter exists.&lt;br /&gt;
&lt;br /&gt;
* [[StandardLocationFilter]]: Selection criteria.&lt;br /&gt;
* '''count''': ''(Optional)'' If used, a number of locations equal to the value must match the filter. Accepts a number, range, or comma separated range. If not used, the default value is &amp;quot;1-99999&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
=== [have_side] ===&lt;br /&gt;
&lt;br /&gt;
{{DevFeature1.19|10}}&lt;br /&gt;
&lt;br /&gt;
* [[StandardSideFilter]]: Selection criteria.&lt;br /&gt;
* '''count''': ''(Optional)'' If used, exactly this number of sides must match the filter. Accepts only a number.&lt;br /&gt;
&lt;br /&gt;
=== [has_achievement] ===&lt;br /&gt;
&lt;br /&gt;
{{DevFeature1.17|13}}&lt;br /&gt;
&lt;br /&gt;
The specified achievement has been completed.&lt;br /&gt;
&lt;br /&gt;
* '''content_for''': The [[AchievementsWML|[achievements_group]]] that this achievement is part of.&lt;br /&gt;
* '''id''': The id of the achievement.&lt;br /&gt;
&lt;br /&gt;
'''NOTE:''' This is not safe to use in online multiplayer since different players can have different achievements completed. As such it will always be treated as if the achievement is not completed.&lt;br /&gt;
&lt;br /&gt;
=== [has_sub_achievement] ===&lt;br /&gt;
&lt;br /&gt;
{{DevFeature1.17|17}}&lt;br /&gt;
&lt;br /&gt;
The specified achievement has been completed.&lt;br /&gt;
&lt;br /&gt;
* '''content_for''': The [[AchievementsWML|[achievements_group]]] that this achievement is part of.&lt;br /&gt;
* '''id''': The id of the achievement.&lt;br /&gt;
* '''sub_id''': The id of the sub-achievement.&lt;br /&gt;
&lt;br /&gt;
'''NOTE:''' This is not safe to use in online multiplayer since different players can have different sub-achievements completed. As such it will always be treated as if the sub-achievement is not completed.&lt;br /&gt;
&lt;br /&gt;
=== [variable] ===&lt;br /&gt;
&lt;br /&gt;
Test the value of a WML [[VariablesWML|variable]] against another value.&lt;br /&gt;
&lt;br /&gt;
* '''name''': The name of the variable to test.&lt;br /&gt;
* ''&amp;lt;comparison&amp;gt;'': '''One''' of the following keys must be used to compare the value of the named variable, represented as ''$name'' below, against another value:&lt;br /&gt;
** '''contains''': ''$name'' contains this string value.&lt;br /&gt;
** '''equals''': ''$name'' is equal (string wise) to this value.&lt;br /&gt;
** '''not_equals''': ''$name'' is not equal (string wise) to this value.&lt;br /&gt;
** '''numerical_equals''': ''$name'' is equal (numerically) to this value. &lt;br /&gt;
** '''numerical_not_equals''': ''$name'' is not equal (numerically) to this value.&lt;br /&gt;
** '''greater_than''': ''$name'' is numerically greater than this value.&lt;br /&gt;
** '''greater_than_equal_to''': ''$name'' is numerically greater than or equal to this value.&lt;br /&gt;
** '''less_than''': ''$name'' is numerically less than this value.&lt;br /&gt;
** '''less_than_equal_to''': ''$name'' is numerically less than or equal to this value.&lt;br /&gt;
** '''boolean_equals''': ''$name'' has an equivalent boolean value.&lt;br /&gt;
** '''boolean_not_equals''': ''$name'' does not have an equivalent boolean value.&lt;br /&gt;
** '''formula''': {{DevFeature1.15|0}} ''$name'' satisfies the given [[Wesnoth_Formula_Language|WFL]] formula.&lt;br /&gt;
** '''blank''': {{DevFeature1.19|19}} ''$name'' is unset when this value is ''yes'' and set when this value is ''no''.&lt;br /&gt;
&lt;br /&gt;
====Boolean Values====&lt;br /&gt;
When values are evaluated as boolean values they are checked to see if they are ''false'' or ''true''.&lt;br /&gt;
&lt;br /&gt;
* These values are evaluated as ''true'': '''&amp;quot;yes&amp;quot;''' and '''&amp;quot;true&amp;quot;'''&lt;br /&gt;
* These values are evaluated as ''false'': '''&amp;quot;no&amp;quot;''', '''&amp;quot;false&amp;quot;''' and '''&amp;quot;&amp;quot;'''(uninitialized)&lt;br /&gt;
** However, in contexts where ''true'' is defined as the default value, an uninitialized value would be considered true. &lt;br /&gt;
&lt;br /&gt;
'''Warning:''' Do not use &amp;quot;off&amp;quot;, &amp;quot;on&amp;quot;, integers, floating-point numbers or anything else than the above as booleans.&lt;br /&gt;
&lt;br /&gt;
====Formulas====&lt;br /&gt;
When using a formula, the variable's value can be referenced as '''value''' in the formula. This is a WFL representation of a config object that supports the following fields:&lt;br /&gt;
&lt;br /&gt;
* '''__all_children''': A list of key-value pairs, where the key is the tag name and the value is another config object representing the tag content.&lt;br /&gt;
* '''__children''': A map from tag name to a list of all children with that tag name.&lt;br /&gt;
* '''__attributes''': A map from attribute to value. Only useful if you specifically require a map for some reason.&lt;br /&gt;
* ''Any attribute name'': The value of that attribute&lt;br /&gt;
* ''Any tag name'': A list of all children with that tag name.&lt;br /&gt;
* Note that if there is a tag and an attribute with the same name, accessing it by name will return the attribute. You would need to use '''__children''' to access the tag.&lt;br /&gt;
&lt;br /&gt;
For example, suppose you had a variable with the following WML content:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=wml&amp;gt;&lt;br /&gt;
[my_variable]&lt;br /&gt;
    stuff=777&lt;br /&gt;
    something=a value&lt;br /&gt;
    [something]&lt;br /&gt;
        value=42&lt;br /&gt;
    [/something]&lt;br /&gt;
    [another_tag]&lt;br /&gt;
        value=21&lt;br /&gt;
    [/another_tag]&lt;br /&gt;
    [subarray]&lt;br /&gt;
        value=8&lt;br /&gt;
    [/subarray]&lt;br /&gt;
    [subarray]&lt;br /&gt;
        value=91&lt;br /&gt;
    [/subarray]&lt;br /&gt;
    [another_tag]&lt;br /&gt;
        value=12&lt;br /&gt;
    [/another_tag]&lt;br /&gt;
[/my_variable]&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then the formula could access the following variables on the '''value''' object:&lt;br /&gt;
* '''__all_children''': A list of ordered key-value pairs roughly equivalent to &amp;lt;syntaxhighlight lang=wfl inline&amp;gt;['something' -&amp;gt; ['value' -&amp;gt; 42], 'another_tag' -&amp;gt; ['value' -&amp;gt; 21], 'subarray' -&amp;gt; ['value' -&amp;gt; 8], 'subarray' -&amp;gt; ['value' -&amp;gt; 91], 'another_tag' -&amp;gt; ['value' -&amp;gt; 12]]&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
* '''__children''': A map roughly equivalent to &amp;lt;syntaxhighlight lang=wfl inline&amp;gt;['something' -&amp;gt; [['value' -&amp;gt; 42]], 'another_tag' -&amp;gt; [['value' -&amp;gt; 21], ['value' -&amp;gt; 12]], 'subarray' -&amp;gt; [['value' -&amp;gt; 8], ['value' -&amp;gt; 91]]]&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
* '''__attributes''': A map equivalent to &amp;lt;syntaxhighlight lang=wfl inline&amp;gt;['stuff' -&amp;gt; 777, 'something' -&amp;gt; 'a value']&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
* '''stuff''': The number &amp;lt;syntaxhighlight lang=wfl inline&amp;gt;777&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
* '''something''': The string &amp;lt;syntaxhighlight lang=wfl inline&amp;gt;'a value'&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
* '''another_tag''': A list roughly equivalent to &amp;lt;syntaxhighlight lang=wfl inline&amp;gt;[['value' -&amp;gt; 21], ['value' -&amp;gt; 12]]&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
* '''subarray''': A list roughly equivalent to &amp;lt;syntaxhighlight lang=wfl inline&amp;gt;[['value' -&amp;gt; 8], ['value' -&amp;gt; 91]]&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{DevFeature1.17|11}} When using a formula, you can now specify an additional key:&lt;br /&gt;
&lt;br /&gt;
* '''as_type''': Specifies the type of the '''value''' object in the formula. The default is ''wml'', which uses the structure as described above. The other supported options are:&lt;br /&gt;
** ''unit'': Interprets the variable's value as a stored unit, allowing you to write the formula the same way you would in a [[StandardUnitFilter]].&lt;br /&gt;
** ''weapon'': Interprets the variable's value as an attack type, allowing you to write the formula the same way you would in a [[StandardWeaponFilter]].&lt;br /&gt;
&lt;br /&gt;
=== [found_item] ===&lt;br /&gt;
&lt;br /&gt;
{{DevFeature1.13|2}} Test if an item (i.e., a modification given by &amp;lt;nowiki&amp;gt;[&amp;lt;/nowiki&amp;gt;[[DirectActionsWML#.5Bobject.5D|object]]]) has been found yet. Note: This will only detect objects added via ActionWML in an event in the same scenario. It will not detect objects added in [modifications] when a unit is created, nor objects added via [modify_unit] or the Lua wesnoth.add_modification function, nor objects added in a previous scenario in a campaign.&lt;br /&gt;
&lt;br /&gt;
* '''id''': The ID of the item to test. It must exactly match an [object] that has been taken for the test to pass.&lt;br /&gt;
&lt;br /&gt;
=== [proceed_to_next_scenario] ===&lt;br /&gt;
&lt;br /&gt;
{{DevFeature1.13|10}} In SP, true if the scenario has been won.&lt;br /&gt;
&lt;br /&gt;
=== [lua] ===&lt;br /&gt;
&lt;br /&gt;
{{DevFeature1.13|11}} Evaluate a lua expression, which must return a boolean value. Useful for writing one-off conditions that are difficult to express with other tags, but for much-used conditions it's better to define a custom condition tag using [[LuaAPI/wesnoth#wesnoth.wml_conditionals|wesnoth.wml_conditionals]].&lt;br /&gt;
&lt;br /&gt;
* '''code''': The Lua expression.&lt;br /&gt;
* '''name''': A name used to identify the tag in error messages.&lt;br /&gt;
* '''[args]''': Arbitrary data passed to the expression, accessible via &amp;lt;tt&amp;gt;...&amp;lt;/tt&amp;gt; in the Lua code.&lt;br /&gt;
&lt;br /&gt;
For example&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=wml&amp;gt;&lt;br /&gt;
[event]&lt;br /&gt;
	name=new turn&lt;br /&gt;
	first_time_only=no&lt;br /&gt;
	[filter_condition]&lt;br /&gt;
		[lua]&lt;br /&gt;
			code = &amp;lt;&amp;lt; return (wml.variables.turn_number % 2 == 0) &amp;gt;&amp;gt;&lt;br /&gt;
		[/lua]&lt;br /&gt;
	[/filter_condition]&lt;br /&gt;
	[message]&lt;br /&gt;
		speaker=narrator&lt;br /&gt;
		message= &amp;quot;Hello world $turn_number|&amp;quot;&lt;br /&gt;
	[/message]&lt;br /&gt;
[/event]&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Meta-Condition Tags ===&lt;br /&gt;
&lt;br /&gt;
These tags aren't really conditions, themselves. Instead they are wrapped around condition tags to group them into multiple conditions that must all be met, lists of conditions that only one must be met, or conditions that must not be met. These are handled in top-to-bottom order in any combination you can think of. One important thing to remember is if you are using '''[or]''' tags, the first conditional statement should ''not'' have an '''[or]''' tag wrapped around it.&lt;br /&gt;
&lt;br /&gt;
; [and]&lt;br /&gt;
: A condition which must evaluate to true in addition to any other conditions that precede it. This is useful as a bracket for complex conditions, but not strictly necessary.&lt;br /&gt;
:* [[#Condition Tags|Condition Tags]]: If these evaluate to true, the '''[and]''' tag evaluates to true.&lt;br /&gt;
&lt;br /&gt;
; [or]&lt;br /&gt;
: A condition which, when false, has no effect, but when true, allows previously failed conditions to be ignored. &lt;br /&gt;
:* [[#Condition Tags|Condition Tags]]: If these evaluate to true, the '''[or]''' tag evaluates to true. &lt;br /&gt;
&lt;br /&gt;
; [not]&lt;br /&gt;
: Similar to [and], but its contents must be false. Thus it reverses the evaluation of its contents. Since a normal condition tag without contents is always considered true, an empty [not] is always considered false.&lt;br /&gt;
:* [[#Condition Tags|Condition Tags]]: If these evaluate to true, the '''[not]''' tag evaluates to false. If these evaluate to false, the '''[not]''' tag evaluates to true.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
When multiple meta-conditions are encountered one after another in a containing tag, the evaluation order is as follows:&lt;br /&gt;
# the immediate contents of the containing tag are evaluated first to determine if there is a successful match known as a &amp;quot;true&amp;quot; condition&lt;br /&gt;
# this true or false result is combined with the top meta-condition to produce another true or false result&lt;br /&gt;
# this result is combined with the next meta-condition, and so on. However, if the engine recognizes that no remaining meta-conditions might reverse the result, it will cleverly skip them.&lt;br /&gt;
# if the final result is a successful match, then the [[:Category:ActionsWML|action]] will take place.&lt;br /&gt;
&lt;br /&gt;
== See Also ==&lt;br /&gt;
* [[SyntaxWML]]&lt;br /&gt;
* [[InternalActionsWML]]&lt;br /&gt;
* [[DirectActionsWML]]&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>Soliton</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.wesnoth.org/index.php?title=InternalActionsWML&amp;diff=74914</id>
		<title>InternalActionsWML</title>
		<link rel="alternate" type="text/html" href="https://wiki.wesnoth.org/index.php?title=InternalActionsWML&amp;diff=74914"/>
		<updated>2026-03-21T11:25:49Z</updated>

		<summary type="html">&lt;p&gt;Soliton: /* [set_variables] */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{WML Tags}}&lt;br /&gt;
&lt;br /&gt;
Part of [[ActionWML]], Internal actions are actions that WML uses internally that do not directly affect game play (or, at least, are not readily apparent to the player). For example, storing a variable is an internal action.&lt;br /&gt;
&lt;br /&gt;
== Variable Actions ==&lt;br /&gt;
&lt;br /&gt;
These actions are focused, in one way or another, on [[VariablesWML|variables]]. Creating them, modifying them, capturing game data to them, you name it, these actions are all about the variables.&lt;br /&gt;
&lt;br /&gt;
=== [set_variable] ===&lt;br /&gt;
&lt;br /&gt;
The '''[set_variable]''' tag is used to create and manipulate [[VariablesWML|WML variables­­­]]. The [https://www.wesnoth.org/macro-reference.html#VARIABLE VARIABLE] macro is a quick syntactic shortcut for simple variable creation and the [https://www.wesnoth.org/macro-reference.html#VARIABLE_OP VARIABLE_OP] macro is a quick syntactic shortcut for performing simple mathematical operations on variables.&lt;br /&gt;
&lt;br /&gt;
* '''name''': the name of the variable to manipulate&lt;br /&gt;
&lt;br /&gt;
* '''value''': set the variable to the given value (can be numeric or string). Use literal for no substitution. (see [[VariablesWML]])&lt;br /&gt;
&lt;br /&gt;
* '''literal''': set the variable to the given value (can be numeric or string). This does not interpret any dollar signs.&lt;br /&gt;
&lt;br /&gt;
* '''to_variable''': set the variable to the value of the given variable, e.g. 'to_variable=temp' would be equivalent to 'value=$temp'.&lt;br /&gt;
&lt;br /&gt;
* '''add''': add the given amount to the variable.&lt;br /&gt;
&lt;br /&gt;
* '''sub''': subtract the given amount from the variable.&lt;br /&gt;
&lt;br /&gt;
* '''multiply''': multiply the variable by the given number. The result is a float.&amp;lt;br /&amp;gt;To negate a number, multiply by -1. If you negate 0, the result is a floating-point negative zero -0. To display -0 as 0, use a second tag with add=0; it will flip -0 to 0 but not affect other numbers.&lt;br /&gt;
&lt;br /&gt;
* '''divide''': divide the variable by the given number. The result is a float. Wesnoth 1.9 and later no longer uses integer division. Use a second tag with round=floor if you relied on this.&lt;br /&gt;
&lt;br /&gt;
* '''modulo''': returns the remainder of a division.&lt;br /&gt;
&lt;br /&gt;
* '''abs''': Returns the absolute value of the variable.&lt;br /&gt;
&lt;br /&gt;
* '''root''': Use '''root=square''' to calculate the square root. {{DevFeature1.15|0}} Also supports '''root=cube''' and arbitrary integer roots.&lt;br /&gt;
&lt;br /&gt;
* '''power''': Raise the variable to some power.&lt;br /&gt;
&lt;br /&gt;
* '''rand''': the variable will be randomly set.&amp;lt;br&amp;gt;You may provide a comma separated list of possibilities, e.g. 'rand=Bob,Bill,Bella'.&amp;lt;br&amp;gt;You may provide a range of numbers (integers), e.g. 'rand=3..5'.&amp;lt;br&amp;gt;You may combine these, e.g. 'rand=100,1..9', in which case there would be 1/10th chance of getting 100, just like for each of 1 to 9. If a number or item is repeated, it is sampled more frequently as appropriate. See [[MultiplayerContent]] for more info on the MP case.&amp;lt;br&amp;gt;Using rand= will automatically result in the current action being non undoable. Ignoring possible [allow_undo].&lt;br /&gt;
&lt;br /&gt;
* '''time=stamp''': Retrieves a timestamp in milliseconds since wesnoth was started, can be used as timing aid. Don't try to use this as random value in MP since it will cause an OOS.&lt;br /&gt;
&lt;br /&gt;
* '''string_length''': Retrieves the length in characters of the string passed as this attribute's value; such string is parsed and variable substitution applied automatically (see [[VariablesWML]] for details).&lt;br /&gt;
&lt;br /&gt;
* {{anchor|join|'''[join]'''}} joins an array of strings to create a textual list&lt;br /&gt;
** '''variable''': name of the array&lt;br /&gt;
** '''key''': the key of each array element(array[$i].foo) in which the strings are stored&lt;br /&gt;
** '''separator''': separator to connect the elements&lt;br /&gt;
** '''remove_empty''': whether to ignore empty elements&lt;br /&gt;
&lt;br /&gt;
* '''ipart''': Assigns the integer part (the part to the left of the decimal point) of the referenced variable.&lt;br /&gt;
&lt;br /&gt;
* '''fpart''': Assigns the decimal part (the part to the right of the decimal point) of the referenced variable.&lt;br /&gt;
&lt;br /&gt;
* '''round''': Rounds the variable to the specified number of digits of precision. Negative precision works as expected (rounding 19517 to -2 = 19500). Special values:&lt;br /&gt;
**'''round=ceil''': Rounds upward to the nearest integer.&lt;br /&gt;
**'''round=floor''': Rounds down to the nearest integer.&lt;br /&gt;
**'''round=trunc''': {{DevFeature1.15|0}} Rounds towards zero; this is the same operation as '''ipart''', but operating on the value already contained in the variable rather than the value assigned to the key.&lt;br /&gt;
&lt;br /&gt;
* '''min''', '''max''': {{DevFeature1.15|9}} Specify a comma-separated list of numbers; either the smallest or largest number in the list will be assigned to the variable.&lt;br /&gt;
&lt;br /&gt;
* '''reverse=yes''': {{DevFeature1.15|9}} Reverses the string value of the variable. For example, &amp;quot;delfador&amp;quot; becomes &amp;quot;rodafled&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
* '''formula''': Calculate the new value of the variable from a [[Wesnoth_Formula_Language|WFL]] formula operating on the old value. This is similar to using the '''$(...)''' syntax but avoids the possibility of WFL syntax errors if a referenced variable is empty.&lt;br /&gt;
&lt;br /&gt;
=== [set_variables] ===&lt;br /&gt;
&lt;br /&gt;
Manipulates a WML array or container&lt;br /&gt;
&lt;br /&gt;
* '''name''': the name of the array or container to manipulate&lt;br /&gt;
&lt;br /&gt;
* '''mode''': one of the following values:&lt;br /&gt;
** ''replace'': will clear the variable '''name''' and replace it with given data. This is the default value. If given an explicit index, such as name=my_array[1], only that single element of the array is replaced, and the new data is inserted into that slot, potentially pushing other elements up. If ''not'' given an explicit index, the entire array is replaced.&lt;br /&gt;
** ''append'': will append given data to the current array. An explicit index is ignored if given.&lt;br /&gt;
** ''merge'': will merge in the given data into '''name'''. Attributes in '''[value]''' will overwrite any existing already in '''name'''. Tags in '''[value]''' modify the corresponding tag of the original value of '''name''', so for example the first '''[attack]''' tag in '''[value]''' would modify the first '''[attack]''' tag of '''name''' rather than appending a new '''[attack]''' tag. If given an explicit index, all the '''[value]''' and '''[literal]''' tags will be joined together into a single tag, and this resulting container will then be merged into the container at the specified element. A few special syntaxes are supported:&lt;br /&gt;
*** ''__remove=yes'': When used in a subtag, causes the corresponding subtag in '''name''' to be deleted rather than merged. Deletion happens after any other subtags have been merged.&lt;br /&gt;
*** ''add_to_xxx'': Adds its integer value to the integer value of '''xxx''' in '''name''', and sets '''xxx''' in '''name''' to the result. {{DevFeature1.13|8}} Now adds as real numbers rather than integers.&lt;br /&gt;
*** ''concat_to_xxx'': {{DevFeature1.13|8}} Similar to '''add_to_xxx''', but does string concatenation instead of numerical addition.&lt;br /&gt;
** ''insert'': will insert the given data at the index specified in the '''name''' attribute, such as name=my_array[1]. The default index is zero, which will insert to the front of the array. Otherwise, it is inserted so as to become the element at the specified index, meaning that the element previously at that index and all later elements are pushed up by one. '''Note:''' if an invalid index is used, empty containers will be created before the insertion is performed. In other words, do not attempt to insert at an index greater than (or equal to) the array's current length. This limitation may be removed in future versions.&lt;br /&gt;
&lt;br /&gt;
* '''to_variable''': set the array or container to the value of the given variable&lt;br /&gt;
&lt;br /&gt;
* {{anchor|set_variables-value|'''[value]'''}}: the WML inside the [value] tags will be stored in data, variables will be interpolated directly, use $| in order to escape the $ sign, you can store arrays of WML by supplying multiple [value] tags. ([[#Using_.5Bset_variables.5D_to_Create_Arrays_of_WML|See Example]])&lt;br /&gt;
&lt;br /&gt;
* {{anchor|set_variables-literal|'''[literal]'''}}: same as '''[value]''', but variables will not be substituted, '''[literal]''' and '''[value]''' can not be used in the same [set_variables] tag, i.e. you can not create arrays by piling a mix of '''[value]''' and '''[literal]''' tags&lt;br /&gt;
&lt;br /&gt;
*{{anchor|set_variables-split|'''[split]'''}}: splits a textual list into an array which will then be set to data&lt;br /&gt;
** '''list''': textual list to split&lt;br /&gt;
** '''key''': the key of each array element(array[$i].foo) in which the strings are stored; defaults to ''value'' if omitted.&lt;br /&gt;
** '''separator''': separator to separate the elements; if omitted, each character of the string will become an element in the result array.&lt;br /&gt;
** '''remove_empty''': whether to ignore empty elements; ignored if '''separator''' is omitted&lt;br /&gt;
&lt;br /&gt;
{{DevFeature1.13|4}} You can now mix '''[value]''', '''[literal]''', and '''[split]''' in the same '''[set_variables]''' tag. They will be processed in order of appearance. Multiple instances of [split] are also supported now.&lt;br /&gt;
&lt;br /&gt;
=== Capturing Game Data ===&lt;br /&gt;
&lt;br /&gt;
These actions capture different bits of game data and store them to variables so they can be examined and/or manipulated.&lt;br /&gt;
&lt;br /&gt;
==== [store_gold] ====&lt;br /&gt;
&lt;br /&gt;
Stores a side's gold into a variable.&lt;br /&gt;
&lt;br /&gt;
* '''[[StandardSideFilter]]''': The first matching side's gold will be stored in the variable &amp;quot;variable&amp;quot;.&lt;br /&gt;
* '''variable''': (default='gold') the name of the variable to store the gold in&lt;br /&gt;
&lt;br /&gt;
==== [store_locations] ====&lt;br /&gt;
&lt;br /&gt;
Stores a series of locations that pass certain criteria into an array. Each member of the array has members 'x' and 'y' (the position) and 'terrain' (the terrain type) and 'owner_side' (villages only). The array will include any unreachable border hexes, if applicable.&lt;br /&gt;
&lt;br /&gt;
* [[StandardLocationFilter]]: a location or location range which specifies the locations to store. By default, all locations on the map are stored.&lt;br /&gt;
&lt;br /&gt;
* '''variable''': the name of the variable (array) into which to store the locations. Defaults to '''location'''.&lt;br /&gt;
&lt;br /&gt;
* '''mode''': {{DevFeature1.13|0}} defaults to ''always_clear'', which clears the variable, whether or not a match is found. If mode is set to ''replace'', the variable will not be cleared, and locations which match the filter will overwrite existing elements at the start of the array, leaving any additional elements intact if the original array contained more elements than there are locations matching the filter. If mode is set to ''append'', the variable will not be cleared, and locations which match the filter will be added to the array after the existing elements.&lt;br /&gt;
&lt;br /&gt;
==== [store_reachable_locations] ====&lt;br /&gt;
&lt;br /&gt;
Stores locations reachable by the given units. Can store either the movement, attack or vision ranges.&lt;br /&gt;
&lt;br /&gt;
* '''[filter]''': a [[StandardUnitFilter]]. The locations reachable by any of the matching units will be stored.&lt;br /&gt;
* '''[filter_location]''': (optional) a [[StandardLocationFilter]]. Only locations which also match this filter will be stored.&lt;br /&gt;
* '''range''': possible values ''movement'' (default), ''attack'', ''vision''. If ''movement'', stores the locations within the movement range of the unit, taking Zone of Control into account. If ''attack'', stores the attack range (movement range + 1 hex). See note below for ''vision''.&lt;br /&gt;
* '''moves''':  possible values ''current'' (default), ''max''. For ''movement'' and ''attack'', specifies whether to use the current or maximum movement points when calculating the range. Ignored for ''vision''.&lt;br /&gt;
* '''viewing_side''': If left unset then fog and shroud are ignored, hidden ambushers are not ignored, and the real reach of the units is stored. If set to a non-zero number, then the area stored for each unit matching the SUF is based on the information visible to that unit's side; it doesn't matter which non-zero number is given. Ignored completely for ''vision''.&lt;br /&gt;
* '''variable''': the name of the variable (array) into which to store the locations.&lt;br /&gt;
&lt;br /&gt;
In 1.14 and before, the ''vision'' range is calculated as max movement range ignoring ZoC + 1 hex.&lt;br /&gt;
&lt;br /&gt;
{{DevFeature1.15|12}} ''vision'' uses the same calculations as the fog and shroud, and handles:&lt;br /&gt;
* units with vision costs different to movement costs&lt;br /&gt;
* units whose vision points aren't the same as their max movement points&lt;br /&gt;
* jamming by enemy units&lt;br /&gt;
&lt;br /&gt;
==== [store_map_dimensions] ====&lt;br /&gt;
&lt;br /&gt;
Stores the map dimensions in a variable.&lt;br /&gt;
&lt;br /&gt;
* '''variable''': the name of the variable where the values will be saved into. If it is skipped, a variable 'map_size' is used, and its contents overridden, if they existed already. The result is a container variable, with members ''width'' and ''height''.&lt;br /&gt;
&lt;br /&gt;
==== [store_side] ====&lt;br /&gt;
&lt;br /&gt;
Stores information about a certain side in a variable.&lt;br /&gt;
&lt;br /&gt;
'''Keys:'''&lt;br /&gt;
* '''[[StandardSideFilter]]''': All matching sides are stored. (An array is created if several sides match - access it with side[2].team_name and so on.)&lt;br /&gt;
* '''variable''': the name of the variable to store the information in (default: &amp;quot;side&amp;quot;)&lt;br /&gt;
* '''mode''':{{DevFeature1.13|0}} defaults to ''always_clear'', which clears the variable, whether or not a match is found. If mode is set to ''replace'', the variable will not be cleared, and sides which match the filter will overwrite existing elements at the start of the array, leaving any additional elements intact if the original array contained more elements than there are sides matching the filter. If mode is set to ''append'', the variable will not be cleared, and sides which match the filter will be added to the array after the existing elements.&lt;br /&gt;
'''Result'''&lt;br /&gt;
&lt;br /&gt;
Variable will contain following members:&lt;br /&gt;
* '''color''': Team color used for ellipses, sprites, and flags. Will be one of the id's found in data/core/team-colors.cfg or a custom color defined by [[GameConfigWML#Color_Palettes|[color_range]]].&lt;br /&gt;
* '''controller''': Indicates type of player that control this side. ''Note: In networked multiplayer, the controller attribute may not be the same on all clients. Be very careful or you have OOS errors.''&lt;br /&gt;
** '''human''': Human player&lt;br /&gt;
** '''ai''': If players assigns &amp;quot;Computer Player&amp;quot; to &amp;quot;Player/Type&amp;quot; in game lobby&lt;br /&gt;
** '''null''': If players assigns &amp;quot;Empty&amp;quot; to &amp;quot;Player/Type&amp;quot; in game lobby&lt;br /&gt;
* '''fog''': Indicates whether this side is affected by fog of war.&lt;br /&gt;
* '''gold''': The amount of gold the side has.&lt;br /&gt;
* '''hidden''': (boolean) If 'yes', side is not shown in status table.&lt;br /&gt;
* '''income''': Income for this side (base income + all village income. AKA gross income. Note that this is different from the [side] income key).&lt;br /&gt;
* '''name''': Name of player.&lt;br /&gt;
* '''recruit''': A comma-separated list of unit types that can be recruited by this side.&lt;br /&gt;
* '''shroud''': Whether this side is affected by shroud.&lt;br /&gt;
* '''side''': The $side_number of the side belonging to this container&lt;br /&gt;
* '''side_name''': Translated string representing the side's description.&lt;br /&gt;
* '''team_name''': String representing the team's description. Sides with the same team_name are allied.&lt;br /&gt;
* '''user_team_name''': Translated string representing the team's description.&lt;br /&gt;
* '''village_gold''': The amount of gold given to this side per village it controls per turn.&lt;br /&gt;
* '''scroll_to_leader''': (boolean) Whether the game view scrolls to the side leader at the start of their turn.&lt;br /&gt;
* '''flag''': Flag animation for villages owned by this side (see [[SideWML|[side]]]). Unless previously specified in [side] or changed with WML (see [[DirectActionsWML#.5Bmodify_side.5D|[modify_side]]]), this value may be empty for the default flag animation.&lt;br /&gt;
* '''flag_icon''': Flag icon for the status bar for this side (see [[SideWML|[side]]]). Unless previously specified in [side] or changed with WML (see [[DirectActionsWML#.5Bmodify_side.5D|[modify_side]]]), this value may be empty for the default flag icon.&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|7}} When the side will be considered defeated. See description at [[SideWML]], [[ScenarioWML#Scenario_End_Conditions]]&lt;br /&gt;
* '''faction''': {{DevFeature1.13|7}} id of the selected faction, string (multiplayer-only)&lt;br /&gt;
* '''faction_name''': {{DevFeature1.13|7}} Name of the selected faction, string (multiplayer-only)&lt;br /&gt;
* '''num_units''' {{DevFeature1.13|7}}: The number of units the side currently has on the map.&lt;br /&gt;
* '''num_villages''' {{DevFeature1.13|7}}: The number of villages the side currently controls.&lt;br /&gt;
* '''total_upkeep''' {{DevFeature1.13|7}}: The number of unit levels the side is currently supporting.&lt;br /&gt;
* '''expenses''' {{DevFeature1.13|7}}: The amount of gold the side is currently spending to support units.&lt;br /&gt;
* '''net_income''' {{DevFeature1.13|7}}: The income the side gains per turn after expenses.&lt;br /&gt;
* '''base_income''' {{DevFeature1.13|8}}: The income the side gains per turn (same as [side] income key)&lt;br /&gt;
&lt;br /&gt;
* {{DevFeature1.13|7}} All other keys and tags of the side that are contained in [[LuaWML:Sides#wesnoth.sides|wesnoth.sides]] .__cfg&lt;br /&gt;
&lt;br /&gt;
==== [store_starting_location] ====&lt;br /&gt;
&lt;br /&gt;
Stores the starting location of a side's leader in a variable. The variable is a composite type which will have members 'x', 'y', 'terrain' and 'owner_side' (villages only)&lt;br /&gt;
&lt;br /&gt;
* [[StandardSideFilter]]: The starting locations of all matching sides will be stored. If multiple sides are matched, a WML array will be created.&lt;br /&gt;
* '''variable''': (default='location'): the name of the variable to store the location in&lt;br /&gt;
* '''mode''':{{DevFeature1.13|0}} defaults to ''always_clear'', which clears the variable, whether or not a match is found. If mode is set to ''replace'', the variable will not be cleared, and the starting locations of the sides which match the filter will overwrite existing elements at the start of the array, leaving any additional elements intact if the original array contained more elements than there are locations matching the filter. If mode is set to ''append'', the variable will not be cleared, and the starting locations of the matching sides will be added to the array after the existing elements.&lt;br /&gt;
&lt;br /&gt;
==== [store_time_of_day] ====&lt;br /&gt;
&lt;br /&gt;
Stores time of day information from the current scenario into a WML variable container.&lt;br /&gt;
&lt;br /&gt;
* '''x, y''': Location to store the time for. [[DirectActionsWML#.5Btime_area.5D|Time areas]] matter; illumination does not. If this is omitted, the global (location-independent) time is stored.&lt;br /&gt;
&lt;br /&gt;
* '''variable''': (default='time_of_day') name of the container on which to store the information. The container will be filled with the same attributes found on [[TimeWML]].&lt;br /&gt;
&lt;br /&gt;
* '''turn''': (defaults to the current turn number) changes the turn number for which time of day information should be retrieved.&lt;br /&gt;
&lt;br /&gt;
==== [store_turns] ====&lt;br /&gt;
&lt;br /&gt;
Stores the turn limit (the maximum number of turns). If there is no limit, this stores ''-1''.&lt;br /&gt;
&lt;br /&gt;
* '''variable''': (default='turns') the name of the variable in which to store the turn limit.&lt;br /&gt;
&lt;br /&gt;
==== [store_unit] ====&lt;br /&gt;
&lt;br /&gt;
Stores details about units into a [[VariablesWML#Container|container]] variable. When a unit is stored, all keys and tags in the unit definition may be manipulated, including some others, with [[InternalActionsWML#.5Bset_variable.5D|[set_variable]]]. A sample '''list of these tags and keys''' can be found at [[InternalActionsWMLUnitTags]].&lt;br /&gt;
&lt;br /&gt;
If you have a doubt about what keys are valid or what the valid value range is for each key, code a [store_unit] event, save the game, and examine what keys are in the file (or just examine the '''[unit]''' tag(s) in any save file). One can also use the [[CommandMode|:inspect]] command or the [[InterfaceActionsWML#.5Binspect.5D|[inspect]]] tag to open a game-state inspector dialog, which can be used to view unit properties.&lt;br /&gt;
&lt;br /&gt;
Common usage is to manipulate a unit by using '''[store_unit]''' to store it into a variable, followed by manipulation of the variable, and then [[DirectActionsWML#.5Bunstore_unit.5D|[unstore_unit]]] to re-create the unit with the modified variables.&lt;br /&gt;
&lt;br /&gt;
''Note: stored units also exist on the field, and modifying the stored variable will not automatically change the stats of the units. You need to use [unstore_unit]. See also [[DirectActionsWML#.5Bunstore_unit.5D|[unstore_unit]]] and [[ConditionalActionsWML#.5Bforeach.5D|[foreach]]].&lt;br /&gt;
&lt;br /&gt;
* '''[filter]''' with a [[StandardUnitFilter]] as argument. All units matching this filter will be stored. If there are multiple units, they will be stored into an array of variables. The units will be stored in order of their internal ''underlying_id'' attribute, which is usually in creation order (but you normally should not depend on the order).&lt;br /&gt;
&lt;br /&gt;
* '''variable''': the name of the variable into which to store the unit(s)&lt;br /&gt;
&lt;br /&gt;
* '''mode''': defaults to ''always_clear'', which clears the variable, whether or not a match is found. If mode is set to ''replace'', the variable will not be cleared, and units which match the filter will overwrite existing elements at the start of the array, leaving any additional elements intact if the original array contained more elements than there are units matching the filter. If mode is set to ''append'', the variable will not be cleared, and units which match the filter will be added to the array after the existing elements.&lt;br /&gt;
&lt;br /&gt;
* '''kill''': if 'yes' the units that are stored will be removed from play. This is useful for instance to remove access to a player's recall list, with the intent to restore the recall list later.&lt;br /&gt;
&lt;br /&gt;
==== [store_unit_defense] ====&lt;br /&gt;
&lt;br /&gt;
{{DevFeature1.13|9}}&lt;br /&gt;
&lt;br /&gt;
{{DevFeature1.15|7}} Fixed, was broken in 1.15.3&lt;br /&gt;
&lt;br /&gt;
Stores in a variable the defense of a unit on a particular terrain. If terrain or location is not specified, the terrain on which the unit currently stands is used. (Note: it is a WML defense, so the higher it is, the weaker unit's defense is. A footpad on castle has 70% defense, so this function stores the value 30.)&lt;br /&gt;
&lt;br /&gt;
* StandardUnitFilter&lt;br /&gt;
* '''loc_x''', '''loc_y''': x and y of a valid map location. The terrain on this location will be used for the defense calculation.&lt;br /&gt;
* '''terrain''': The terrain code for which unit defense should be calculated. If '''terrain''' is specified, '''loc_x''' and '''loc_y''' are ignored.&lt;br /&gt;
* '''variable''': the name of the variable into which to store the defense. default: &amp;quot;terrain_defense&amp;quot;&lt;br /&gt;
&lt;br /&gt;
==== [store_unit_defense_on] ====&lt;br /&gt;
&lt;br /&gt;
{{DevFeature1.15|7}} Similar to [store_unit_defense], but stores the same number that would be shown in the UI. For example, a footpad on castle has 70% defense, so this stores the value 70.&lt;br /&gt;
&lt;br /&gt;
Takes the same attributes as [store_unit_defense], and defaults to storing the value in &amp;quot;terrain_defense&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
==== [store_unit_type] ====&lt;br /&gt;
&lt;br /&gt;
Stores a unit type definition into a variable.&lt;br /&gt;
&lt;br /&gt;
* '''type''': (required) the defined ID of the unit type, for example &amp;quot;Goblin Knight&amp;quot;. Do not use a translation mark or it will not work correctly for different languages. A comma-separated list of IDs may also be used to store an array of unit types.&lt;br /&gt;
&lt;br /&gt;
* '''variable''': the name of the variable into which to store the unit type information (default &amp;quot;unit_type&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
* '''mode''':{{DevFeature1.13|0}} defaults to ''always_clear'', which clears the variable. If mode is set to ''replace'', the variable will not be cleared, and the unit type will overwrite the existing element at the start of the array, leaving any additional elements intact if the original array contained more elements. If mode is set to ''append'', the variable will not be cleared, and the unit type will be added to the array after the existing elements.&lt;br /&gt;
&lt;br /&gt;
==== [store_unit_type_ids] ====&lt;br /&gt;
&lt;br /&gt;
* '''variable''': the name of the variable into which to store a comma-separated list of all unit type IDs including all from all loaded addons&lt;br /&gt;
&lt;br /&gt;
==== [store_villages] ====&lt;br /&gt;
&lt;br /&gt;
Stores a series of locations of villages that pass certain criteria into an array. Each member of the result array will have members 'x' and 'y' (the position) and 'terrain' (the terrain type) and 'owner_side'.&lt;br /&gt;
&lt;br /&gt;
Note: This differs from using [store_locations] only in that the hexes considered for match are restricted to those with villages (those whose terrain type has its 'gives_income' flag set to true), in the same way that use of either the 'owner_side' key or the '[filter_owner]' will. In fact, if either of these are present, [store_villages] and [store_locations] will behave identically.&lt;br /&gt;
&lt;br /&gt;
* '''variable''': the name of the variable (array) into which to store the locations (default: &amp;quot;location&amp;quot;)&lt;br /&gt;
* '''[[StandardLocationFilter]]''' tags and keys as arguments&lt;br /&gt;
&lt;br /&gt;
==== [store_items] ====&lt;br /&gt;
&lt;br /&gt;
Stores current items in the scenario into an array. Each entry has at least members x and y and can have all of the other keys listed in the documentation of [[InterfaceActionsWML#.5Bitem.5D|[item]]] (depending on what was set during creating the item).&lt;br /&gt;
&lt;br /&gt;
*'''variable''': name of the wml variable array to use (default &amp;quot;items&amp;quot;)&lt;br /&gt;
*'''[[StandardLocationFilter]]''' keys as arguments: only items on locations matching this [[StandardLocationFilter]] will be stored&lt;br /&gt;
*'''item_name''': {{DevFeature1.15|0}} if given, only items created with a matching '''[item]name=''' will be stored. As of 1.15.0, this does not support comma-separated lists.&lt;br /&gt;
&lt;br /&gt;
==== [store_relative_direction] ====&lt;br /&gt;
&lt;br /&gt;
{{DevFeature1.13|0}}&lt;br /&gt;
&lt;br /&gt;
Gets the relative direction from one hex to another. This is an interface to the function wesnoth uses to decide how a unit will face while it is moving / attacking / defending.&lt;br /&gt;
&lt;br /&gt;
* '''[source]''' x and y must describe a map location&lt;br /&gt;
* '''[destination]''' similar&lt;br /&gt;
* '''variable''' name of the variable to store string result in (one of 'n', 'nw', 'ne', 's', 'sw', 'se')&lt;br /&gt;
* '''mode''' optional. 0 is the default setting corresponding to default wesnoth implementation used in animations. 1 is an alternate &amp;quot;radially symmetric&amp;quot; mode. The default mode breaks ties in the direction of south, since this makes more units face the player directly on screen. The radially symmetric mode breaks ties in the direction of counter-clockwise, and might be more appropriate in some cases.&lt;br /&gt;
&lt;br /&gt;
==== [find_path] ====&lt;br /&gt;
&lt;br /&gt;
A WML interface to the pathfinder. Calculates the path between a unit and a location and returns the result in a WML variable, that contains also an array for every step of the path (including the starting hex).&lt;br /&gt;
&lt;br /&gt;
*'''[traveler]''': [[StandardUnitFilter]], only the first matching unit will be used for calculation&lt;br /&gt;
*'''[destination]''': [[StandardLocationFilter]]&lt;br /&gt;
*'''variable''': the variable name where the result will be stored, if no value is supplied 'path' will be used as default name. Each step will be stored in a [step] array inside that variable.&lt;br /&gt;
*'''allow_multiple_turns''': default no, if yes also moves that require more than one turn will be calculated.&lt;br /&gt;
*'''check_visibility''': default no, if yes the path will not be computed if some hexes are not visible due to shroud.&lt;br /&gt;
*'''check_teleport''': default yes; if no, teleport won't be taken in account while computing path.&lt;br /&gt;
*'''check_zoc''': default yes; if no, unit ZOCs won't be considered while calculating the path.&lt;br /&gt;
*'''nearest_by''': {{DevFeature1.15|2}} possible values &amp;quot;movement_cost&amp;quot; (default), &amp;quot;steps&amp;quot;, &amp;quot;hexes&amp;quot;; if the [destination] SLF matches multiple hexes, the one that would need the least movement points to reach may not be the one that's closest as measured by '''hexes''', or closest as measured by steps, from the starting point. This option chooses which measurement to prefer.&lt;br /&gt;
&lt;br /&gt;
More detail about multiple destinations and the return structure is on [[FindPathExplanation]] (moved out of this page because it has an image in it).&lt;br /&gt;
&lt;br /&gt;
This is the structure of the variable returned by [find_path]:&lt;br /&gt;
 [path]&lt;br /&gt;
 	hexes = non-zero if a path was successfully found.&lt;br /&gt;
 		if the path is calculated to an impassable hex, or the move requires multiple turns&lt;br /&gt;
 		and allow_multiple_turns is no, its value will be 0.&lt;br /&gt;
 	from_x, from_y = location of the unit&lt;br /&gt;
 	to_x, to_y = destination&lt;br /&gt;
 	movement_cost = total movement cost required by unit to reach that hex&lt;br /&gt;
 	required_turns = total turns required by unit to reach that hex&lt;br /&gt;
 	[step]&lt;br /&gt;
 		x, y = location of the step&lt;br /&gt;
 		terrain = terrain of the step&lt;br /&gt;
 		movement_cost = movement cost required by unit to reach that hex&lt;br /&gt;
 		required_turns = turns required by unit to reach that hex&lt;br /&gt;
 	[/step]&lt;br /&gt;
 [/path]&lt;br /&gt;
&lt;br /&gt;
==== [unit_worth] ====&lt;br /&gt;
Takes only an inline [[StandardUnitFilter]] (only the first matching unit will be used for the calculation) and outputs the following variables: &lt;br /&gt;
*'''cost''': the current unit cost&lt;br /&gt;
*'''next_cost''': the cost of the most expensive advancement&lt;br /&gt;
*'''health''': the health of the unit in percentage&lt;br /&gt;
*'''experience''': current experience in percentage&lt;br /&gt;
*'''unit_worth''': how much the unit is worth&lt;br /&gt;
&lt;br /&gt;
Mainly used for internal AI checks, but one could in theory just do anything with it.&lt;br /&gt;
&lt;br /&gt;
 [event]&lt;br /&gt;
     name=moveto&lt;br /&gt;
     [unit_worth]&lt;br /&gt;
        x,y=$x1,$y1&lt;br /&gt;
     [/unit_worth]&lt;br /&gt;
     [message]&lt;br /&gt;
         id=$unit.id&lt;br /&gt;
         message=_&amp;quot;I cost $cost gold, with $health|% of my hitpoints and $experience|% on the way to cost $next_cost|.&lt;br /&gt;
 I am estimated to be worth $unit_worth&amp;quot;&lt;br /&gt;
     [/message]&lt;br /&gt;
     [clear_variable]&lt;br /&gt;
         name=cost,next_cost,health,experience,unit_worth&lt;br /&gt;
     [/clear_variable]&lt;br /&gt;
 [/event]&lt;br /&gt;
&lt;br /&gt;
=== [clear_variable] ===&lt;br /&gt;
&lt;br /&gt;
This will delete the given variable. This tag can delete a scalar or an entire array; it can also delete one container at an array index. The macro [https://www.wesnoth.org/macro-reference.html#CLEAR_VARIABLE CLEAR_VARIABLE] is a shortcut for this tag.&lt;br /&gt;
&lt;br /&gt;
This action is good to use to clean up the set of variables; for example, a well-behaved scenario will delete any variables that should not be kept for the next scenario before the end of the scenario. One can also clear tags and variables of stored units; for example, one can remove [trait]s and [object]s.&lt;br /&gt;
&lt;br /&gt;
* '''name''': the name of the variable to clear. This can also be a comma-separated list of multiple variable names.&lt;br /&gt;
** If a name ends with an array index, then it deletes that one container, and shifts the indexes of all subsequent containers. For example, &amp;lt;code&amp;gt;{CLEAR_VARIABLE my_awesome_array[2]}&amp;lt;/code&amp;gt; deletes &amp;lt;code&amp;gt;my_awesome_array[2]&amp;lt;/code&amp;gt;, but then moves &amp;lt;code&amp;gt;my_awesome_array[3]&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;my_awesome_array[2]&amp;lt;/code&amp;gt;, moves &amp;lt;code&amp;gt;my_awesome_array[4]&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;my_awesome_array[3]&amp;lt;/code&amp;gt;, and so on until the end of the array.&lt;br /&gt;
** Note that &amp;lt;code&amp;gt;{CLEAR_VARIABLE my_awesome_array}&amp;lt;/code&amp;gt; deletes the entire array, but &amp;lt;code&amp;gt;{CLEAR_VARIABLE my_awesome_array[0]}&amp;lt;/code&amp;gt; deletes only the first container.&lt;br /&gt;
&lt;br /&gt;
=== [sync_variable] ===&lt;br /&gt;
&lt;br /&gt;
{{DevFeature1.13|0}}&lt;br /&gt;
&lt;br /&gt;
Sets one or multiple variables to the same value as on all clients and also on replays, it uses the value from the currently active side.&lt;br /&gt;
* '''name''' the name of the variable to synchonize this can be a comma seperated list.&lt;br /&gt;
&lt;br /&gt;
== Other Internal Actions ==&lt;br /&gt;
&lt;br /&gt;
Believe it or not, there are some internal actions that are not focused primarily on variables. They are all grouped here.&lt;br /&gt;
&lt;br /&gt;
=== [fire_event] ===&lt;br /&gt;
&lt;br /&gt;
Trigger a WML event (used often for [[EventWML#Custom_events|custom events]])&lt;br /&gt;
&lt;br /&gt;
* '''name''': the name of event to trigger&lt;br /&gt;
** ''(Optional)'' {{DevFeature1.13|6}}&lt;br /&gt;
&lt;br /&gt;
* '''id''': ''(Optional)'' the id of a single event to trigger {{DevFeature1.13|6}}&lt;br /&gt;
&lt;br /&gt;
* '''[primary_unit]''': ''(Optional)'' Primary unit for the event. Will never match on a recall list unit. The first unit matching the filter will be chosen.&lt;br /&gt;
**[[StandardUnitFilter]] as argument. Do not use a [filter] tag.&lt;br /&gt;
&lt;br /&gt;
* '''[secondary_unit]''': ''(Optional)'' Same as '''[primary_unit]''' except for the secondary unit.&lt;br /&gt;
**[[StandardUnitFilter]] as argument. Do not use a [filter] tag.&lt;br /&gt;
&lt;br /&gt;
* '''[primary_attack]''': Information passed to the primary attack filter and $weapon variable on the new event.&lt;br /&gt;
&lt;br /&gt;
* '''[secondary_attack]''': Information passed to the second attack filter and $second_weapon variable on the new event.&lt;br /&gt;
&lt;br /&gt;
* {{DevFeature1.17|6}} '''[data]''': Additional arbitrary data to pass to the event. In addition to passing custom data, this can be used to set the '''damage_inflicted''' in an attack event or the '''owner_side''' in a village capture event. Values can be used by Lua. {{DevFeature1.19|9}} Values can be accessed as $data.&lt;br /&gt;
&lt;br /&gt;
=== [remove_event] ===&lt;br /&gt;
{{DevFeature1.13|0}} Removes the event with the specified id.&lt;br /&gt;
&lt;br /&gt;
* '''id''': the id of the event to remove. May be a comma separated list.&lt;br /&gt;
&lt;br /&gt;
'''Note''': Only events whose IDs are explicitly specified will be removed. For example, this will ''not'' automatically remove events nested within the events with those IDs.&lt;br /&gt;
&lt;br /&gt;
=== [role] ===&lt;br /&gt;
&lt;br /&gt;
Tries to find a unit to assign a role to.&amp;lt;br&amp;gt;This is useful if you want to choose a non-major character to say some things during the game. Once a role is assigned, you can use '''role=''' in a unit filter to identify the unit with that role (See [[FilterWML]]).&amp;lt;br&amp;gt;However, there is no guarantee that roles will ever be assigned. You can use '''[have_unit]''' (see [[ConditionalActionsWML#Condition_Tags|Condition Tags]]) to see whether a role was assigned. This tag uses a [[StandardUnitFilter]] (without [filter]) with the modification to order the search by type, mark only the first unit found with the role, and the role attribute is not used in the search. If for some reason you want to search for units that have or don't have existing roles, you can use one or more [not] filters. The will check recall lists in addition to units on the map. In normal use, you will probably want to include a ''side'' attribute to force the unit to be on a particular side.&lt;br /&gt;
&lt;br /&gt;
* '''role''': the value to store as the unit's role. This role is not used in the [[StandardUnitFilter]] when doing the search for the unit to assign this role to.&lt;br /&gt;
&lt;br /&gt;
* '''type''': a comma-separated list of possible types the unit can be. If any types are given, then units will be searched by type in the order listed. If no type is given, then no particular order with respect to type is guaranteed.&lt;br /&gt;
&lt;br /&gt;
* '''reassign''': {{DevFeature1.13|6}} Can be either yes or no, defaults to yes. If set to '''no''' then first search for a unit that already has this role, and if found use that unit.&lt;br /&gt;
&lt;br /&gt;
* '''search_recall_list''': {{DevFeature1.13|5}} whether to consider units on the recall list when assigning the role. Can be either yes or no, defaults to yes. {{DevFeature1.13|6}} If set to 'only', then units on the map are not considered when assigning the role - only units on the recall list can receive it. If '''reassign''' is '''no''', this setting also affects the search for a unit that already has the role.&lt;br /&gt;
&lt;br /&gt;
* '''[else]''' {{DevFeature1.13|5}} ActionWML to execute if the game is unable to find a unit to assign the role to. For example, this could be used to create a new unit satisfying the role.&lt;br /&gt;
&lt;br /&gt;
* {{anchor|auto_recall|'''[auto_recall]'''}}: {{DevFeature1.13|6}} If present, and the role is assigned to a unit on the recall list, then that unit is recalled. Supports all unique keys of [[DirectActionsWML#.5Brecall.5D|&amp;amp;#x5b;recall&amp;amp;#x5d;]], but no [[StandardUnitFilter]].&lt;br /&gt;
&lt;br /&gt;
* [[StandardUnitFilter]], do not use a [filter] sub-tag. SUF's role= and type= keys are not used: if you want to use them, use a nested SUF wrapped inside a [and] tag.&lt;br /&gt;
&lt;br /&gt;
=== [random_placement] ===&lt;br /&gt;
{{DevFeature1.13|2}}&lt;br /&gt;
&lt;br /&gt;
Selects randomly a given number of locations from a given set of locations and exectutes the given code for each of those locations.&lt;br /&gt;
&lt;br /&gt;
* '''[filter_location]''': a [[StandardLocationFilter]].&lt;br /&gt;
* '''[command]''': contains ActionWml that is executed for each of the locations.&lt;br /&gt;
* '''num_items''': the number of locations that should be selected. There are several ways of specifying this:&lt;br /&gt;
** An integer, giving the exact number of locations to use. (Variable substitution is supported too.)&lt;br /&gt;
** {{DevFeature1.15|0}} A percentage, meaning that fraction of the total available spaces.&lt;br /&gt;
** {{DevFeature1.15|0}} A [[Wesnoth_Formula_Language|WFL]] formula. It has access to one variable, ''size'', which is the total number of available spaces. In order to identify it as a WFL formula, the entire expression must be enclosed in parentheses. (Do not use a '''$''', as that will cause it to see ''size'' as zero.)&lt;br /&gt;
** A Lua expression. As with a WFL expression, it can access the ''size'' variable. {{DevFeature1.15|0}} This is now deprecated.&lt;br /&gt;
* '''variable''': The name of the variable that contains the current location during the execution of [command]. This is a container with the attributes x, y, n and terrain.&lt;br /&gt;
* '''min_distance''': The minimum distance of 2 chosen locations, a value less than 0 means that the same locations can be chosen more than one time.&lt;br /&gt;
* '''allow_less''': If yes, the tag will not show an error in case there were less than num_items locations available.&lt;br /&gt;
&lt;br /&gt;
=== Flow control actions ===&lt;br /&gt;
&lt;br /&gt;
{{DevFeature1.13|2}}&lt;br /&gt;
&lt;br /&gt;
There are three actions that alter the flow of execution. They are '''[break]''', '''[continue]''', and '''[return]'''. All of them take no arguments.&lt;br /&gt;
&lt;br /&gt;
* '''[break]''': The nearest enclosing loop immediately stops executing, and control continues with the next action after the end of that loop. If there is no enclosing loop, this is equivalent to '''[return]'''.&lt;br /&gt;
* '''[continue]''': The nearest enclosing loop immediately stops executing, and control continues at the beginning of that loop, with any iteration variables updated for the next iteration. If there is no enclosing loop, this is an error.&lt;br /&gt;
* '''[return]''': Control immediately returns to the Wesnoth engine. This completely exits the current event, including any nested events, such that the [message] will not be displayed in the below example. No further WML actions are executed in this context. Any separate, subsequent events will be run as usual.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=wml&amp;gt;&lt;br /&gt;
[event]&lt;br /&gt;
   name=moveto&lt;br /&gt;
   [fire_event]&lt;br /&gt;
      name=return_please&lt;br /&gt;
   [/fire_event]&lt;br /&gt;
   [message]&lt;br /&gt;
     message=&amp;quot;Made it back&amp;quot;&lt;br /&gt;
   [/message]&lt;br /&gt;
[/event]&lt;br /&gt;
[event]&lt;br /&gt;
   name=return_please&lt;br /&gt;
   [return][/return]&lt;br /&gt;
[/event]&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== [unsynced] ===&lt;br /&gt;
&lt;br /&gt;
{{DevFeature1.13|2}}&lt;br /&gt;
&lt;br /&gt;
Runs the contained actionwml in a unsynced context, that means actions performed inside [unsynced] are not synced over the network. for example &lt;br /&gt;
&amp;lt;syntaxhighlight lang=wml&amp;gt;&lt;br /&gt;
[event]&lt;br /&gt;
   name=moveto&lt;br /&gt;
   {VARIABLE_OP message rand &amp;quot;Hi,Hello,How are you?&amp;quot;}&lt;br /&gt;
   [message]&lt;br /&gt;
      message = $message&lt;br /&gt;
   [/message]&lt;br /&gt;
   {CLEAR_VARIABLE message}&lt;br /&gt;
   [allow_undo]&lt;br /&gt;
   [/allow_undo]&lt;br /&gt;
[/event]&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
will print the same message to all clients, but also disallow undoing (regardless of [allow_undo]) for that moveto becasue it requests a synced random seed form the server. However this code&lt;br /&gt;
&amp;lt;syntaxhighlight lang=wml&amp;gt;&lt;br /&gt;
[event]&lt;br /&gt;
   name=moveto&lt;br /&gt;
   [unsynced]&lt;br /&gt;
      {VARIABLE_OP message rand &amp;quot;Hi,Hello,How are you?&amp;quot;}&lt;br /&gt;
      [message]&lt;br /&gt;
         message = $message&lt;br /&gt;
      [/message]&lt;br /&gt;
      {CLEAR_VARIABLE message}&lt;br /&gt;
   [/unsynced]&lt;br /&gt;
   [allow_undo]&lt;br /&gt;
   [/allow_undo]&lt;br /&gt;
[/event]&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
will not prevent undoing, but might print a different message for each client in a multiplayer game (or during a sp replay), so `[unsynced]` should not be used for actions that actually change the gamestate otherwise you'll get OOS&lt;br /&gt;
&lt;br /&gt;
== Examples ==&lt;br /&gt;
&lt;br /&gt;
=== Using [set_variables] to Create Arrays of WML ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=wml&amp;gt;&lt;br /&gt;
[set_variables]&lt;br /&gt;
    name=arr&lt;br /&gt;
    mode=replace&lt;br /&gt;
    [value]&lt;br /&gt;
        foo=bar&lt;br /&gt;
    [/value]&lt;br /&gt;
    [value]&lt;br /&gt;
       foo=more&lt;br /&gt;
    [/value]&lt;br /&gt;
[/set_variables]&lt;br /&gt;
{DEBUG_MSG $arr[0].foo}&lt;br /&gt;
{DEBUG_MSG $arr[1].foo}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This will produce two output messages, first one saying '''bar''' and next one saying '''more'''.&lt;br /&gt;
&lt;br /&gt;
== See Also ==&lt;br /&gt;
* [[VariablesWML]]&lt;br /&gt;
* [[ActionWML]]&lt;br /&gt;
** [[ConditionalWML]]&lt;br /&gt;
** [[DirectActionsWML]]&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>Soliton</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.wesnoth.org/index.php?title=UsefulLinks&amp;diff=74895</id>
		<title>UsefulLinks</title>
		<link rel="alternate" type="text/html" href="https://wiki.wesnoth.org/index.php?title=UsefulLinks&amp;diff=74895"/>
		<updated>2026-03-09T19:25:53Z</updated>

		<summary type="html">&lt;p&gt;Soliton: /* Battle for Wesnoth */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
!colspan=2 style='text-align:left'|&lt;br /&gt;
=== Battle for Wesnoth ===&lt;br /&gt;
|-&lt;br /&gt;
|Home Page || https://www.wesnoth.org/&lt;br /&gt;
|-&lt;br /&gt;
|GitHub Project Page || https://github.com/wesnoth/&lt;br /&gt;
|-&lt;br /&gt;
|SPI project page || https://www.spi-inc.org/projects/wesnoth/&lt;br /&gt;
|-&lt;br /&gt;
|Changelog || https://changelog.wesnoth.org/ [http://stable-changelog.wesnoth.org stable]&lt;br /&gt;
|-&lt;br /&gt;
|Compatibility-breaking changes || https://forums.wesnoth.org/viewtopic.php?t=58532&lt;br /&gt;
|-&lt;br /&gt;
|Roadmap || https://wiki.wesnoth.org/1.19_Roadmap&lt;br /&gt;
|-&lt;br /&gt;
|This wiki || [[StartingPoints|https://wiki.wesnoth.org/]]&lt;br /&gt;
|-&lt;br /&gt;
|The manual || https://manual.wesnoth.org/&lt;br /&gt;
|-&lt;br /&gt;
|Translation statistics || https://gettext.wesnoth.org/&lt;br /&gt;
|-&lt;br /&gt;
|Add-on server web interface || https://addons.wesnoth.org/ [http://stable-addons.wesnoth.org stable] [http://dev-addons.wesnoth.org dev]&lt;br /&gt;
|-&lt;br /&gt;
|Code and Content Copyright || https://wiki.wesnoth.org/Wesnoth:Copyrights&lt;br /&gt;
|-&lt;br /&gt;
|Site status || https://status.wesnoth.org&lt;br /&gt;
|-&lt;br /&gt;
|Multiplayer server statistics || https://wesnothd.wesnoth.org/&lt;br /&gt;
|-&lt;br /&gt;
|Multiplayer statistics || https://replays.wesnoth.org/dashboard/&lt;br /&gt;
|-&lt;br /&gt;
|Multiplayer replays || https://replays.wesnoth.org&lt;br /&gt;
|-&lt;br /&gt;
|Unit advancement tree || https://units.wesnoth.org/&lt;br /&gt;
|-&lt;br /&gt;
|SteamDB || https://steamdb.info/app/599390/&lt;br /&gt;
|-&lt;br /&gt;
|Forum for users and developers || https://forums.wesnoth.org/ [https://forums.wesnoth.org/search.php?search_id=newposts new posts]&lt;br /&gt;
|-&lt;br /&gt;
|List of Frequently Proposed Ideas || https://forums.wesnoth.org/viewtopic.php?f=12&amp;amp;t=34904&lt;br /&gt;
|-&lt;br /&gt;
|IRC channel (Libera.Chat) || ircs://irc.libera.chat/#wesnoth&lt;br /&gt;
|-&lt;br /&gt;
|Discord server || https://discord.gg/battleforwesnoth&lt;br /&gt;
|-&lt;br /&gt;
|IRC logs || https://wesnoth.org/irclogs/&lt;br /&gt;
|-&lt;br /&gt;
|Mastodon Account || https://fosstodon.org/@wesnoth&lt;br /&gt;
|-&lt;br /&gt;
|Project statistics || https://openhub.net/p/wesnoth [https://insights.linuxfoundation.org/project/wesnoth LFX insights]&lt;br /&gt;
|-&lt;br /&gt;
|Packages || https://repology.org/project/wesnoth/versions [https://pkgs.org/search/?q=wesnoth pkgs.org] [https://pkgdex.org/search/all/wesnoth pkgdex.org]&lt;br /&gt;
|-&lt;br /&gt;
!colspan=2 style='text-align:left'|&lt;br /&gt;
&lt;br /&gt;
=== Developers ===&lt;br /&gt;
|-&lt;br /&gt;
|Git web interface || https://github.com/wesnoth/wesnoth ([https://git-scm.com/ git] [https://git-scm.com/documentation doc])&lt;br /&gt;
|-&lt;br /&gt;
|Jenkins CI || https://jenkins.wesnoth.org:8443/&lt;br /&gt;
|-&lt;br /&gt;
| Github CI || https://github.com/wesnoth/wesnoth/actions&lt;br /&gt;
|-&lt;br /&gt;
|Code documentation || https://devdocs.wesnoth.org/&lt;br /&gt;
|-&lt;br /&gt;
|GUI(2) documentation || https://wiki.wesnoth.org/GUIToolkit&lt;br /&gt;
|-&lt;br /&gt;
|Lua documentation || https://wiki.wesnoth.org/LuaAPI&lt;br /&gt;
|-&lt;br /&gt;
|WML documentation || https://wiki.wesnoth.org/WML&lt;br /&gt;
|-&lt;br /&gt;
|WFL documentation || https://wiki.wesnoth.org/WFL&lt;br /&gt;
|-&lt;br /&gt;
|Mailing lists || [https://groups.io/g/wesnoth-packagers wesnoth-packagers] - [https://groups.io/g/wesnoth-translations wesnoth-translations] ([https://listengine.tuxfamily.org/wesnoth.org/ old] - [https://mailman.wesnoth.org/ oldold])&lt;br /&gt;
|-&lt;br /&gt;
|Bug/Feature tracker || https://bugs.wesnoth.org/&lt;br /&gt;
|-&lt;br /&gt;
|Patch tracker || https://patches.wesnoth.org/&lt;br /&gt;
|-&lt;br /&gt;
|wesnoth.org server stats || https://collectd.wesnoth.org&lt;br /&gt;
|-&lt;br /&gt;
|IRC channel (Libera.Chat) || ircs://irc.libera.chat/wesnoth-dev&lt;br /&gt;
|-&lt;br /&gt;
!colspan=2 style='text-align:left'|&lt;br /&gt;
&lt;br /&gt;
=== Other Links ===&lt;br /&gt;
|-&lt;br /&gt;
|1vs1 Wesnoth ladder || https://wesnoth.gamingladder.info/&lt;br /&gt;
|-&lt;br /&gt;
|Wesnoth matches with commentary || http://www.youtube.com/user/NekisBrutalWesnoth&lt;br /&gt;
|-&lt;br /&gt;
|Wesnoth campaign with commentary in german || https://www.youtube.com/playlist?list=PLc3DmuDuA2imW1vg9xXMNjGHm8VaXvEaz&lt;br /&gt;
|-&lt;br /&gt;
|WSNPP || [[WSNPP|http://wiki.wesnoth.org/WSNPP]]&lt;br /&gt;
|-&lt;br /&gt;
|Run Wesnoth online (Windows) || http://spoon.net/the-battle-for-wesnoth&lt;br /&gt;
|-&lt;br /&gt;
!colspan=2 style='text-align:left'|&lt;br /&gt;
=== Multilingual Players' Sites ===&lt;br /&gt;
|-&lt;br /&gt;
|Community in China || http://wesnoth.cn/&lt;br /&gt;
|-&lt;br /&gt;
|Polish Community || https://www.wesnoth.com.pl/forum/index.php&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
[[Category:Wesnoth Wiki]]&lt;/div&gt;</summary>
		<author><name>Soliton</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.wesnoth.org/index.php?title=UsefulLinks&amp;diff=74894</id>
		<title>UsefulLinks</title>
		<link rel="alternate" type="text/html" href="https://wiki.wesnoth.org/index.php?title=UsefulLinks&amp;diff=74894"/>
		<updated>2026-03-09T17:41:49Z</updated>

		<summary type="html">&lt;p&gt;Soliton: /* Battle for Wesnoth */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
!colspan=2 style='text-align:left'|&lt;br /&gt;
=== Battle for Wesnoth ===&lt;br /&gt;
|-&lt;br /&gt;
|Home Page || https://www.wesnoth.org/&lt;br /&gt;
|-&lt;br /&gt;
|GitHub Project Page || https://github.com/wesnoth/&lt;br /&gt;
|-&lt;br /&gt;
|SPI project page || https://www.spi-inc.org/projects/wesnoth/&lt;br /&gt;
|-&lt;br /&gt;
|Changelog || https://changelog.wesnoth.org/ [http://stable-changelog.wesnoth.org stable]&lt;br /&gt;
|-&lt;br /&gt;
|Compatibility-breaking changes || https://forums.wesnoth.org/viewtopic.php?t=58532&lt;br /&gt;
|-&lt;br /&gt;
|Roadmap || https://wiki.wesnoth.org/1.19_Roadmap&lt;br /&gt;
|-&lt;br /&gt;
|This wiki || [[StartingPoints|https://wiki.wesnoth.org/]]&lt;br /&gt;
|-&lt;br /&gt;
|The manual || https://manual.wesnoth.org/&lt;br /&gt;
|-&lt;br /&gt;
|Translation statistics || https://gettext.wesnoth.org/&lt;br /&gt;
|-&lt;br /&gt;
|Add-on server web interface || https://addons.wesnoth.org/ [http://stable-addons.wesnoth.org stable] [http://dev-addons.wesnoth.org dev]&lt;br /&gt;
|-&lt;br /&gt;
|Code and Content Copyright || https://wiki.wesnoth.org/Wesnoth:Copyrights&lt;br /&gt;
|-&lt;br /&gt;
|Site status || https://status.wesnoth.org&lt;br /&gt;
|-&lt;br /&gt;
|Multiplayer server statistics || https://wesnothd.wesnoth.org/&lt;br /&gt;
|-&lt;br /&gt;
|Multiplayer statistics || https://replays.wesnoth.org/dashboard/&lt;br /&gt;
|-&lt;br /&gt;
|Multiplayer replays || https://replays.wesnoth.org&lt;br /&gt;
|-&lt;br /&gt;
|Unit advancement tree || https://units.wesnoth.org/&lt;br /&gt;
|-&lt;br /&gt;
|SteamDB || https://steamdb.info/app/599390/&lt;br /&gt;
|-&lt;br /&gt;
|Forum for users and developers || https://forums.wesnoth.org/ [https://forums.wesnoth.org/search.php?search_id=newposts new posts]&lt;br /&gt;
|-&lt;br /&gt;
|List of Frequently Proposed Ideas || https://forums.wesnoth.org/viewtopic.php?f=12&amp;amp;t=34904&lt;br /&gt;
|-&lt;br /&gt;
|IRC channel (Libera.Chat) || ircs://irc.libera.chat/#wesnoth&lt;br /&gt;
|-&lt;br /&gt;
|Discord server || https://discord.gg/battleforwesnoth&lt;br /&gt;
|-&lt;br /&gt;
|IRC logs || https://wesnoth.org/irclogs/&lt;br /&gt;
|-&lt;br /&gt;
|Mastodon Account || https://fosstodon.org/@wesnoth&lt;br /&gt;
|-&lt;br /&gt;
|Project statistics || https://openhub.net/p/wesnoth&lt;br /&gt;
|-&lt;br /&gt;
|Packages || https://repology.org/project/wesnoth/versions [https://pkgs.org/search/?q=wesnoth pkgs.org] [https://pkgdex.org/search/all/wesnoth pkgdex.org]&lt;br /&gt;
|-&lt;br /&gt;
!colspan=2 style='text-align:left'|&lt;br /&gt;
&lt;br /&gt;
=== Developers ===&lt;br /&gt;
|-&lt;br /&gt;
|Git web interface || https://github.com/wesnoth/wesnoth ([https://git-scm.com/ git] [https://git-scm.com/documentation doc])&lt;br /&gt;
|-&lt;br /&gt;
|Jenkins CI || https://jenkins.wesnoth.org:8443/&lt;br /&gt;
|-&lt;br /&gt;
| Github CI || https://github.com/wesnoth/wesnoth/actions&lt;br /&gt;
|-&lt;br /&gt;
|Code documentation || https://devdocs.wesnoth.org/&lt;br /&gt;
|-&lt;br /&gt;
|GUI(2) documentation || https://wiki.wesnoth.org/GUIToolkit&lt;br /&gt;
|-&lt;br /&gt;
|Lua documentation || https://wiki.wesnoth.org/LuaAPI&lt;br /&gt;
|-&lt;br /&gt;
|WML documentation || https://wiki.wesnoth.org/WML&lt;br /&gt;
|-&lt;br /&gt;
|WFL documentation || https://wiki.wesnoth.org/WFL&lt;br /&gt;
|-&lt;br /&gt;
|Mailing lists || [https://groups.io/g/wesnoth-packagers wesnoth-packagers] - [https://groups.io/g/wesnoth-translations wesnoth-translations] ([https://listengine.tuxfamily.org/wesnoth.org/ old] - [https://mailman.wesnoth.org/ oldold])&lt;br /&gt;
|-&lt;br /&gt;
|Bug/Feature tracker || https://bugs.wesnoth.org/&lt;br /&gt;
|-&lt;br /&gt;
|Patch tracker || https://patches.wesnoth.org/&lt;br /&gt;
|-&lt;br /&gt;
|wesnoth.org server stats || https://collectd.wesnoth.org&lt;br /&gt;
|-&lt;br /&gt;
|IRC channel (Libera.Chat) || ircs://irc.libera.chat/wesnoth-dev&lt;br /&gt;
|-&lt;br /&gt;
!colspan=2 style='text-align:left'|&lt;br /&gt;
&lt;br /&gt;
=== Other Links ===&lt;br /&gt;
|-&lt;br /&gt;
|1vs1 Wesnoth ladder || https://wesnoth.gamingladder.info/&lt;br /&gt;
|-&lt;br /&gt;
|Wesnoth matches with commentary || http://www.youtube.com/user/NekisBrutalWesnoth&lt;br /&gt;
|-&lt;br /&gt;
|Wesnoth campaign with commentary in german || https://www.youtube.com/playlist?list=PLc3DmuDuA2imW1vg9xXMNjGHm8VaXvEaz&lt;br /&gt;
|-&lt;br /&gt;
|WSNPP || [[WSNPP|http://wiki.wesnoth.org/WSNPP]]&lt;br /&gt;
|-&lt;br /&gt;
|Run Wesnoth online (Windows) || http://spoon.net/the-battle-for-wesnoth&lt;br /&gt;
|-&lt;br /&gt;
!colspan=2 style='text-align:left'|&lt;br /&gt;
=== Multilingual Players' Sites ===&lt;br /&gt;
|-&lt;br /&gt;
|Community in China || http://wesnoth.cn/&lt;br /&gt;
|-&lt;br /&gt;
|Polish Community || https://www.wesnoth.com.pl/forum/index.php&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
[[Category:Wesnoth Wiki]]&lt;/div&gt;</summary>
		<author><name>Soliton</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.wesnoth.org/index.php?title=UsefulLinks&amp;diff=74893</id>
		<title>UsefulLinks</title>
		<link rel="alternate" type="text/html" href="https://wiki.wesnoth.org/index.php?title=UsefulLinks&amp;diff=74893"/>
		<updated>2026-03-09T17:40:33Z</updated>

		<summary type="html">&lt;p&gt;Soliton: /* Battle for Wesnoth */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
!colspan=2 style='text-align:left'|&lt;br /&gt;
=== Battle for Wesnoth ===&lt;br /&gt;
|-&lt;br /&gt;
|Home Page || https://www.wesnoth.org/&lt;br /&gt;
|-&lt;br /&gt;
|GitHub Project Page || https://github.com/wesnoth/&lt;br /&gt;
|-&lt;br /&gt;
|SPI project page || https://www.spi-inc.org/projects/wesnoth/&lt;br /&gt;
|-&lt;br /&gt;
|Changelog || https://changelog.wesnoth.org/ [http://stable-changelog.wesnoth.org stable]&lt;br /&gt;
|-&lt;br /&gt;
|Compatibility-breaking changes || https://forums.wesnoth.org/viewtopic.php?t=58532&lt;br /&gt;
|-&lt;br /&gt;
|Roadmap || https://wiki.wesnoth.org/1.19_Roadmap&lt;br /&gt;
|-&lt;br /&gt;
|This wiki || [[StartingPoints|https://wiki.wesnoth.org/]]&lt;br /&gt;
|-&lt;br /&gt;
|The manual || https://manual.wesnoth.org/&lt;br /&gt;
|-&lt;br /&gt;
|Translation statistics || https://gettext.wesnoth.org/&lt;br /&gt;
|-&lt;br /&gt;
|Add-on server web interface || https://addons.wesnoth.org/ [http://stable-addons.wesnoth.org stable] [http://dev-addons.wesnoth.org dev]&lt;br /&gt;
|-&lt;br /&gt;
|Code and Content Copyright || https://wiki.wesnoth.org/Wesnoth:Copyrights&lt;br /&gt;
|-&lt;br /&gt;
|Site status || https://status.wesnoth.org&lt;br /&gt;
|-&lt;br /&gt;
|Multiplayer server statistics || https://wesnothd.wesnoth.org/&lt;br /&gt;
|-&lt;br /&gt;
|Multiplayer statistics || https://replays.wesnoth.org/dashboard/&lt;br /&gt;
|-&lt;br /&gt;
|Multiplayer replays || https://replays.wesnoth.org&lt;br /&gt;
|-&lt;br /&gt;
|Unit advancement tree || https://units.wesnoth.org/&lt;br /&gt;
|-&lt;br /&gt;
|SteamDB || https://steamdb.info/app/599390/&lt;br /&gt;
|-&lt;br /&gt;
|Forum for users and developers || https://forums.wesnoth.org/ [https://forums.wesnoth.org/search.php?search_id=newposts new posts]&lt;br /&gt;
|-&lt;br /&gt;
|List of Frequently Proposed Ideas || https://forums.wesnoth.org/viewtopic.php?f=12&amp;amp;t=34904&lt;br /&gt;
|-&lt;br /&gt;
|IRC channel (Libera.Chat) || ircs://irc.libera.chat/#wesnoth&lt;br /&gt;
|-&lt;br /&gt;
|Discord server || https://discord.gg/battleforwesnoth&lt;br /&gt;
|-&lt;br /&gt;
|IRC logs || https://wesnoth.org/irclogs/&lt;br /&gt;
|-&lt;br /&gt;
|Mastodon Account || https://fosstodon.org/@wesnoth&lt;br /&gt;
|-&lt;br /&gt;
|Project statistics || https://openhub.net/p/wesnoth&lt;br /&gt;
|-&lt;br /&gt;
|Packages || https://repology.org/project/wesnoth/versions [https://pkgs.org/search/?q=wesnoth pkgs.org] [https://pkgdex.org/search/all/wesnoth pkgdex.org]&lt;br /&gt;
|-&lt;br /&gt;
!colspan=2 style='text-align:left'|&lt;br /&gt;
&lt;br /&gt;
=== Developers ===&lt;br /&gt;
|-&lt;br /&gt;
|Git web interface || https://github.com/wesnoth/wesnoth ([https://git-scm.com/ git] [https://git-scm.com/documentation doc])&lt;br /&gt;
|-&lt;br /&gt;
|Jenkins CI || https://jenkins.wesnoth.org:8443/&lt;br /&gt;
|-&lt;br /&gt;
| Github CI || https://github.com/wesnoth/wesnoth/actions&lt;br /&gt;
|-&lt;br /&gt;
|Code documentation || https://devdocs.wesnoth.org/&lt;br /&gt;
|-&lt;br /&gt;
|GUI(2) documentation || https://wiki.wesnoth.org/GUIToolkit&lt;br /&gt;
|-&lt;br /&gt;
|Lua documentation || https://wiki.wesnoth.org/LuaAPI&lt;br /&gt;
|-&lt;br /&gt;
|WML documentation || https://wiki.wesnoth.org/WML&lt;br /&gt;
|-&lt;br /&gt;
|WFL documentation || https://wiki.wesnoth.org/WFL&lt;br /&gt;
|-&lt;br /&gt;
|Mailing lists || [https://groups.io/g/wesnoth-packagers wesnoth-packagers] - [https://groups.io/g/wesnoth-translations wesnoth-translations] ([https://listengine.tuxfamily.org/wesnoth.org/ old] - [https://mailman.wesnoth.org/ oldold])&lt;br /&gt;
|-&lt;br /&gt;
|Bug/Feature tracker || https://bugs.wesnoth.org/&lt;br /&gt;
|-&lt;br /&gt;
|Patch tracker || https://patches.wesnoth.org/&lt;br /&gt;
|-&lt;br /&gt;
|wesnoth.org server stats || https://collectd.wesnoth.org&lt;br /&gt;
|-&lt;br /&gt;
|IRC channel (Libera.Chat) || ircs://irc.libera.chat/wesnoth-dev&lt;br /&gt;
|-&lt;br /&gt;
!colspan=2 style='text-align:left'|&lt;br /&gt;
&lt;br /&gt;
=== Other Links ===&lt;br /&gt;
|-&lt;br /&gt;
|1vs1 Wesnoth ladder || https://wesnoth.gamingladder.info/&lt;br /&gt;
|-&lt;br /&gt;
|Wesnoth matches with commentary || http://www.youtube.com/user/NekisBrutalWesnoth&lt;br /&gt;
|-&lt;br /&gt;
|Wesnoth campaign with commentary in german || https://www.youtube.com/playlist?list=PLc3DmuDuA2imW1vg9xXMNjGHm8VaXvEaz&lt;br /&gt;
|-&lt;br /&gt;
|WSNPP || [[WSNPP|http://wiki.wesnoth.org/WSNPP]]&lt;br /&gt;
|-&lt;br /&gt;
|Run Wesnoth online (Windows) || http://spoon.net/the-battle-for-wesnoth&lt;br /&gt;
|-&lt;br /&gt;
!colspan=2 style='text-align:left'|&lt;br /&gt;
=== Multilingual Players' Sites ===&lt;br /&gt;
|-&lt;br /&gt;
|Community in China || http://wesnoth.cn/&lt;br /&gt;
|-&lt;br /&gt;
|Polish Community || https://www.wesnoth.com.pl/forum/index.php&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
[[Category:Wesnoth Wiki]]&lt;/div&gt;</summary>
		<author><name>Soliton</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.wesnoth.org/index.php?title=WesnothTranslations&amp;diff=74890</id>
		<title>WesnothTranslations</title>
		<link rel="alternate" type="text/html" href="https://wiki.wesnoth.org/index.php?title=WesnothTranslations&amp;diff=74890"/>
		<updated>2026-03-06T15:18:47Z</updated>

		<summary type="html">&lt;p&gt;Soliton: /* Mailing List */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==  Translations  ==&lt;br /&gt;
&lt;br /&gt;
Wesnoth is currently being translated into the following languages. These languages are active, with maintainer.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Translation !! Maintainer !! Contact&lt;br /&gt;
|-&lt;br /&gt;
| [[AncientGreekTranslation|Ancient Greek]] || Mejri Ziad (Hermestrismi)|| [mailto:beja.comuneATgmailDOTcom]&lt;br /&gt;
|-&lt;br /&gt;
| [[ArabicTranslation|Arabic]] || Mejri Ziad (Hermestrismi)|| [mailto:beja.comuneATgmailDOTcom]&lt;br /&gt;
|-&lt;br /&gt;
| [[BengaliTranslation|Bengali]] || Subhraman Sarkar (LumiousE) || lumious_e on Discord&lt;br /&gt;
|-&lt;br /&gt;
| [[BulgarianTranslation|Bulgarian]] || Ivan Petrov (TheWhiteKnight) || [mailto:vankata_petrovATabvDOTbg]&lt;br /&gt;
|-&lt;br /&gt;
| [[CatalanTranslation|Catalan]] || Arnau Vàzquez Palma || [mailto:arnauvpATmurenaDOTio]&lt;br /&gt;
|-&lt;br /&gt;
| [[ChineseTranslation|Chinese]] || CloudiDust || [mailto:cloudidustATgmailDOTcom]&lt;br /&gt;
|-&lt;br /&gt;
| [[ChineseTaiwanTranslation|Chinese (Taiwan)]] || 楊綮銘 (Taiwan) || [mailto:steven2880ATgmailDOTcom]&lt;br /&gt;
|-&lt;br /&gt;
| [[CzechTranslation|Czech]] || Michal Žejdl || [mailto:lachimATemerDOTcz]&lt;br /&gt;
|-&lt;br /&gt;
| [[DutchTranslation|Dutch]] || Merijn de Vet || [mailto:merijndevetAThotmailDOTcom]&lt;br /&gt;
|-&lt;br /&gt;
| [[EnglishGBTranslation|English (GB)]] || Wedge009 || [mailto:wedge009ATwedge009DOTnet]&lt;br /&gt;
|-&lt;br /&gt;
| [[EnglishShawTranslation|English (Shaw)]] || Arc Riley || [mailto:ArcRileyATubuntuDOTcom]&lt;br /&gt;
|-&lt;br /&gt;
| [[Esperanto_translation|Esperanto]] || Mariano Street (mctpyt) || [mailto:mctpytATprotonDOTme]&lt;br /&gt;
|-&lt;br /&gt;
| [[FinnishTranslation|Finnish]] || Jaakko Saarikko (styxnix) || [mailto:jaakkoDOTsaarikkoATprotonmailDOTcom]&lt;br /&gt;
|-&lt;br /&gt;
| [[FrenchTranslation|French]] || demario || [mailto:wesnothfr-request@lists.tuxfamily.org?subject=subscribe mailing list]&lt;br /&gt;
|-&lt;br /&gt;
| [[GermanTranslation|German]] || Aaron Winter (Bitron) || &lt;br /&gt;
|-&lt;br /&gt;
| [[HungarianTranslation|Hungarian]] || Berda Jenő (bigbilly) || [mailto:big4billyATgmailDOTcom]&lt;br /&gt;
|-&lt;br /&gt;
| [[IndonesianTranslation|Indonesian]] || Irsyad Musthafa || [mailto:sevennightmareATtutanotaDOTde]&lt;br /&gt;
|-&lt;br /&gt;
| [[ItalianTranslation|Italian]] || Antonio Rosella || [mailto:arosellaATyahooDOTcom]&lt;br /&gt;
|-&lt;br /&gt;
| [[JapaneseTranslation|Japanese]] || Hironori Fujimoto (RatArmy) || [mailto:broadbarredfirefishATgmailDOTcom]&lt;br /&gt;
|-&lt;br /&gt;
| [[KoreanTranslation|Korean]] || mistzone || [mailto:drier22ATgmailDOTcom]&lt;br /&gt;
|-&lt;br /&gt;
| [[LatinTranslation|Latin]] || Daniel Faustmann || [mailto:donnerstag.freitag213@gmail.com]&lt;br /&gt;
|-&lt;br /&gt;
| [[NorwegianTranslation|Norwegian]] || Bloodaxe || [mailto:bloodaxenor@protonmail.com]&lt;br /&gt;
|-&lt;br /&gt;
| [[PolishTranslation|Polish]] || ForPeace || [https://forums.wesnoth.org/viewtopic.php?f=7&amp;amp;t=3796 forum thread]&lt;br /&gt;
|-&lt;br /&gt;
| [[PortugueseTranslation|Portuguese Brazilian]] || Andrei Machado || [mailto:andreisp.machadoATyahooDOTcom]&lt;br /&gt;
|-&lt;br /&gt;
| [[PortugueseContinentalTranslation|Portuguese (European)]] || trewe || [mailto:sjrs456ATyahooDOTfr]&lt;br /&gt;
|-&lt;br /&gt;
| [[RussianTranslation|Russian]] || Artem Khrapov || ([[User:kabachuha|kabachuha]]) [mailto:artemkhrapov2001ATyandexDOTru]&lt;br /&gt;
|-&lt;br /&gt;
| [[Scottish_Gaelic_Translation|Scottish Gaelic]] || GunChleoc || [mailto:fiosAIGforamnagaidhligDOTnet]&lt;br /&gt;
|-&lt;br /&gt;
| [[SlovakTranslation#Preklad|Slovak]] || Stanislav Hoferek || [mailto:shoferek@gmail.com]&lt;br /&gt;
|-&lt;br /&gt;
| [[SpanishTranslation|Spanish]] || Sebastián Lecchini (Sebas38760) || [mailto:sebas38760@gmail.com]&lt;br /&gt;
|-&lt;br /&gt;
| [[SwedishTranslation|Swedish]] || Alex Alowersson (fluxbird) || [mailto:alexalowersonATgmailDOTcom]&lt;br /&gt;
|-&lt;br /&gt;
| [[TurkishTranslation|Turkish]] || Nilgün Belma Bugüner || [mailto:nilgunATbelgelerDOTorg]&lt;br /&gt;
|-&lt;br /&gt;
| [[UkrainianTranslation|Ukrainian]] || Oleksii Okhrimenko (lexa04) || Discord: amakri Email: [mailto:ohrimaleATgmailDOTcom]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Currently inactive translations. If you wish to improve some of these languages (or one of the above maintainers is not responsive), contact Ivanovic on the [https://wiki.wesnoth.org/Support Wesnoth Discord channel].&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Translation !! Maintainer !! Contact&lt;br /&gt;
|-&lt;br /&gt;
| [[AfrikaansTranslation|Afrikaans]] || None || N/A&lt;br /&gt;
|-&lt;br /&gt;
| [[BasqueTranslation|Basque]] || None || N/A&lt;br /&gt;
|-&lt;br /&gt;
| [[BurmeseTranslation|Burmese]] || None || N/A&lt;br /&gt;
|-&lt;br /&gt;
| [[CroatianTranslation|Croatian]] || None || N/A&lt;br /&gt;
|-&lt;br /&gt;
| [[DanishTranslation|Danish]] || None || N/A&lt;br /&gt;
|-&lt;br /&gt;
| [[GalicianTranslation|Galician]] || None || N/A&lt;br /&gt;
|-&lt;br /&gt;
| [[GreekTranslation|Greek]] || None || N/A&lt;br /&gt;
|-&lt;br /&gt;
| [[HebrewTranslation|Hebrew]] || None || N/A&lt;br /&gt;
|-&lt;br /&gt;
| [[IcelandicTranslation|Icelandic]] || None || N/A&lt;br /&gt;
|-&lt;br /&gt;
| [[IrishTranslation|Irish]] || None || N/A&lt;br /&gt;
|-&lt;br /&gt;
| [[LatvianTranslation|Latvian]] || None || N/A&lt;br /&gt;
|-&lt;br /&gt;
| [[LithuanianTranslation|Lithuanian]] || None || N/A&lt;br /&gt;
|-&lt;br /&gt;
| [[MarathiTranslation|Marathi]] || None || N/A&lt;br /&gt;
|-&lt;br /&gt;
| [[MacedonianTranslation|Macedonian]] || None || N/A&lt;br /&gt;
|-&lt;br /&gt;
| [[OldEnglishTranslation|Old English]] || None || N/A&lt;br /&gt;
|-&lt;br /&gt;
| [[RACVTranslation|RACV]] || None || N/A&lt;br /&gt;
|-&lt;br /&gt;
| [[RomanianTranslation|Romanian]] || None || N/A&lt;br /&gt;
|-&lt;br /&gt;
| [[SerbianTranslation|Serbian]] || None || N/A&lt;br /&gt;
|-&lt;br /&gt;
| [[SlovenianTranslation|Slovenian]] || None || N/A&lt;br /&gt;
|-&lt;br /&gt;
| [[SpanishLatinAmericanTranslation|Spanish (Latin American)]] || None || N/A&lt;br /&gt;
|-&lt;br /&gt;
| [[ValencianTranslation|Valencian]] || None || N/A&lt;br /&gt;
|-&lt;br /&gt;
| [[VietnameseTranslation|Vietnamese]] || None || N/A&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Mailing List ==&lt;br /&gt;
&lt;br /&gt;
There now is a mailing list dedicated to translation matters. It is mainly intended to be used for informing translation maintainers about important changes, to announce string freezes and other special things. Everyone is free to subscribe to this list.&lt;br /&gt;
&lt;br /&gt;
* [https://groups.io/g/wesnoth-translations From Februar 2025]&lt;br /&gt;
* [https://listengine.tuxfamily.org/wesnoth.org/i18n/ List info, how to subscribe, and archives from April 2022]&lt;br /&gt;
* [https://mailman.wesnoth.org/pipermail/i18n/ Old list archives (up until April 2022)]&lt;br /&gt;
&lt;br /&gt;
Please keep in mind that this list is not meant for discussing changes for one single translation but instead subjects which are relevant to all translations.&lt;br /&gt;
&lt;br /&gt;
==  See also  ==&lt;br /&gt;
&lt;br /&gt;
* [[WesnothTranslationsHowTo]]&lt;br /&gt;
* [[ImageLocalization]]&lt;br /&gt;
* [[GetText]]&lt;br /&gt;
* [http://gettext.wesnoth.org Translations statistics (stable)]&lt;br /&gt;
* [http://gettext.wesnoth.org/index.php?version=trunk&amp;amp;package=alloff Translations statistics (development)]&lt;br /&gt;
* [[GettextForTranslators#For_add-ons|Translating User Made Campaigns and add-ons]]&lt;br /&gt;
* [[SpellingMistakes]]&lt;br /&gt;
* [[CharactersStorys| Character descriptions for Translators (Spoiler Warning)]]&lt;br /&gt;
* [[Poetry of Wesnoth Translations]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Translations|*]]&lt;/div&gt;</summary>
		<author><name>Soliton</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.wesnoth.org/index.php?title=WesnothTranslations&amp;diff=74889</id>
		<title>WesnothTranslations</title>
		<link rel="alternate" type="text/html" href="https://wiki.wesnoth.org/index.php?title=WesnothTranslations&amp;diff=74889"/>
		<updated>2026-03-06T15:08:39Z</updated>

		<summary type="html">&lt;p&gt;Soliton: /* Translations */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==  Translations  ==&lt;br /&gt;
&lt;br /&gt;
Wesnoth is currently being translated into the following languages. These languages are active, with maintainer.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Translation !! Maintainer !! Contact&lt;br /&gt;
|-&lt;br /&gt;
| [[AncientGreekTranslation|Ancient Greek]] || Mejri Ziad (Hermestrismi)|| [mailto:beja.comuneATgmailDOTcom]&lt;br /&gt;
|-&lt;br /&gt;
| [[ArabicTranslation|Arabic]] || Mejri Ziad (Hermestrismi)|| [mailto:beja.comuneATgmailDOTcom]&lt;br /&gt;
|-&lt;br /&gt;
| [[BengaliTranslation|Bengali]] || Subhraman Sarkar (LumiousE) || lumious_e on Discord&lt;br /&gt;
|-&lt;br /&gt;
| [[BulgarianTranslation|Bulgarian]] || Ivan Petrov (TheWhiteKnight) || [mailto:vankata_petrovATabvDOTbg]&lt;br /&gt;
|-&lt;br /&gt;
| [[CatalanTranslation|Catalan]] || Arnau Vàzquez Palma || [mailto:arnauvpATmurenaDOTio]&lt;br /&gt;
|-&lt;br /&gt;
| [[ChineseTranslation|Chinese]] || CloudiDust || [mailto:cloudidustATgmailDOTcom]&lt;br /&gt;
|-&lt;br /&gt;
| [[ChineseTaiwanTranslation|Chinese (Taiwan)]] || 楊綮銘 (Taiwan) || [mailto:steven2880ATgmailDOTcom]&lt;br /&gt;
|-&lt;br /&gt;
| [[CzechTranslation|Czech]] || Michal Žejdl || [mailto:lachimATemerDOTcz]&lt;br /&gt;
|-&lt;br /&gt;
| [[DutchTranslation|Dutch]] || Merijn de Vet || [mailto:merijndevetAThotmailDOTcom]&lt;br /&gt;
|-&lt;br /&gt;
| [[EnglishGBTranslation|English (GB)]] || Wedge009 || [mailto:wedge009ATwedge009DOTnet]&lt;br /&gt;
|-&lt;br /&gt;
| [[EnglishShawTranslation|English (Shaw)]] || Arc Riley || [mailto:ArcRileyATubuntuDOTcom]&lt;br /&gt;
|-&lt;br /&gt;
| [[Esperanto_translation|Esperanto]] || Mariano Street (mctpyt) || [mailto:mctpytATprotonDOTme]&lt;br /&gt;
|-&lt;br /&gt;
| [[FinnishTranslation|Finnish]] || Jaakko Saarikko (styxnix) || [mailto:jaakkoDOTsaarikkoATprotonmailDOTcom]&lt;br /&gt;
|-&lt;br /&gt;
| [[FrenchTranslation|French]] || demario || [mailto:wesnothfr-request@lists.tuxfamily.org?subject=subscribe mailing list]&lt;br /&gt;
|-&lt;br /&gt;
| [[GermanTranslation|German]] || Aaron Winter (Bitron) || &lt;br /&gt;
|-&lt;br /&gt;
| [[HungarianTranslation|Hungarian]] || Berda Jenő (bigbilly) || [mailto:big4billyATgmailDOTcom]&lt;br /&gt;
|-&lt;br /&gt;
| [[IndonesianTranslation|Indonesian]] || Irsyad Musthafa || [mailto:sevennightmareATtutanotaDOTde]&lt;br /&gt;
|-&lt;br /&gt;
| [[ItalianTranslation|Italian]] || Antonio Rosella || [mailto:arosellaATyahooDOTcom]&lt;br /&gt;
|-&lt;br /&gt;
| [[JapaneseTranslation|Japanese]] || Hironori Fujimoto (RatArmy) || [mailto:broadbarredfirefishATgmailDOTcom]&lt;br /&gt;
|-&lt;br /&gt;
| [[KoreanTranslation|Korean]] || mistzone || [mailto:drier22ATgmailDOTcom]&lt;br /&gt;
|-&lt;br /&gt;
| [[LatinTranslation|Latin]] || Daniel Faustmann || [mailto:donnerstag.freitag213@gmail.com]&lt;br /&gt;
|-&lt;br /&gt;
| [[NorwegianTranslation|Norwegian]] || Bloodaxe || [mailto:bloodaxenor@protonmail.com]&lt;br /&gt;
|-&lt;br /&gt;
| [[PolishTranslation|Polish]] || ForPeace || [https://forums.wesnoth.org/viewtopic.php?f=7&amp;amp;t=3796 forum thread]&lt;br /&gt;
|-&lt;br /&gt;
| [[PortugueseTranslation|Portuguese Brazilian]] || Andrei Machado || [mailto:andreisp.machadoATyahooDOTcom]&lt;br /&gt;
|-&lt;br /&gt;
| [[PortugueseContinentalTranslation|Portuguese (European)]] || trewe || [mailto:sjrs456ATyahooDOTfr]&lt;br /&gt;
|-&lt;br /&gt;
| [[RussianTranslation|Russian]] || Artem Khrapov || ([[User:kabachuha|kabachuha]]) [mailto:artemkhrapov2001ATyandexDOTru]&lt;br /&gt;
|-&lt;br /&gt;
| [[Scottish_Gaelic_Translation|Scottish Gaelic]] || GunChleoc || [mailto:fiosAIGforamnagaidhligDOTnet]&lt;br /&gt;
|-&lt;br /&gt;
| [[SlovakTranslation#Preklad|Slovak]] || Stanislav Hoferek || [mailto:shoferek@gmail.com]&lt;br /&gt;
|-&lt;br /&gt;
| [[SpanishTranslation|Spanish]] || Sebastián Lecchini (Sebas38760) || [mailto:sebas38760@gmail.com]&lt;br /&gt;
|-&lt;br /&gt;
| [[SwedishTranslation|Swedish]] || Alex Alowersson (fluxbird) || [mailto:alexalowersonATgmailDOTcom]&lt;br /&gt;
|-&lt;br /&gt;
| [[TurkishTranslation|Turkish]] || Nilgün Belma Bugüner || [mailto:nilgunATbelgelerDOTorg]&lt;br /&gt;
|-&lt;br /&gt;
| [[UkrainianTranslation|Ukrainian]] || Oleksii Okhrimenko (lexa04) || Discord: amakri Email: [mailto:ohrimaleATgmailDOTcom]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Currently inactive translations. If you wish to improve some of these languages (or one of the above maintainers is not responsive), contact Ivanovic on the [https://wiki.wesnoth.org/Support Wesnoth Discord channel].&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Translation !! Maintainer !! Contact&lt;br /&gt;
|-&lt;br /&gt;
| [[AfrikaansTranslation|Afrikaans]] || None || N/A&lt;br /&gt;
|-&lt;br /&gt;
| [[BasqueTranslation|Basque]] || None || N/A&lt;br /&gt;
|-&lt;br /&gt;
| [[BurmeseTranslation|Burmese]] || None || N/A&lt;br /&gt;
|-&lt;br /&gt;
| [[CroatianTranslation|Croatian]] || None || N/A&lt;br /&gt;
|-&lt;br /&gt;
| [[DanishTranslation|Danish]] || None || N/A&lt;br /&gt;
|-&lt;br /&gt;
| [[GalicianTranslation|Galician]] || None || N/A&lt;br /&gt;
|-&lt;br /&gt;
| [[GreekTranslation|Greek]] || None || N/A&lt;br /&gt;
|-&lt;br /&gt;
| [[HebrewTranslation|Hebrew]] || None || N/A&lt;br /&gt;
|-&lt;br /&gt;
| [[IcelandicTranslation|Icelandic]] || None || N/A&lt;br /&gt;
|-&lt;br /&gt;
| [[IrishTranslation|Irish]] || None || N/A&lt;br /&gt;
|-&lt;br /&gt;
| [[LatvianTranslation|Latvian]] || None || N/A&lt;br /&gt;
|-&lt;br /&gt;
| [[LithuanianTranslation|Lithuanian]] || None || N/A&lt;br /&gt;
|-&lt;br /&gt;
| [[MarathiTranslation|Marathi]] || None || N/A&lt;br /&gt;
|-&lt;br /&gt;
| [[MacedonianTranslation|Macedonian]] || None || N/A&lt;br /&gt;
|-&lt;br /&gt;
| [[OldEnglishTranslation|Old English]] || None || N/A&lt;br /&gt;
|-&lt;br /&gt;
| [[RACVTranslation|RACV]] || None || N/A&lt;br /&gt;
|-&lt;br /&gt;
| [[RomanianTranslation|Romanian]] || None || N/A&lt;br /&gt;
|-&lt;br /&gt;
| [[SerbianTranslation|Serbian]] || None || N/A&lt;br /&gt;
|-&lt;br /&gt;
| [[SlovenianTranslation|Slovenian]] || None || N/A&lt;br /&gt;
|-&lt;br /&gt;
| [[SpanishLatinAmericanTranslation|Spanish (Latin American)]] || None || N/A&lt;br /&gt;
|-&lt;br /&gt;
| [[ValencianTranslation|Valencian]] || None || N/A&lt;br /&gt;
|-&lt;br /&gt;
| [[VietnameseTranslation|Vietnamese]] || None || N/A&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Mailing List ==&lt;br /&gt;
&lt;br /&gt;
There now is a mailing list dedicated to translation matters. It is mainly intended to be used for informing translation maintainers about important changes, to announce string freezes and other special things. Everyone is free to subscribe to this list.&lt;br /&gt;
&lt;br /&gt;
* [https://listengine.tuxfamily.org/wesnoth.org/i18n/ List info, how to subscribe, and archives from April 2022]&lt;br /&gt;
* [https://mailman.wesnoth.org/pipermail/i18n/ Old list archives (up until April 2022)]&lt;br /&gt;
&lt;br /&gt;
Please keep in mind that this list is not meant for discussing changes for one single translation but instead subjects which are relevant to all translations.&lt;br /&gt;
&lt;br /&gt;
==  See also  ==&lt;br /&gt;
&lt;br /&gt;
* [[WesnothTranslationsHowTo]]&lt;br /&gt;
* [[ImageLocalization]]&lt;br /&gt;
* [[GetText]]&lt;br /&gt;
* [http://gettext.wesnoth.org Translations statistics (stable)]&lt;br /&gt;
* [http://gettext.wesnoth.org/index.php?version=trunk&amp;amp;package=alloff Translations statistics (development)]&lt;br /&gt;
* [[GettextForTranslators#For_add-ons|Translating User Made Campaigns and add-ons]]&lt;br /&gt;
* [[SpellingMistakes]]&lt;br /&gt;
* [[CharactersStorys| Character descriptions for Translators (Spoiler Warning)]]&lt;br /&gt;
* [[Poetry of Wesnoth Translations]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Translations|*]]&lt;/div&gt;</summary>
		<author><name>Soliton</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.wesnoth.org/index.php?title=UsefulLinks&amp;diff=74887</id>
		<title>UsefulLinks</title>
		<link rel="alternate" type="text/html" href="https://wiki.wesnoth.org/index.php?title=UsefulLinks&amp;diff=74887"/>
		<updated>2026-03-04T15:47:06Z</updated>

		<summary type="html">&lt;p&gt;Soliton: /* Battle for Wesnoth */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
!colspan=2 style='text-align:left'|&lt;br /&gt;
=== Battle for Wesnoth ===&lt;br /&gt;
|-&lt;br /&gt;
|Home Page || https://www.wesnoth.org/&lt;br /&gt;
|-&lt;br /&gt;
|GitHub Project Page || https://github.com/wesnoth/&lt;br /&gt;
|-&lt;br /&gt;
|SPI project page || https://www.spi-inc.org/projects/wesnoth/&lt;br /&gt;
|-&lt;br /&gt;
|Changelog || https://changelog.wesnoth.org/ [http://stable-changelog.wesnoth.org stable]&lt;br /&gt;
|-&lt;br /&gt;
|Compatibility-breaking changes || https://forums.wesnoth.org/viewtopic.php?t=58532&lt;br /&gt;
|-&lt;br /&gt;
|Roadmap || https://wiki.wesnoth.org/1.19_Roadmap&lt;br /&gt;
|-&lt;br /&gt;
|This wiki || [[StartingPoints|https://wiki.wesnoth.org/]]&lt;br /&gt;
|-&lt;br /&gt;
|The manual || https://manual.wesnoth.org/&lt;br /&gt;
|-&lt;br /&gt;
|Translation statistics || https://gettext.wesnoth.org/&lt;br /&gt;
|-&lt;br /&gt;
|Add-on server web interface || https://addons.wesnoth.org/ [http://stable-addons.wesnoth.org stable] [http://dev-addons.wesnoth.org dev]&lt;br /&gt;
|-&lt;br /&gt;
|Code and Content Copyright || https://wiki.wesnoth.org/Wesnoth:Copyrights&lt;br /&gt;
|-&lt;br /&gt;
|Multiplayer server statistics || https://wesnothd.wesnoth.org/&lt;br /&gt;
|-&lt;br /&gt;
|Multiplayer statistics || https://replays.wesnoth.org/dashboard/&lt;br /&gt;
|-&lt;br /&gt;
|Multiplayer replays || https://replays.wesnoth.org&lt;br /&gt;
|-&lt;br /&gt;
|Unit advancement tree || https://units.wesnoth.org/&lt;br /&gt;
|-&lt;br /&gt;
|SteamDB || https://steamdb.info/app/599390/&lt;br /&gt;
|-&lt;br /&gt;
|Forum for users and developers || https://forums.wesnoth.org/ [https://forums.wesnoth.org/search.php?search_id=newposts new posts]&lt;br /&gt;
|-&lt;br /&gt;
|List of Frequently Proposed Ideas || https://forums.wesnoth.org/viewtopic.php?f=12&amp;amp;t=34904&lt;br /&gt;
|-&lt;br /&gt;
|IRC channel (Libera.Chat) || ircs://irc.libera.chat/#wesnoth&lt;br /&gt;
|-&lt;br /&gt;
|Discord server || https://discord.gg/battleforwesnoth&lt;br /&gt;
|-&lt;br /&gt;
|IRC logs || https://wesnoth.org/irclogs/&lt;br /&gt;
|-&lt;br /&gt;
|Mastodon Account || https://fosstodon.org/@wesnoth&lt;br /&gt;
|-&lt;br /&gt;
|Project statistics || https://openhub.net/p/wesnoth&lt;br /&gt;
|-&lt;br /&gt;
|Packages || https://repology.org/project/wesnoth/versions [https://pkgs.org/search/?q=wesnoth pkgs.org] [https://pkgdex.org/search/all/wesnoth pkgdex.org]&lt;br /&gt;
|-&lt;br /&gt;
!colspan=2 style='text-align:left'|&lt;br /&gt;
&lt;br /&gt;
=== Developers ===&lt;br /&gt;
|-&lt;br /&gt;
|Git web interface || https://github.com/wesnoth/wesnoth ([https://git-scm.com/ git] [https://git-scm.com/documentation doc])&lt;br /&gt;
|-&lt;br /&gt;
|Jenkins CI || https://jenkins.wesnoth.org:8443/&lt;br /&gt;
|-&lt;br /&gt;
| Github CI || https://github.com/wesnoth/wesnoth/actions&lt;br /&gt;
|-&lt;br /&gt;
|Code documentation || https://devdocs.wesnoth.org/&lt;br /&gt;
|-&lt;br /&gt;
|GUI(2) documentation || https://wiki.wesnoth.org/GUIToolkit&lt;br /&gt;
|-&lt;br /&gt;
|Lua documentation || https://wiki.wesnoth.org/LuaAPI&lt;br /&gt;
|-&lt;br /&gt;
|WML documentation || https://wiki.wesnoth.org/WML&lt;br /&gt;
|-&lt;br /&gt;
|WFL documentation || https://wiki.wesnoth.org/WFL&lt;br /&gt;
|-&lt;br /&gt;
|Mailing lists || [https://groups.io/g/wesnoth-packagers wesnoth-packagers] - [https://groups.io/g/wesnoth-translations wesnoth-translations] ([https://listengine.tuxfamily.org/wesnoth.org/ old] - [https://mailman.wesnoth.org/ oldold])&lt;br /&gt;
|-&lt;br /&gt;
|Bug/Feature tracker || https://bugs.wesnoth.org/&lt;br /&gt;
|-&lt;br /&gt;
|Patch tracker || https://patches.wesnoth.org/&lt;br /&gt;
|-&lt;br /&gt;
|wesnoth.org server stats || https://collectd.wesnoth.org&lt;br /&gt;
|-&lt;br /&gt;
|IRC channel (Libera.Chat) || ircs://irc.libera.chat/wesnoth-dev&lt;br /&gt;
|-&lt;br /&gt;
!colspan=2 style='text-align:left'|&lt;br /&gt;
&lt;br /&gt;
=== Other Links ===&lt;br /&gt;
|-&lt;br /&gt;
|1vs1 Wesnoth ladder || https://wesnoth.gamingladder.info/&lt;br /&gt;
|-&lt;br /&gt;
|Wesnoth matches with commentary || http://www.youtube.com/user/NekisBrutalWesnoth&lt;br /&gt;
|-&lt;br /&gt;
|Wesnoth campaign with commentary in german || https://www.youtube.com/playlist?list=PLc3DmuDuA2imW1vg9xXMNjGHm8VaXvEaz&lt;br /&gt;
|-&lt;br /&gt;
|WSNPP || [[WSNPP|http://wiki.wesnoth.org/WSNPP]]&lt;br /&gt;
|-&lt;br /&gt;
|Run Wesnoth online (Windows) || http://spoon.net/the-battle-for-wesnoth&lt;br /&gt;
|-&lt;br /&gt;
!colspan=2 style='text-align:left'|&lt;br /&gt;
=== Multilingual Players' Sites ===&lt;br /&gt;
|-&lt;br /&gt;
|Community in China || http://wesnoth.cn/&lt;br /&gt;
|-&lt;br /&gt;
|Polish Community || https://www.wesnoth.com.pl/forum/index.php&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
[[Category:Wesnoth Wiki]]&lt;/div&gt;</summary>
		<author><name>Soliton</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.wesnoth.org/index.php?title=EraWML&amp;diff=74885</id>
		<title>EraWML</title>
		<link rel="alternate" type="text/html" href="https://wiki.wesnoth.org/index.php?title=EraWML&amp;diff=74885"/>
		<updated>2026-03-02T14:55:08Z</updated>

		<summary type="html">&lt;p&gt;Soliton: /* Defining Factions */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{WML Tags}}&lt;br /&gt;
== The [era] top level tag ==&lt;br /&gt;
&lt;br /&gt;
This [[AddonsWML|addon module]] tag describes one era. An era is a set of teams to play in multiplayer.&lt;br /&gt;
&lt;br /&gt;
In the multiplayer game creation screen, an era is chosen by the host by the 'Era' option button.&lt;br /&gt;
&lt;br /&gt;
The following key/tags are recognized for '''[era]''', in addition to the common [[AddonsWML|addon module keys and tags]]:&lt;br /&gt;
* &amp;lt;span id=&amp;quot;require_era&amp;quot;&amp;gt;'''require_era'''&amp;lt;/span&amp;gt;: whether clients are required to have this era installed beforehand to be allowed join a game using this era. Possible values 'yes' (the default) and 'no'.&lt;br /&gt;
* '''allow_scenario''': a list of scenario ids. Only the scenarios with matching ids will be allowed to be played with this era.&lt;br /&gt;
* '''disallow_scenario''': a list of scenario ids. Only the scenarios with matching ids will not be allowed to be played with this era. Cannot be used in parallel with allow_scenario.&lt;br /&gt;
* '''ignore_incompatible_scenario''': a list of scenario ids. The scenarios with matching ids will be considered compatible with this era regardless their dependencies.&lt;br /&gt;
* '''allow_modification''': same as allow_scenario, but for modifications.&lt;br /&gt;
* '''disallow_modification''': same as disallow_scenario, but for modifications. Cannot be used in parallel with allow_modification.&lt;br /&gt;
* '''ignore_incompatible_modification''': same as ignore_incompatible_scenario, but for modifications.&lt;br /&gt;
* '''force_modification''': a list of modification ids. The specified modifications must be enabled to play this era.&lt;br /&gt;
* '''hide_help''': {{DevFeature1.13|0}} whether this era should show up in the help browser or not. Default no.&lt;br /&gt;
&lt;br /&gt;
== Defining Factions ==&lt;br /&gt;
&lt;br /&gt;
Each faction in the era is defined by a '''[multiplayer_side]''' tag. This tag contains most of the same keys as a [side] tag (see [[SideWML]]). When a multiplayer game is played, then the [side] tag for the scenario is merged with the keys (currently, not tags) of the '''[multiplayer_side]''' tag of the faction which the side chose.&lt;br /&gt;
&lt;br /&gt;
Each faction needs to specify its recruit list with the '''recruit''' key, which is described in [[SideWML]].&lt;br /&gt;
&lt;br /&gt;
The following additional keys are unique to '''[multiplayer_side]''':&lt;br /&gt;
&lt;br /&gt;
* '''id''': faction ID - must be unique to your era. No gameplay effect&lt;br /&gt;
* '''name''': a description that Wesnoth displays as the option selecting that faction. This key is used for sorting factions in era.&lt;br /&gt;
* '''image''': an image to display in the option. This image will use the team color.&lt;br /&gt;
* '''leader''': a list of unit types. Must be present. When this faction is chosen, the side can choose any of these unit types to be the side's leader (i.e. &amp;quot;Choose your Leader&amp;quot;). They will also have the option of having one of these types being chosen randomly.&lt;br /&gt;
* '''random_leader''': if this list of types is present, it would use this list to instead to choose a random leader. If not it would use '''leader'''&lt;br /&gt;
* '''random_faction''': default 'no'. If 'yes', then when this faction is chosen, another non random faction will be randomly chosen instead. The leader will also be chosen randomly. All random_faction=yes factions are sorted before other factions.&lt;br /&gt;
* '''choices''': Empty by default. If non-empty and the faction has '''random_faction=yes''', it is the list of the IDs of the non random factions that will be choosen randomly. If empty, any faction can be chosen.&lt;br /&gt;
* '''except''': Empty by default. If the faction has random_faction=yes, it is the list of the IDs of the non random factions that will not be choosen randomly.&lt;br /&gt;
* '''type''': the unit type of the default leader for the side. This must be present. 'random' is a valid value here and will cause a random leader choice by default. As of 1.16.2 at least this key has no effect and is not required to be present.&lt;br /&gt;
* '''terrain_liked''': a comma separated list of terrains (see [[TerrainCodesWML]]). On random maps, these terrains will determine which keep the side is assigned, attempting to put it near the listed terrains.&lt;br /&gt;
* '''description''': a short description of the faction, displayed in the help browser.&lt;br /&gt;
* '''auto_sort''': {{DevFeature1.19|13}} default 'yes'. If 'no', factions will be displayed in the order written in WML instead of sorted by name. In older versions there are workarounds like https://github.com/wesnoth/wesnoth/issues/3177.&lt;br /&gt;
&lt;br /&gt;
== See Also ==&lt;br /&gt;
&lt;br /&gt;
* [[ReferenceWML]]&lt;br /&gt;
* [[SideWML]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category: WML Reference]]&lt;/div&gt;</summary>
		<author><name>Soliton</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.wesnoth.org/index.php?title=ImageMetadata&amp;diff=74846</id>
		<title>ImageMetadata</title>
		<link rel="alternate" type="text/html" href="https://wiki.wesnoth.org/index.php?title=ImageMetadata&amp;diff=74846"/>
		<updated>2026-02-18T12:36:36Z</updated>

		<summary type="html">&lt;p&gt;Soliton: /* Image Metadata */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Image Metadata ==&lt;br /&gt;
&lt;br /&gt;
Author and [[Wesnoth:Copyrights#The_Battle_for_Wesnoth_-_Visual_and_Audio_Contributions|copyright]] data of Wesnoth images are contained in the image metadata.  For most of Wesnoth's project history, image authorship and copyrights were tracked in a separate text document.  Such a document can still be generated from the metadata, but is not currently (2025) part of the commit process.  There is no expectation that an artist correctly format the metadata, but the individual committing the image to the project files is expected to do so.&lt;br /&gt;
&lt;br /&gt;
A lot of different programs can manipulate metadata, and they all seem to have different ways of doing it.  &lt;br /&gt;
'''Exiftool''' is platform-independent, command-line application that has been the primary toolkit applied to Wesnoth images.  More info can be found at https://www.exiftool.org/index.html&lt;br /&gt;
&lt;br /&gt;
The discussion assumes GIMP (or Krita) is the image editor used, but it is probably equally valid for Adobe Photoshop.  Other editors probably have some metadata support, this is a wiki. &lt;br /&gt;
&lt;br /&gt;
===Basic usage of exiftool===&lt;br /&gt;
&lt;br /&gt;
To view metadata of an image &amp;lt;file&amp;gt; grouped by tag&lt;br /&gt;
    exiftool -g &amp;lt;file&amp;gt;&lt;br /&gt;
'''Note:''' WEBP must contain &amp;quot;Alpha&amp;quot; in RIFF:WebP_Flags or else the transparent background will be lost when EXIF tags are added.  Exiftool is supposed to read but not write this flag (so ''-all='' argument shouldn't clobber it, but sometimes it does).  GIMP will set this flag, but it can get removed by further processing.  Viewing the image metadata with the above command will allow you to check.&lt;br /&gt;
&lt;br /&gt;
To write the needed metadata (Author and Copyright) but remove all the other info injected by image editors (most of which is useful in some context, just not this one), we use ''-all='' to clear the deck.  For small PNG files, thumbnail data can double the file size, and this matters because we have ''a lot'' of these little files.  We can also use ''-overwrite_original'' to prevent a backup file.  Different tag groups have different names for very similar fields, and they often don't match what you see in the image editor dialogs.&lt;br /&gt;
* XMP (dc &amp;quot;Dublin Core&amp;quot;) tags - were briefly used for PNG because they are most likely to be edited with GIMP.  However, this fact was not worth the extra size and complication, so they are no longer used.  Please use the EXIF tags for PNG, just like JPG and WEBP.&lt;br /&gt;
    exiftool -overwrite_original -all= -Date=&amp;quot;&amp;lt;Y:m:d H:M:S&amp;gt;&amp;quot; -Rights=&amp;quot;&amp;lt;copyright&amp;gt;&amp;quot; -Creator=&amp;quot;&amp;lt;name (account name)&amp;gt;&amp;quot; -Description=&amp;quot;&amp;lt;comment&amp;gt;&amp;quot; &amp;lt;target file&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* EXIF - Used for WEBP, JPG and PNG, as Exif data seemed more visible in some file managers.  We could add both XMP and Exif to all images, but that would make the files larger.&lt;br /&gt;
    exiftool -overwrite_original -all= -EXIF:CreateDate=&amp;quot;&amp;lt;Y:m:d H:M:S&amp;gt;&amp;quot; -EXIF:Copyright=&amp;quot;&amp;lt;copyright&amp;gt;&amp;quot; -EXIF:Artist=&amp;quot;&amp;lt;name (account name)&amp;gt;&amp;quot; -EXIF:UserComment=&amp;quot;&amp;lt;comment&amp;gt;&amp;quot; &amp;lt;target file&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Metadata and CI===&lt;br /&gt;
&lt;br /&gt;
====Authorship and Copyright====&lt;br /&gt;
&lt;br /&gt;
To satisfy github continuous integration (CI), image metadata is checked for a small set of entries.&lt;br /&gt;
&lt;br /&gt;
For PNG, JPEG, WEBP:&lt;br /&gt;
* '''EXIF:Artist''' must exist.  The format is &amp;quot;Real Name (screen/account name)&amp;quot; with each person separated by a semicolon (;) and either real name or screen name may be omitted.  More than one &amp;quot;artist&amp;quot; does not imply a collaboration, it may just mean there was a visible edit to the image.&lt;br /&gt;
&lt;br /&gt;
* '''EXIF:Copyright''' must contain &amp;quot;GNU GPL v2+&amp;quot;, &amp;quot;CC BY-SA 4.0&amp;quot;, or &amp;quot;CC0&amp;quot;.  The copyright cannot be changed arbitrarily.&lt;br /&gt;
&lt;br /&gt;
====Optional tags reported in CI====&lt;br /&gt;
(This needs to be fixed, both here and CI.)&lt;br /&gt;
&lt;br /&gt;
===Metadata and Image Editors===&lt;br /&gt;
'''Note:''' Since most of the information below deals with XMP data, it is of limited value.  However, the more relevant EXIF data can often be preserved if editing an existing image, so pay attention to save/export options in whatever editor you use.  The XMP metadata may still be worth saving because information can be transferred from XMP to EXIF.  An example from '''exiftool''' would be the -[+]TAG[+-]&amp;lt;SRCTAG option:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;exiftool '-EXIF:Artist&amp;lt;XMP:Creator' my_image.png&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====GIMP (2.10)====&lt;br /&gt;
''Image-&amp;gt;Metadata-&amp;gt;Edit Metadata''&lt;br /&gt;
*PNG - Can read/write XMP:Creator, XMP:Rights, and XMP:Description under the &amp;quot;Description&amp;quot; tab&lt;br /&gt;
*WEBP - Can read/write XMP:Creator, XMP:Rights, and XMP:Description under the &amp;quot;Description&amp;quot; tab&lt;br /&gt;
*JPEG - Can read IPTC:By-line or EXIF:Artist (IPTC takes precedence), shown under &amp;quot;Description&amp;quot;, exports to XMP and IPTC groups&lt;br /&gt;
&lt;br /&gt;
====Krita (5.1)====&lt;br /&gt;
''Layer-&amp;gt;Edit Metadata...''&lt;br /&gt;
*PNG - Does not always import XMP:Creator or XMP:Rights, but can write to them under &amp;quot;Dublin Core&amp;quot; tab, as well as XMP:Description&lt;br /&gt;
*WEBP - Does not seem to import anything, but can write XMP:Creator and XMP:Rights&lt;br /&gt;
*JPEG - Can import EXIF:Artist and EXIF:Copyright, shown under &amp;quot;Dublin Core&amp;quot; as Creator &amp;amp; Rights, exported under IPTC:By-line and IPTC:Copyright Notice&lt;br /&gt;
&lt;br /&gt;
===Examples===&lt;br /&gt;
A sprite (PNG) with the needed EXIF tags is shown below.&lt;br /&gt;
&lt;br /&gt;
https://forums.wesnoth.org/download/file.php?id=99973&amp;amp;type=.png&lt;br /&gt;
&lt;br /&gt;
Examples of WebP showing the Alpha flag issue can be found at this forum post:&lt;br /&gt;
 &lt;br /&gt;
https://forums.wesnoth.org/viewtopic.php?p=694451#p694451&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
* [[Create]]&lt;br /&gt;
* [[Maintenance_tools]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Development]]&lt;/div&gt;</summary>
		<author><name>Soliton</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.wesnoth.org/index.php?title=EventWML&amp;diff=74801</id>
		<title>EventWML</title>
		<link rel="alternate" type="text/html" href="https://wiki.wesnoth.org/index.php?title=EventWML&amp;diff=74801"/>
		<updated>2026-02-06T21:10:33Z</updated>

		<summary type="html">&lt;p&gt;Soliton: /* turn refresh */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{WML Tags}}&lt;br /&gt;
== The [event] Tag ==&lt;br /&gt;
&lt;br /&gt;
This tag is a subtag of the [scenario], [unit_type] and [era] tags which is used to describe a set of [[ActionWML|actions]] which trigger at a certain point in a scenario. When used in a [scenario] tag (also includes [multiplayer] and [test]), the event only occurs in that scenario. When used in a [unit_type] tag, the event will occur in all scenarios in which a unit of that type appears in (only after such a unit appears during the scenario, however). When used in an [era], the event will occur in any scenario which is played using that era.&lt;br /&gt;
&lt;br /&gt;
This tag has keys and child tags that control when and if the event actions will be triggered. Most important of these is the '''name''' key. Without it, no error will be raised but the event will never fire. Therefore, from a practical standpoint, it can be considered mandatory. All of the others can be used or not and the event actions will fire either way.&lt;br /&gt;
&lt;br /&gt;
'''Lexicon side note:''' ''The word &amp;quot;event&amp;quot; in the [event] tag itself may be considered an abbreviation of the term &amp;quot;event handler&amp;quot; because it is technically not a game &amp;quot;event&amp;quot; but an event '''handler''' for the game events fired with the given 'name'. However, this distinction is usually unimportant in most discussions and the event handlers are therefore simply referred to as &amp;quot;events&amp;quot; in this documentation.''&lt;br /&gt;
&lt;br /&gt;
=== The 'name' Key (Mandatory) ===&lt;br /&gt;
&lt;br /&gt;
Usage:&lt;br /&gt;
&amp;lt;syntaxhighlight lang='wml'&amp;gt;&lt;br /&gt;
name=&amp;lt;value&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This key defines which game event or trigger your [event] tag will be handling. This 'name' key should not be confused with a descriptive comment; it is rather a precise value which must match the predefined game event's name to be valid.&lt;br /&gt;
&lt;br /&gt;
The '''name''' key can accept a list of comma separated values describing when the event will be triggered.*  These values may be either predefined event types or  custom event names not matching any predefined type.&lt;br /&gt;
&lt;br /&gt;
For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang='wml'&amp;gt;&lt;br /&gt;
name=attacker misses,defender misses&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
''* Note that unless you use [[#first_time_only|first_time_only=no]], the event will fire only once, '''not''' once for each listed type.''&lt;br /&gt;
&lt;br /&gt;
All predefined event types are listed below, along with a description of when this value will cause the event to be triggered, in the [[#Predefined_Events_Without_Filters|Predefined Events Without Filters]] and [[#Predefined_Events_With_Filters|Predefined Events With Filters]] sections. Any value ''not'' listed there is a custom event name which can be triggered only by a '''[fire_event]''' tag somewhere else. &lt;br /&gt;
&lt;br /&gt;
Spaces in event names can be interchanged with ''underscores'' (for example, '''name=new turn''' and '''name=new_turn''' are equivalent).&lt;br /&gt;
&lt;br /&gt;
==== Variables in the name ====&lt;br /&gt;
&lt;br /&gt;
If the name contains variables, they will be substituted each time the event is triggered. For example, '''name=turn $disaster_turn''' will only trigger if the turn number is currently equal to whatever number is stored in the variable '''$disaster_turn'''; updating the variable will adjust the turn that the event triggers on. However, if the variable contents contains a comma, it won't be parsed after substitution. Since an event name can't contain a comma, this means the event will never trigger.&lt;br /&gt;
&lt;br /&gt;
{{DevFeature1.17|6}}&lt;br /&gt;
&lt;br /&gt;
Commas resulting from variable substitution are now parsed. If you write '''name=$important_event''' and the variable '''$important_event''' contains the text &amp;quot;capture,die&amp;quot;, the event will trigger on either a death or a village capture.&lt;br /&gt;
&lt;br /&gt;
==== Custom events ====&lt;br /&gt;
&lt;br /&gt;
An event with a custom name may be invoked using the [[InternalActionsWML#.5Bfire_event.5D|[fire_event]]] tag.  Normally you'll use such custom events as named subroutines to be called by events with predefined types.  One common case of this, for example, is that more than one '''sighted''' events might fire the same custom event that changes the scenario objectives. Also, custom events come very handy in [[Wml_optimisation]].&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&amp;lt;syntaxhighlight lang='wml'&amp;gt;&lt;br /&gt;
# The following is the definition of a custom event &amp;quot;unit recruited&amp;quot;&lt;br /&gt;
[event]&lt;br /&gt;
    name=unit_recruited&lt;br /&gt;
    first_time_only=no&lt;br /&gt;
    [message]&lt;br /&gt;
        speaker=unit&lt;br /&gt;
        message=_ &amp;quot;Reporting for duty!&amp;quot;&lt;br /&gt;
    [/message]&lt;br /&gt;
[/event]&lt;br /&gt;
&lt;br /&gt;
# This is a standard recruit event that triggers whenever a unit is recruited by side 1&lt;br /&gt;
[event]&lt;br /&gt;
    name=recruit&lt;br /&gt;
    first_time_only=no&lt;br /&gt;
    [filter]&lt;br /&gt;
    [/filter]&lt;br /&gt;
    [filter_second]&lt;br /&gt;
        side=1&lt;br /&gt;
    [/filter_second]&lt;br /&gt;
&lt;br /&gt;
    # And now a fire_event tag is used to trigger the previously defined event. To use&lt;br /&gt;
    # &amp;quot;speaker=unit&amp;quot; in the fired event, it's also necessary to specify the [primary_unit].&lt;br /&gt;
    [fire_event]&lt;br /&gt;
        name=unit_recruited&lt;br /&gt;
        [primary_unit]&lt;br /&gt;
            id=$unit.id&lt;br /&gt;
        [/primary_unit]&lt;br /&gt;
    [/fire_event]&lt;br /&gt;
 &lt;br /&gt;
    # As a result, every time side 1 recruits a unit, this unit says &amp;quot;Reporting for duty!&amp;quot;&lt;br /&gt;
[/event]&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can have more code after the '''[fire_event]''', which will run after the fired event has happened.&lt;br /&gt;
Example:&lt;br /&gt;
&amp;lt;syntaxhighlight lang='wml'&amp;gt;&lt;br /&gt;
# This is a standard recall event that triggers whenever a unit is recalled by side 1&lt;br /&gt;
[event]&lt;br /&gt;
    name=recall&lt;br /&gt;
    first_time_only=no&lt;br /&gt;
    [filter]&lt;br /&gt;
    [/filter]&lt;br /&gt;
    [filter_second]&lt;br /&gt;
        side=1&lt;br /&gt;
    [/filter_second]&lt;br /&gt;
&lt;br /&gt;
    # Fire the custom event, exactly as the in recruit event&lt;br /&gt;
    [fire_event]&lt;br /&gt;
        name=unit_recruited&lt;br /&gt;
        [primary_unit]&lt;br /&gt;
            id=$unit.id&lt;br /&gt;
        [/primary_unit]&lt;br /&gt;
    [/fire_event]&lt;br /&gt;
 &lt;br /&gt;
    # After that event has happened, the remaining code in this event is run&lt;br /&gt;
    [message]&lt;br /&gt;
        speaker=second_unit&lt;br /&gt;
        message=_ &amp;quot;Glad to have you back&amp;quot;&lt;br /&gt;
    [/message]&lt;br /&gt;
    # As a result, every time side 1 recalls a unit, the recalled unit says&lt;br /&gt;
    # &amp;quot;Reporting for duty!&amp;quot;, and the leader replies &amp;quot;Glad to have you back&amp;quot;&lt;br /&gt;
[/event]&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Optional Keys and Tags ===&lt;br /&gt;
&lt;br /&gt;
These keys and tags are more complex ways to filter when an event should trigger:&lt;br /&gt;
&lt;br /&gt;
==== first_time_only ====&lt;br /&gt;
: Whether the event should be removed from the scenario after it is triggered. This key takes a [[ConditionalActionsWML#Boolean_Values|boolean]]; for example:&lt;br /&gt;
: ''first_time_only=yes''&lt;br /&gt;
:: Default behavior if key is omitted. The event will trigger the first time it can and never again.&lt;br /&gt;
: ''first_time_only=no''&lt;br /&gt;
:: The event will trigger every time the criteria are met instead of only the first time.&lt;br /&gt;
&lt;br /&gt;
==== id ====&lt;br /&gt;
: If an id is specified, then the event will not be added if another event with the same id already exists. An id will also allow the event to be removed, see below. Supplying a non-empty id= is usually desired to avoid duplicates in case same [event] is used in multiple [unit_type] or ability/weapon special.&lt;br /&gt;
&lt;br /&gt;
==== remove ====&lt;br /&gt;
: Removes an event instead of adding a new one. This key takes a [[ConditionalActionsWML#Boolean_Values|boolean]]; if yes, does the same as a [[InternalActionsWML#.5Bremove_event.5D|[remove_event]]] with the same id= value, and the other attributes of this event tag are ignored.&lt;br /&gt;
&lt;br /&gt;
{{DevFeature1.13|0}} May be a comma separated list.&lt;br /&gt;
&lt;br /&gt;
{{DevFeature1.15|7}} Prints a deprecation warning recommending to use [remove_event] instead.&lt;br /&gt;
&lt;br /&gt;
==== priority ====&lt;br /&gt;
: {{DevFeature1.17|20}} If several '[event]' tags have the same name, then any with a high priority value will be triggered before events with a lower priority value. Negative numbers are also supported, to run after events without a priority (as the attribute defaults to zero). For events with equal priority, the order is determined by the order in which the events were added.&lt;br /&gt;
&lt;br /&gt;
==== [filter] ====&lt;br /&gt;
: The event will only trigger if the primary unit matches this filter.&lt;br /&gt;
:* [[StandardUnitFilter]]: selection criteria&lt;br /&gt;
&lt;br /&gt;
==== [filter_second] ====&lt;br /&gt;
: Like [filter], but for the secondary unit.&lt;br /&gt;
:* [[StandardUnitFilter]]: selection criteria&lt;br /&gt;
&lt;br /&gt;
==== [filter_attack] ====&lt;br /&gt;
: Can be used to set additional filtering criteria based on the weapon used by the primary unit. This is usable in the events ''attack'', ''attacker hits'', ''attacker misses'', ''defender hits'', ''defender misses'', ''attack end'', ''last breath'', and ''die''. For more information and filter keys, see [[FilterWML#Filtering Weapons|Filtering Weapons]]. The most commonly used keys are the following.&lt;br /&gt;
:* '''name''': the name of the weapon used.&lt;br /&gt;
:* '''range''': the range of the weapon used.&lt;br /&gt;
:* '''special_id''': filter on the attack's weapon special id.&lt;br /&gt;
:* '''special_type''': filter on the attack's weapon special type.&lt;br /&gt;
:* {{DevFeature1.17|15}} '''special_id_active''': filter on the attack's weapon special id active (encoded in [specials] or [abilities] tags).&lt;br /&gt;
:* {{DevFeature1.17|15}} '''special_type_active''': filter on the attack's weapon special type active (encoded in [specials] or [abilities] tags).&lt;br /&gt;
&lt;br /&gt;
==== [filter_second_attack] ====&lt;br /&gt;
: Like [filter_attack], but for the weapon used by the secondary unit.&lt;br /&gt;
&lt;br /&gt;
==== [filter_condition] ====&lt;br /&gt;
: This tag makes sense inside any sort of event - even those that don't have units, or custom events. The event will only trigger if this condition evaluates to true.&lt;br /&gt;
:* [[ConditionalActionsWML#Condition_Tags|Condition Tags]]&lt;br /&gt;
: note: This tag is meant to be used when the firing of an event shall be based on variables/conditions which cannot be retrieved from the filtered units.&lt;br /&gt;
&lt;br /&gt;
==== [filter_side] ====&lt;br /&gt;
: The current side (usually the side $side_number) must match the passed [[StandardSideFilter]] for the event to fire.&lt;br /&gt;
:* SSF tags and keys as arguments as described in [[StandardSideFilter]].&lt;br /&gt;
: note: This tag makes most sense in side turn and turn refresh events. However, all wml events have a current side so one could also prevent e.g. a moveto event from firing if you put a [filter_side] tag there and the moving unit's side doesn't match.&lt;br /&gt;
&lt;br /&gt;
==== [insert_tag] ====&lt;br /&gt;
: An '''[insert_tag]''' that expands to any of the above filter tags will result in the filter being loaded from the variable each time the game checks if the event should fire. This can result in the event's filter varying from turn to turn.&lt;br /&gt;
&lt;br /&gt;
==== filter_formula ====&lt;br /&gt;
:{{DevFeature1.17|6}}&lt;br /&gt;
: Similar to [filter_condition], but the condition is expressed in [[Wesnoth Formula Language]]. The formula has access to the following keys:&lt;br /&gt;
:*Event information:&lt;br /&gt;
:**'''event''' - the event name&lt;br /&gt;
:**'''event_id''' - the event's unique ID&lt;br /&gt;
:**'''event_data''' - additional information specific to the event, such as owner_side or damage_inflicted, or anything passed in '''[fire_event][data]'''.&lt;br /&gt;
:**'''loc''', '''unit''' - primary event location and unit&lt;br /&gt;
:**'''second_loc''', '''second_unit''' - secondary event location and unit&lt;br /&gt;
:**'''weapon''', '''second_weapon''' - primary and secondary weapon&lt;br /&gt;
:*Gamestate information:&lt;br /&gt;
:**'''turn_number'''&lt;br /&gt;
:**'''time_of_day''' - the time of day ID&lt;br /&gt;
:**'''side_number''' - currently active side&lt;br /&gt;
:**'''sides''' - a list of all sides&lt;br /&gt;
:**'''units''' - a list of all units on the map&lt;br /&gt;
:**'''map''' - the entire game map as a two-dimensional array&lt;br /&gt;
&lt;br /&gt;
==== delayed_variable_substitution ====&lt;br /&gt;
: This key is only relevant inside of a [[#Delayed Variable Substitution_2|nested event]] and controls when variable substitution will occur in those special case actions.&lt;br /&gt;
&lt;br /&gt;
=== Actions triggered by [event] ===&lt;br /&gt;
&lt;br /&gt;
After the trigger conditions have been met, all [[ActionWML|action tags]] within the [event] tag are executed in the order they are written in.&lt;br /&gt;
&lt;br /&gt;
There are 3 main types of actions:&lt;br /&gt;
* direct actions ([[DirectActionsWML]]) which have a direct effect on gameplay&lt;br /&gt;
* display actions ([[InterfaceActionsWML]]) which show something to the user&lt;br /&gt;
* internal actions ([[InternalActionsWML]]) which are used by WML internally&lt;br /&gt;
&lt;br /&gt;
More details in [[ActionWML]]. Actions can also be dynamically inserted via '''[insert_tag]'''.&lt;br /&gt;
&lt;br /&gt;
Several actions use standard filters to find out which units&lt;br /&gt;
to execute the command on.  These are denoted by the phrases&lt;br /&gt;
&amp;quot;standard unit filter&amp;quot; and &amp;quot;standard location filter&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
=== Nested Events ===&lt;br /&gt;
&lt;br /&gt;
There is one special type of action: event creation.  By placing an '''[event]''' tag inside another '''[event]''' tag, the nested event is spawned (created) when the parent (outer) event is encountered (when executing the contents of the parent event). Once created, there is no relation between the nested event and the parent event (for example, removing the parent event would not remove the nested event).&lt;br /&gt;
&lt;br /&gt;
([[#Nested Event Example|See Examples]])&lt;br /&gt;
&lt;br /&gt;
==== Delayed Variable Substitution ====&lt;br /&gt;
&lt;br /&gt;
Variable substitution for a nested event can happen either when it is spawned by the parent event or when it is triggered itself. This is controlled with the key '''delayed_variable_substitution''' which is used in the nested event.&lt;br /&gt;
&lt;br /&gt;
If this key is set to ''yes'', the variables in the nested event will contain values from the turn in which the ''nested'' event was triggered. ''This is the default behavior if the key is omitted.'' If set to ''no'', the variables in the nested event are set at the time the ''parent'' event is triggered.&lt;br /&gt;
&lt;br /&gt;
This behavior can be fine tuned with a special syntax when referencing variables. Instead of the normal '''$variable''' syntax, use '''$|variable''' to cause a variable to contain values relevant to the turn in which the nested event was triggered even when '''delayed_variable_substitution''' is set to ''no''. In this way you can have a mix of variables relevant to the parent and nested event trigger times.&lt;br /&gt;
&lt;br /&gt;
([[#Delayed Variable Substitution Example|See Examples]])&lt;br /&gt;
&lt;br /&gt;
== Multiplayer safety ==&lt;br /&gt;
&lt;br /&gt;
In multiplayer it is only safe to use WML that might require synchronization with other players because of input or random numbers (like [message] with input or options or [unstore_unit] where a unit might advance) in the following events. This is because in these cases WML needs data from other players to work right and/or do the same thing for all players. This data is only available after a network synchronization.&lt;br /&gt;
&lt;br /&gt;
List of synchronized events:&lt;br /&gt;
* moveto&lt;br /&gt;
* enter hex&lt;br /&gt;
* exit hex&lt;br /&gt;
* sighted&lt;br /&gt;
* last breath &lt;br /&gt;
* menu item X&lt;br /&gt;
* die&lt;br /&gt;
* capture &lt;br /&gt;
* recruit&lt;br /&gt;
* prerecruit &lt;br /&gt;
* recall &lt;br /&gt;
* prerecall &lt;br /&gt;
* advance&lt;br /&gt;
* pre advance&lt;br /&gt;
* post advance &lt;br /&gt;
* attack&lt;br /&gt;
* attack end &lt;br /&gt;
* attacker hits &lt;br /&gt;
* attacker misses &lt;br /&gt;
* defender hits&lt;br /&gt;
* defender misses &lt;br /&gt;
* unit hits&lt;br /&gt;
* unit misses&lt;br /&gt;
* start&lt;br /&gt;
* prestart (prestart are synced but [message][option] &amp;amp; [unstore_unit] advancement choices will do a random decision because UI things don't work during prestart events.)&lt;br /&gt;
* new turn &lt;br /&gt;
* side turn &lt;br /&gt;
* turn X &lt;br /&gt;
* side X turn &lt;br /&gt;
* side X turn Y &lt;br /&gt;
* turn refresh&lt;br /&gt;
* side turn end&lt;br /&gt;
* side X turn end&lt;br /&gt;
* side turn X end&lt;br /&gt;
* side X turn Y end&lt;br /&gt;
* turn end&lt;br /&gt;
* turn X end&lt;br /&gt;
* {{DevFeature1.13|0}} enemies defeated&lt;br /&gt;
* {{DevFeature1.13|0}} time over&lt;br /&gt;
* {{DevFeature1.13|10}} victory&lt;br /&gt;
* {{DevFeature1.13|10}} defeat&lt;br /&gt;
* {{DevFeature1.13|0}} scenario_end&lt;br /&gt;
The following are &amp;lt;b&amp;gt;not&amp;lt;/b&amp;gt; synced:&lt;br /&gt;
* select&lt;br /&gt;
* preload&lt;br /&gt;
* victory {{DevFeature1.13|10}} local_victory&lt;br /&gt;
* defeat {{DevFeature1.13|10}} local_defeat&lt;br /&gt;
* ai turn&lt;br /&gt;
&lt;br /&gt;
If an event is not listed here, ask someone to be sure.&lt;br /&gt;
&lt;br /&gt;
There is also the possibility of events that are normally synchronized when fired by the engine but can be non-synchronized when fired by WML tags from non-synchronized event. So when you are using them you must be extra careful. For example [unstore_unit] may trigger a unit advancement that will fire ''advance'' and ''post advance'' events.&lt;br /&gt;
&lt;br /&gt;
== A Trap for the Unwary ==&lt;br /&gt;
&lt;br /&gt;
You need to beware of using macros to generate events. If you include a macro expanding to an event definition twice, the event will be executed twice (not once) each time the trigger condition fires. Consider this code:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang='wml'&amp;gt;&lt;br /&gt;
#define DOUBLE&lt;br /&gt;
    [event]&lt;br /&gt;
        name=multiply_by_2&lt;br /&gt;
        {VARIABLE_OP 2_becomes_4 multiply 2}&lt;br /&gt;
    [/event]&lt;br /&gt;
#enddef&lt;br /&gt;
&lt;br /&gt;
{DOUBLE}&lt;br /&gt;
{DOUBLE}&lt;br /&gt;
&lt;br /&gt;
{VARIABLE 2_becomes_4 2}&lt;br /&gt;
		&lt;br /&gt;
[fire_event]&lt;br /&gt;
    name=multiply_by_2&lt;br /&gt;
[/fire_event]&lt;br /&gt;
 &lt;br /&gt;
{DEBUG_MSG &amp;quot;$2_becomes_4 should be 4&amp;quot;}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After it executes, the debug message will reveal that the variable has been set to 8, not 4.&lt;br /&gt;
&lt;br /&gt;
=== Event IDs ===&lt;br /&gt;
&lt;br /&gt;
This problem can be avoided by setting an '''id''' on the event, i.e.:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang='wml'&amp;gt;&lt;br /&gt;
#define DOUBLE&lt;br /&gt;
    [event]&lt;br /&gt;
        name=multiply_by_2&lt;br /&gt;
        id=doubler_event&lt;br /&gt;
        {VARIABLE_OP 2_becomes_4 multiply 2}&lt;br /&gt;
    [/event]&lt;br /&gt;
#enddef&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Events with the same ID will only be accepted once by the engine no matter how many times they are included, and will only be saved once to the scenario's savefile.  Events with an ID can also be removed by using the '''remove''' key, i.e.:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang='wml'&amp;gt;&lt;br /&gt;
[event]&lt;br /&gt;
    id=doubler_event&lt;br /&gt;
    remove=yes&lt;br /&gt;
[/event]&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After that WML is encountered (at toplevel or after created from another event), the event with this ID is removed from the scenario wml, thus firing it has no effect.  After an event is removed, it can still be re-added later.&lt;br /&gt;
&lt;br /&gt;
== Predefined Events Without Filters ==&lt;br /&gt;
&lt;br /&gt;
These events do not take filter parameters (except [filter_condition] which works for all events).&lt;br /&gt;
&lt;br /&gt;
=== preload ===&lt;br /&gt;
&lt;br /&gt;
Triggers before a scenario 'prestarts' and when loading a savegame -- before anything is shown on the screen at all. Can be used to set up the [[LuaWML|Lua]] environment: loading libraries, defining helper functions, etc.&lt;br /&gt;
&lt;br /&gt;
'''Note:''' If a game is started, saved, and then reloaded, the preload event will fire two times while playing.  However, it will only fire once when viewing the replay. If the preload event alters the gamestate the second time it fired while playing (when loading the saved game) then it can result in Out Of Sync errors.&lt;br /&gt;
&lt;br /&gt;
'''Note:''' Unlike prestart and start, the preload event '''must be able to fire more than once!''' This is because it is triggered each time a savegame is loaded in addition to the initial time when it loads before the scenario 'prestart'. This means that it is effectively ''mandatory'' to have the [[#first_time_only|first_time_only=no]] key value in a preload event.&lt;br /&gt;
&lt;br /&gt;
=== prestart ===&lt;br /&gt;
&lt;br /&gt;
Triggers before a scenario 'starts' -- before anything is shown on the screen at all. Can be used to set up things like village ownership. For things displayed on-screen such as character dialog, use '''start''' instead.&lt;br /&gt;
&lt;br /&gt;
'''Note:''' ''This value makes the [[#first_time_only|first_time_only]] key irrelevant since, by definition, it can only fire once.''&lt;br /&gt;
&lt;br /&gt;
=== start ===&lt;br /&gt;
&lt;br /&gt;
Triggers after the map is shown but before the scenario begins -- before players can 'do' anything.&lt;br /&gt;
&lt;br /&gt;
'''Note:''' ''This value makes the [[#first_time_only|first_time_only]] key irrelevant since, by definition, it can only fire once.''&lt;br /&gt;
&lt;br /&gt;
=== new turn ===&lt;br /&gt;
&lt;br /&gt;
Triggers at the start of every turn (not side turn). See also [[#first_time_only|first_time_only=no]]. Before any events of this type trigger, the value of the WML variable '''turn_number''' is set to the number of the turn that is beginning.&lt;br /&gt;
&lt;br /&gt;
=== turn end ===&lt;br /&gt;
&lt;br /&gt;
Triggers at the end of every turn (not side turn). See also [[#first_time_only|first_time_only=no]]. The WML variable '''side_number''' will contain the side that ended their turn.&lt;br /&gt;
&lt;br /&gt;
=== turn ''X'' end ===&lt;br /&gt;
&lt;br /&gt;
Triggers at the end of turn ''X''.&lt;br /&gt;
&lt;br /&gt;
=== side turn ===&lt;br /&gt;
&lt;br /&gt;
Triggers when a side is about to start its turn. Before events of this type trigger, the value of the WML variable '''side_number''' is set to the number of the side of the player about to take their turn. This is before any healing takes place for that side, before calculating income, and before restoring unit movement and status.&lt;br /&gt;
&lt;br /&gt;
=== ai turn ===&lt;br /&gt;
&lt;br /&gt;
Triggered just before the AI is invoked for a side. This is called after ''side turn'', and thus the WML variable '''side_number''' still holds the number of this side. Note that this event might be called several times per turn in case that fallbacks to human or droiding is involved. I.e. it happens at the middle of turn of human side 1 if the human player droids his side. It happens after the selection of ai to play the turn but before AI is told that new turn has come.&lt;br /&gt;
&lt;br /&gt;
'''Note:'''  ''This event can break replays if it is used improperly. The ai turn event does not fire during replays. The intention is only to guide the AI to make choices (movements, attacks) which are then saved to the replay.''&lt;br /&gt;
&lt;br /&gt;
=== turn refresh ===&lt;br /&gt;
&lt;br /&gt;
Like '''side turn''', triggers just before a side is taking control but '''after''' healing, calculating income, and restoring unit movement and status. WML variable '''side_number''' holds the number of this side.&lt;br /&gt;
&lt;br /&gt;
Note that the turn refresh event does occur on turn 1, even though healing (for side 1), income and unit refreshing do not.&lt;br /&gt;
&lt;br /&gt;
=== turn ''X'' ===&lt;br /&gt;
&lt;br /&gt;
Triggers at the start of turn ''X''. It's the first side initialization event. &lt;br /&gt;
&lt;br /&gt;
Side initialization events go in the order of: &lt;br /&gt;
&lt;br /&gt;
# '''turn ''X''''' &lt;br /&gt;
# '''new turn''' &lt;br /&gt;
# '''side turn''' &lt;br /&gt;
# '''side ''X'' turn''' &lt;br /&gt;
# '''side turn ''X''''' &lt;br /&gt;
# '''side ''X'' turn ''Y''''' &lt;br /&gt;
# '''turn refresh''' &lt;br /&gt;
# '''side ''X'' turn refresh''' &lt;br /&gt;
# '''turn ''X'' refresh''' &lt;br /&gt;
# '''side ''X'' turn ''Y'' refresh'''&lt;br /&gt;
&lt;br /&gt;
=== side ''X'' turn ''Y'' ===&lt;br /&gt;
&lt;br /&gt;
This event triggers at the start of turn ''Y'' of side X &lt;br /&gt;
&lt;br /&gt;
=== side ''X'' turn ===&lt;br /&gt;
&lt;br /&gt;
This event triggers at the start of any turn of side X&lt;br /&gt;
&lt;br /&gt;
'''Note:''' ''Of course, [[#first_time_only|first_time_only=no]] is needed for this event to be triggered more than once.''&lt;br /&gt;
&lt;br /&gt;
=== side turn ''X'' ===&lt;br /&gt;
&lt;br /&gt;
This event triggers at the start of any side on turn X&lt;br /&gt;
&lt;br /&gt;
'''Note:''' ''Of course, [[#first_time_only|first_time_only=no]] is needed for this event to be triggered more than once.''&lt;br /&gt;
&lt;br /&gt;
=== side X turn Y refresh ===&lt;br /&gt;
&lt;br /&gt;
This event triggers at the turn refresh for side X on turn Y&lt;br /&gt;
&lt;br /&gt;
=== side ''X'' turn refresh ===&lt;br /&gt;
&lt;br /&gt;
This event triggers at the turn refresh for side X&lt;br /&gt;
&lt;br /&gt;
'''Note:''' ''Of course, [[#first_time_only|first_time_only=no]] is needed for this event to be triggered more than once.''&lt;br /&gt;
&lt;br /&gt;
=== turn ''X'' refresh ===&lt;br /&gt;
&lt;br /&gt;
This event triggers for any side at the refresh of turn X.&lt;br /&gt;
&lt;br /&gt;
'''Note:''' ''Of course, [[#first_time_only|first_time_only=no]] is needed for this event to be triggered more than once.''&lt;br /&gt;
&lt;br /&gt;
=== side turn end ===&lt;br /&gt;
&lt;br /&gt;
Triggers after a side ends its turn. Like side turn, there are also some variations for specific combinations of side number and turn number. Here is the order in which the turn end events trigger:&lt;br /&gt;
&lt;br /&gt;
# '''side turn end''' &lt;br /&gt;
# '''side ''X'' turn end''' &lt;br /&gt;
# '''side turn ''X'' end''' &lt;br /&gt;
# '''side ''X'' turn ''Y'' end''' &lt;br /&gt;
# '''turn end''' &lt;br /&gt;
# '''turn ''X'' end''' &lt;br /&gt;
&lt;br /&gt;
=== time over ===&lt;br /&gt;
&lt;br /&gt;
Triggers on turn ''turns''. (''turns'' is specified in [scenario])&lt;br /&gt;
&lt;br /&gt;
=== enemies defeated ===&lt;br /&gt;
&lt;br /&gt;
Triggers when all sides that are not defeated are allied and if there is at least one human (or human networked) side among them. Especially this event triggers in a situaltion that would normaly cause a victory due to enemies defeated. (regardless of whether this was disabled with victory_when_enemies_defeated=no). &lt;br /&gt;
&lt;br /&gt;
=== local_victory ===&lt;br /&gt;
&lt;br /&gt;
In Wesnoth 1.12 and earlier, the event described here is '''victory''', {{DevFeature1.13|10}} in 1.14 the event described here is '''local_victory'''.&lt;br /&gt;
&lt;br /&gt;
This event will be fired at the end of a scenario, if the player's side won. If it fires as a result of an '''[endlevel]''' tag, the event is processed before the line after the '''[endlevel]]''' tag. The event is not synchronized, as in networked mp it is possible to have different results for different players.&lt;br /&gt;
&lt;br /&gt;
=== local_defeat ===&lt;br /&gt;
&lt;br /&gt;
In Wesnoth 1.12 are earlier, the event described here is '''defeat''', {{DevFeature1.13|10}} in 1.14 the event described here is '''local_defeat'''.&lt;br /&gt;
&lt;br /&gt;
Functions identically to '''local_victory''', except that the player's side lost.&lt;br /&gt;
&lt;br /&gt;
=== victory ===&lt;br /&gt;
&lt;br /&gt;
This section describes a new event Wesnoth 1.14. In 1.12 and earlier, the '''victory''' event is equivalent to 1.14's '''local_victory'''.&lt;br /&gt;
&lt;br /&gt;
This event will be fired at the end of a scenario, if the game will proceed to the next scenario. In multiplayer, this means that it will fire on all players' clients, even for players who received a '''local_defeat''', as long as the game continues to the next scenario. This event is synchronized.&lt;br /&gt;
&lt;br /&gt;
It helps debugging if the victory event allows you to safely advance to any of the possible next maps after using the &amp;quot;:next_level&amp;quot; command. Scenarios where key units are picked up before the victory, or where some action chosen earlier determines which map to advance to, make it hard to quickly test scenarios in a campaign.&lt;br /&gt;
&lt;br /&gt;
=== defeat ===&lt;br /&gt;
&lt;br /&gt;
This section describes a new event Wesnoth 1.14. In 1.12 and earlier, the '''defeat''' event is equivalent to 1.14's '''local_defeat'''.&lt;br /&gt;
&lt;br /&gt;
This event will be fired at the end of a scenario, if the game resulted in a game-over other than victoriously reaching the end of a campaign (including single-scenario campaigns). Synchronization (including bug #4667) is the same as '''victory'''.&lt;br /&gt;
&lt;br /&gt;
=== scenario_end ===&lt;br /&gt;
&lt;br /&gt;
{{DevFeature1.13|10}} This event fires immediately after '''victory''' or '''defeat'''; it is synchronized, but is also affected by bug #4667.&lt;br /&gt;
&lt;br /&gt;
Note: in 1.13.0 - 1.13.9 this event was added as a synchronized alternative to the events that are, since 1.13.10, called local_victory or local_defeat.&lt;br /&gt;
&lt;br /&gt;
== Predefined Events With Filters ==&lt;br /&gt;
&lt;br /&gt;
Filters (except [filter_condition] which is for all sorts of events) can be applied to the following event triggers (see [[FilterWML]]; see also below). The actions specified in the event tag will be executed only if the filter returns true. &lt;br /&gt;
These event triggers are all actions by units ('''moveto''', '''attack''') or things that happen to units ('''recruit''', '''advance'''). When one of these events is triggered, the position of the active unit (referred to as the '''primary unit''') is stored in the variables '''x1''' and '''y1''' and the position of any unit that primary unit does something to is stored in the variables '''x2''' and '''y2''' (this unit is referred to as the '''secondary unit''' below). '' These units are also automatically stored in the variables '''unit''' and '''second_unit''' as if they had been stored using the '''[store_unit]''' tag. see [[SingleUnitWML]]. weapon and second_weapon variables are available inside attack, attacker_hits, defender_hits, unit_hits, die and last_breath events. See [[VariablesWML#Automatically_Stored_Variables|automatically stored variables]] for more information.&lt;br /&gt;
&lt;br /&gt;
=== moveto ===&lt;br /&gt;
&lt;br /&gt;
Triggers after the primary unit moves. Typically this is used when the primary unit gets to a particular location and a filter for the location of the primary unit is included; remember that this is the location that the primary unit lands on, not the location it started on or any location it travels on. If the unit moves to a village, the capture event will be fired before this event. &amp;lt;br /&amp;gt;''An '''[allow_undo]''' tag anywhere within a moveto event will cancel any lack of undo functionality the event would have caused. Note that undo functionality will only move the unit back to its former location; it will not undo other changes to the game caused by the event. Thus it is up to the scenario designer to use this tag correctly.'' $x2 and $y2 refer to the hex the unit came from.&lt;br /&gt;
&lt;br /&gt;
=== sighted ===&lt;br /&gt;
&lt;br /&gt;
A '''sighted''' event is triggered by a unit becoming visible to a side (other than the unit's own side). This is mostly useful when the side seeing the unit uses [[fog of war]] or [[shroud]], but they still fire even when fog/shroud is not in use, and they do take into account the {{tag2|AbilitiesWML#The_.5Babilities.5D_tag|hides}} ability (for a moving unit and for ambushers). The ''primary unit'' is the unit that became visible, and the ''secondary unit'' belongs to the side that now sees the primary unit. In some cases, sighted events can be delayed from when they &amp;quot;should&amp;quot; occur. If that happens, the secondary unit will be filtered as if it was at the location where the event &amp;quot;should&amp;quot; have occurred, and ''x2,y2'' will store that location (not the current position of the secondary unit). To understand when sighted events fire, it is helpful to distinguish the times the acting unit sights other units from the times when the acting unit is sighted.&lt;br /&gt;
&lt;br /&gt;
An acting unit can sight other units when it is recruited, recalled, leveled, or moved, and when fog or shroud is cleared from occupied hexes as a result. In these cases, the acting unit is always the ''secondary unit''. For the first three actions, there are two events associated with the action; clearing occurs between these events, but any sighted events are fired after the second event. (For example, when a unit is recruited, the ''prerecruit'' event fires, then fog is cleared, then the ''recruit'' event fires, then ''sighted'' events fire.) For movement, the sighted events fire between ''enter_hex'' and ''exit_hex'' events, but sometimes sighted events are postponed until the moving unit reaches a good place to stop (e.g. not in an occupied hex). As a major exception to the above, players have the option to delay shroud (and fog) updates. If the player delays shroud updates, sighted events are also delayed until the shroud is updated.&lt;br /&gt;
&lt;br /&gt;
An acting unit can be sighted by other sides when it is recruited, recalled, leveled (in rare cases), or moved. In these cases, the acting unit is always the ''primary unit''. These events fire after sightings by the acting unit (unless the player delayed shroud updates). For the first two, the sighted event fires for all sides that can see the unit, other than the unit's own side (even if those sides use neither fog nor shroud). For leveling units, sides that could see the unit before it leveled are excluded. (This is why these events are rare &amp;amp;ndash; the leveling unit must have lost a [hides] ability as a result of leveling in order to be seen after, but not before, leveling.) For movement, a sighted event is fired for each side that could see the unit after movement, but not before. In particular, only the starting and ending hexes are considered; a unit that moves through seen hexes but ends movement in a fogged hex does not trigger a sighted event for itself. In all cases where the acting unit is sighted, a (single) ''secondary unit'' is chosen from the sighting team. This choice should be considered arbitrary, but units within their sight range of the acting unit are chosen in preference to units further away. You may want to use [filter_second] in order to restrict a sighted event in a single player scenario to only being triggered by the player and not by other non-allied sides.&lt;br /&gt;
&lt;br /&gt;
Sighted events are not triggered by a ''hides'' ability becoming inactive, unless it becomes inactive due to that unit's movement or to that unit ambushing another. (To detect a ''nightstalk'' ability becoming inactive due to time of day, use a ''new_turn'' event. Custom ''hides'' abilities might need similar handling.)&lt;br /&gt;
&lt;br /&gt;
Sighted events have some special caveats for WML authors. First and foremost, {{tag|DirectActionsWML|allow_undo}} should generally be avoided in sighted events. It can be used if current unit positions have no bearing on the event, but otherwise it could cause a replay to go out of sync if a player delays shroud updates and undoes a move. This should not be an onerous restriction, though, as clearing fog will block the ability to undo, regardless of what happens within an event. Secondly, it is currently possible for WML to kill a unit involved in a sighted event before that event fires. If that happens, filters on the killed unit will not match anything and the event may seem to have not fired.&lt;br /&gt;
&lt;br /&gt;
=== enter_hex ===&lt;br /&gt;
&lt;br /&gt;
Triggers for each hex entered during movement, with $x1,$y1 identifying the hex entered and $x2,$y2 identifying the previous hex (just exited). In Wesnoth 1.12, the movement will be interrupted, stopping the unit where it is; this behavior can be avoided by using the {{tag|DirectActionsWML|allow_undo}} tag or `NO_INTERRUPT_NO_UNDO` macro. {{DevFeature1.13|11}} movement is not interrupted unless the {{tag|DirectActionsWML|cancel_action}} tag is used.&lt;br /&gt;
&lt;br /&gt;
'''Note:''' This event behaves a bit unusually if the hex is occupied (and the moving unit is simply passing through). When this happens, $x1,$y1 is still the hex where the event was triggered, but the moving unit (stored in $unit) will be located somewhere earlier in the route (the most recent unoccupied hex). That is, $x1,$y1 will not equal $unit.x,$unit.y (a condition that can be used to detect when the entered hex is occupied). The moving unit will have already spent its movement points to enter the event's hex even though it is has not actually moved from the most recent unoccupied hex.&lt;br /&gt;
&lt;br /&gt;
'''Note:''' At the time of writing (7ca5a0df, just before 1.13.11), if the hex is occupied then $unit contains the occupying unit, not the moving unit.&lt;br /&gt;
&lt;br /&gt;
'''Note:''' At the time of writing (1.16.2), if the hex is occupied then $unit does contain the moving unit.&lt;br /&gt;
&lt;br /&gt;
=== exit_hex ===&lt;br /&gt;
&lt;br /&gt;
Triggers for each hex exited during movement, with $x1,$y1 identifying the hex exited and $x2,$y2 identifying the next hex (to be entered). If this event is handled without using {{tag|DirectActionsWML|allow_undo}}, then movement is interrupted, stopping the unit where it is. {{DevFeature1.13|11}} movement is not interrupted unless the {{tag|DirectActionsWML|cancel_action}} tag is used.&lt;br /&gt;
&lt;br /&gt;
'''Note:''' This event behaves a bit unusually if the hex is occupied (and the moving unit is simply passing through). When this happens, $x1,$y1 is still the hex where the event was triggered, but the moving unit (stored in $unit) will be located somewhere earlier in the route (the most recent unoccupied hex). That is, $x1,$y1 will not equal $unit.x,$unit.y (a condition that can be used to detect when the exited hex is occupied). The moving unit will have already spent its movement points to enter the event's hex even though it is has not actually moved from the most recent unoccupied hex.&lt;br /&gt;
&lt;br /&gt;
=== pre attack {{DevFeature1.17|7}}===&lt;br /&gt;
&lt;br /&gt;
Similar to '''attack''', but is triggered before calculating the number of attacks and the movement of the unit. Can be used for modifications, which affect these values.&lt;br /&gt;
&lt;br /&gt;
=== attack ===&lt;br /&gt;
&lt;br /&gt;
Triggers when the primary unit attacks the secondary unit. Variables $weapon and $second_weapon contain weapons used for this attack by primary and secondary units respectively for all attack-related events (attack_end, attacker_hits, attacker_misses, defender_hits, defender_misses, die and last_breath).&lt;br /&gt;
&lt;br /&gt;
=== attack end ===&lt;br /&gt;
&lt;br /&gt;
Similar to '''attack''', but is triggered ''after'' the fight instead of before. Note that if either unit is killed during the fight, this event triggers before any '''die''' events.&lt;br /&gt;
&lt;br /&gt;
=== attacker hits ===&lt;br /&gt;
&lt;br /&gt;
Triggers when the the primary unit (the attacker) hits the secondary unit (the defender). The value of the WML variable '''damage_inflicted''' is set to the number of hitpoints inflicted by the attacker.&lt;br /&gt;
&lt;br /&gt;
=== attacker misses ===&lt;br /&gt;
&lt;br /&gt;
Same as ''attacker hits'', but is triggered when the attacker misses.&lt;br /&gt;
&lt;br /&gt;
=== defender hits ===&lt;br /&gt;
&lt;br /&gt;
Triggers when the primary unit (the attacker) is hit in retaliation by the secondary unit (the defender). The value of the WML variable '''damage_inflicted''' is set to the number of hitpoints inflicted by the defender.&lt;br /&gt;
&lt;br /&gt;
=== defender misses ===&lt;br /&gt;
&lt;br /&gt;
Same as ''defender hits'', but is triggered when the defender misses.&lt;br /&gt;
&lt;br /&gt;
=== unit hits {{DevFeature1.19|2}} ===&lt;br /&gt;
&lt;br /&gt;
Triggers when the the primary unit (either attacker or defender) hits the secondary unit (the other). The value of the WML variable '''damage_inflicted''' is set to the number of hitpoints inflicted by the primary unit.&lt;br /&gt;
&lt;br /&gt;
Compared to ''defender hits'', primary and secondary units are swapped. &lt;br /&gt;
&lt;br /&gt;
=== unit misses {{DevFeature1.19|2}} ===&lt;br /&gt;
&lt;br /&gt;
Same as ''unit hits'', but is triggered when the unit misses.&lt;br /&gt;
&lt;br /&gt;
=== petrified ===&lt;br /&gt;
Triggers when the primary unit is hit by an attack with the 'petrifies' ability (See ''petrifies'', [[AbilitiesWML]]) by the secondary unit (the unit with the 'petrifies' ability).&lt;br /&gt;
&lt;br /&gt;
=== last breath ===&lt;br /&gt;
&lt;br /&gt;
Triggers when the primary unit is killed by the secondary unit, but before the death animation is triggered. Use this instead of name=die when you want the primary unit to make a final [message]. &lt;br /&gt;
&lt;br /&gt;
=== die ===&lt;br /&gt;
&lt;br /&gt;
Triggers when the primary unit is killed by the secondary unit. ''Note: The primary unit is not removed from the game until the end of this event. The primary unit can still be manipulated, will block other units from taking its hex, and will still be found by standard unit filters (except [have_unit]). To prevent this behavior, you can use [kill] to remove the unit immediately. However, this will stop any (still unfired) other events that also match the unit from firing afterwards, so use with caution.'' If you want the primary unit to make a final [message], use name=last_breath, see above.&lt;br /&gt;
&lt;br /&gt;
=== capture ===&lt;br /&gt;
&lt;br /&gt;
Triggers when the primary unit captures a village. The village may have been previously neutral, or previously owned by another side; merely moving into your own villages does not constitute a capture. This event will be fired before the moveto event. Villages becoming neutral (via [capture_village]) do not fire capture events. The variable $owner_side contains the previous owner side of the village. 0 means neutral.&lt;br /&gt;
&lt;br /&gt;
=== recruit ===&lt;br /&gt;
&lt;br /&gt;
Triggers when the primary unit is recruited (by the secondary unit). (That is, when a unit is recruited it will trigger this event and this event's filter will filter that unit.).&lt;br /&gt;
&lt;br /&gt;
=== prerecruit ===&lt;br /&gt;
&lt;br /&gt;
Triggers when the primary unit is recruited (by the secondary unit) but before it is displayed.&lt;br /&gt;
&lt;br /&gt;
=== recall ===&lt;br /&gt;
&lt;br /&gt;
Triggers after the primary unit is recalled (by the secondary unit).&lt;br /&gt;
&lt;br /&gt;
=== prerecall ===&lt;br /&gt;
&lt;br /&gt;
Triggers when the primary unit is recalled (by the secondary unit) but before it is displayed.&lt;br /&gt;
&lt;br /&gt;
=== advance ===&lt;br /&gt;
&lt;br /&gt;
Triggers just before the primary unit is going to advance to another unit, or advance by AMLA. (This is after the player selects which advancement, if there is a choice). If this event removes the unit, changes the unit's type, or reduces the unit's experience below what it needs to advance, then the advancement is aborted. This also applies to advancement by AMLA.&lt;br /&gt;
&lt;br /&gt;
=== pre advance ===&lt;br /&gt;
&lt;br /&gt;
{{DevFeature1.13|0}} Triggers before the unit advancement dialog is shown. If this event removes the unit or reduces the unit's experience below what it needs to advance, then the advancement is aborted.&lt;br /&gt;
&lt;br /&gt;
Care needs to be taken when tags that may trigger advancement themselves are used in this event. For example '''[transform_unit]''', '''[unstore_unit]''', '''[modify_unit]''' etc.&lt;br /&gt;
&lt;br /&gt;
=== post advance ===&lt;br /&gt;
&lt;br /&gt;
Triggers just after the primary unit has advanced to another unit, or advance by AMLA.&lt;br /&gt;
&lt;br /&gt;
=== select ===&lt;br /&gt;
&lt;br /&gt;
Triggers when the primary unit is selected. Prior to version 1.11, this also triggered when a move was interrupted, as the game keeps the moving unit selected by selecting it again at the end of movement. ''Note: in networked multiplayer, these events are only executed by the client on which the event is triggered, leading to out of sync errors if you modify the game state in the event.''&lt;br /&gt;
&lt;br /&gt;
=== menu item ''X'' ===&lt;br /&gt;
&lt;br /&gt;
Triggers when a WML menu item with id=''X'' is selected. ''Note: if the menu item has a [command], this event may be executed before or after the command; there is no guarantee.''&lt;br /&gt;
&lt;br /&gt;
=== unit placed {{DevFeature1.13|3}}===&lt;br /&gt;
&lt;br /&gt;
Triggers when the primary unit is placed on the map, regardless of method. This includes but might not be limited to:&lt;br /&gt;
* Leaders and units placed in side definitions (fired once for every unit right before prestart events)&lt;br /&gt;
* Recruited and recalled units&lt;br /&gt;
* Units placed on the map with the [unit] tag ('''not''' units created directly onto a recall list or variable)&lt;br /&gt;
* Units placed by the wesnoth.put_unit() Lua function&lt;br /&gt;
* Units placed by :to_map in Lua (which is a shortcut for the above)&lt;br /&gt;
* Units created via debug mode&lt;br /&gt;
* Units created by plague &lt;br /&gt;
* Every use of [unstore_unit], when ''fire_event'' is set to ''yes'' (default is ''no'')&lt;br /&gt;
* Units moved on map with [move_unit] before {{DevFeature1.15|8}}&lt;br /&gt;
* Units matching the filter of [petrify], [unpetrify] or [harm_unit] before {{DevFeature1.15|8}}&lt;br /&gt;
* Units who receive a bonus from the feeding ability every time except the first, before {{DevFeature1.15|8}}&lt;br /&gt;
This event is solely intended for special cases where no other event types suffice, for example if you must immediately apply a modification to every unit that ever appears. The event does '''not''' keep track of which units it has previously fired for, but can fire an unlimited number of times for the same unit as long the unit is &amp;quot;placed&amp;quot; several times and the event filter doesn't prevent it.&lt;br /&gt;
&lt;br /&gt;
== Miscellaneous Notes and Examples ==&lt;br /&gt;
&lt;br /&gt;
=== Primary/Secondary Unit Speaker Example ===&lt;br /&gt;
&lt;br /&gt;
In events, the primary unit can be referred to as '''unit''' and the secondary unit can be referred to as '''second_unit''' in [message] tags using the '''speaker''' key. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang='wml'&amp;gt;&lt;br /&gt;
[event]&lt;br /&gt;
    name=last breath&lt;br /&gt;
    [message]&lt;br /&gt;
        speaker=second_unit&lt;br /&gt;
        message= _ &amp;quot;Hahaha! I finally killed you!&amp;quot;&lt;br /&gt;
    [/message]&lt;br /&gt;
&lt;br /&gt;
    [message]&lt;br /&gt;
        speaker=unit&lt;br /&gt;
        message= _ &amp;quot;It's not over yet! I'll come back to haunt you!&amp;quot;&lt;br /&gt;
    [/message]&lt;br /&gt;
[/event]&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Nested Event Example ===&lt;br /&gt;
&lt;br /&gt;
An event is created for a portal that opens on turn 10. The parent (or 'outer') event executes on turn 10 at which point the nested moveto event is created. This nested event executes when a player steps on a certain spot.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang='wml'&amp;gt;&lt;br /&gt;
[event]&lt;br /&gt;
    name=turn 10&lt;br /&gt;
 &lt;br /&gt;
    [event]&lt;br /&gt;
        name=moveto&lt;br /&gt;
        [filter]&lt;br /&gt;
            x,y=5,8&lt;br /&gt;
        [/filter]&lt;br /&gt;
 &lt;br /&gt;
        # moving to 5,8 will trigger this event only on turn 10 and after&lt;br /&gt;
    [/event]&lt;br /&gt;
[/event]&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
An equivalent way of doing this would be to create a single moveto event with a '''[filter_condition]''' statement to check for turn number but using nested '''[event]''' tags is a convenient shortcut to accomplish this task without resorting to '''[filter_condition]''' statements. Using '''[if]''' tags is also an option especially if your event has '''first_time_only=yes'''.&lt;br /&gt;
&lt;br /&gt;
=== Delayed Variable Substitution Example ===&lt;br /&gt;
&lt;br /&gt;
This code will display a message showing the turn number on which the nested ''moveto'' event happens.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang='wml'&amp;gt;&lt;br /&gt;
[event]&lt;br /&gt;
    name=turn 10&lt;br /&gt;
&lt;br /&gt;
    [event]&lt;br /&gt;
        name=moveto&lt;br /&gt;
        delayed_variable_substitution=yes&lt;br /&gt;
        [filter]&lt;br /&gt;
            x,y=5,8&lt;br /&gt;
        [/filter]&lt;br /&gt;
&lt;br /&gt;
        {DEBUG_MSG &amp;quot;Turn $turn_number&amp;quot;} &lt;br /&gt;
    [/event]&lt;br /&gt;
[/event]&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Since this is the default behavior for the '''delayed_variable_substitution''' key, the following example is identical.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang='wml'&amp;gt;&lt;br /&gt;
[event]&lt;br /&gt;
    name=turn 10&lt;br /&gt;
&lt;br /&gt;
    [event]&lt;br /&gt;
        name=moveto&lt;br /&gt;
        [filter]&lt;br /&gt;
            x,y=5,8&lt;br /&gt;
        [/filter]&lt;br /&gt;
&lt;br /&gt;
        {DEBUG_MSG &amp;quot;Turn $turn_number&amp;quot;} &lt;br /&gt;
    [/event]&lt;br /&gt;
[/event]&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The following code will always display &amp;quot;Turn 10&amp;quot; when the nested ''moveto'' event happens. This is because the variable substitution is done when the parent event is triggered and spawns the nested event, ''not'' when the nested event is triggered.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang='wml'&amp;gt;&lt;br /&gt;
[event]&lt;br /&gt;
    name=turn 10&lt;br /&gt;
&lt;br /&gt;
    [event]&lt;br /&gt;
        name=moveto&lt;br /&gt;
        delayed_variable_substitution=no&lt;br /&gt;
        [filter]&lt;br /&gt;
            x,y=5,8&lt;br /&gt;
        [/filter]&lt;br /&gt;
&lt;br /&gt;
        {DEBUG_MSG &amp;quot;Turn $turn_number&amp;quot;} &lt;br /&gt;
    [/event]&lt;br /&gt;
[/event]&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Finally, the following example is identical to the first two in that it will display a message showing the turn number on which the nested ''moveto'' event happens, despite the fact that the '''delayed_variable_substitution''' key is set to ''no''. This is because the special '''$|variable''' syntax is used.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang='wml'&amp;gt;&lt;br /&gt;
[event]&lt;br /&gt;
    name=turn 10&lt;br /&gt;
&lt;br /&gt;
    [event]&lt;br /&gt;
        name=moveto&lt;br /&gt;
        delayed_variable_substitution=no&lt;br /&gt;
        [filter]&lt;br /&gt;
            x,y=5,8&lt;br /&gt;
        [/filter]&lt;br /&gt;
&lt;br /&gt;
        {DEBUG_MSG &amp;quot;Turn $|turn_number&amp;quot;} &lt;br /&gt;
    [/event]&lt;br /&gt;
[/event]&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Multiple Nested Events ===&lt;br /&gt;
&lt;br /&gt;
Every delayed_variable_substitution=no causes a variable substitution run on the subevent where it occurs at the spawn time of this event and on all following subevents. For any specific event, variable substitution happens at least one time when the event is executed. For each delayed=no key appearing in itself or in an event of an &amp;quot;older&amp;quot; generation, which is not the toplevel event, an additional variable substitution run is made.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang='wml'&amp;gt;&lt;br /&gt;
[event] # parent&lt;br /&gt;
    name=turn 2&lt;br /&gt;
    # delayed_variable_substitution=no # In the parent event, delayed= has no effect.&lt;br /&gt;
 &lt;br /&gt;
    [event] # child&lt;br /&gt;
        name=turn 3&lt;br /&gt;
        delayed_variable_substitution=no # Causes variable substitution in the child, grandchild and great-grandchild event&lt;br /&gt;
        # at execution time of the parent event = spawn time of the child event.&lt;br /&gt;
&lt;br /&gt;
        [event]# grandchild&lt;br /&gt;
            name=turn 4&lt;br /&gt;
            delayed_variable_substitution=yes # no variable substitution in the grandchild and great-grandchild event&lt;br /&gt;
            # at execution time of the child event = spawn time of the grandchild event&lt;br /&gt;
&lt;br /&gt;
            [event] # great-grandchild&lt;br /&gt;
                name=turn 5&lt;br /&gt;
                {DEBUG_MSG $turn_number} # output: 2 - value from the variable substitution at execution time of the parent event,&lt;br /&gt;
                # caused by delayed=no in the child event&lt;br /&gt;
&lt;br /&gt;
                {DEBUG_MSG $||turn_number}# output: &amp;quot;$turn_number&amp;quot;&lt;br /&gt;
                # Each variable substitution transforms a &amp;quot;$|&amp;quot; to a &amp;quot;$&amp;quot; (except when no | left).&lt;br /&gt;
&lt;br /&gt;
                {DEBUG_MSG $|turn_number}# output: 5 - from the variable substitution at execution time&lt;br /&gt;
                # of the great-grandchild event&lt;br /&gt;
            [/event]&lt;br /&gt;
        [/event]&lt;br /&gt;
    [/event]&lt;br /&gt;
[/event]&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== See Also ==&lt;br /&gt;
&lt;br /&gt;
* [[DirectActionsWML]]&lt;br /&gt;
* [[InternalActionsWML]]&lt;br /&gt;
* [[InterfaceActionsWML]]&lt;br /&gt;
* [[FilterWML]]&lt;br /&gt;
* [[ReferenceWML]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category: WML Reference]]&lt;/div&gt;</summary>
		<author><name>Soliton</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.wesnoth.org/index.php?title=UsefulLinks&amp;diff=74662</id>
		<title>UsefulLinks</title>
		<link rel="alternate" type="text/html" href="https://wiki.wesnoth.org/index.php?title=UsefulLinks&amp;diff=74662"/>
		<updated>2025-12-11T18:21:46Z</updated>

		<summary type="html">&lt;p&gt;Soliton: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
!colspan=2 style='text-align:left'|&lt;br /&gt;
=== Battle for Wesnoth ===&lt;br /&gt;
|-&lt;br /&gt;
|Home Page || https://www.wesnoth.org/&lt;br /&gt;
|-&lt;br /&gt;
|GitHub Project Page || https://github.com/wesnoth/&lt;br /&gt;
|-&lt;br /&gt;
|SPI project page || https://www.spi-inc.org/projects/wesnoth/&lt;br /&gt;
|-&lt;br /&gt;
|Changelog || https://changelog.wesnoth.org/ [http://stable-changelog.wesnoth.org stable]&lt;br /&gt;
|-&lt;br /&gt;
|Compatibility-breaking changes || https://forums.wesnoth.org/viewtopic.php?t=58532&lt;br /&gt;
|-&lt;br /&gt;
|Roadmap || https://wiki.wesnoth.org/1.19_Roadmap&lt;br /&gt;
|-&lt;br /&gt;
|This wiki || [[StartingPoints|https://wiki.wesnoth.org/]]&lt;br /&gt;
|-&lt;br /&gt;
|The manual || https://manual.wesnoth.org/&lt;br /&gt;
|-&lt;br /&gt;
|Translation statistics || https://gettext.wesnoth.org/&lt;br /&gt;
|-&lt;br /&gt;
|Add-on server web interface || https://addons.wesnoth.org/ [http://stable-addons.wesnoth.org stable] [http://dev-addons.wesnoth.org dev]&lt;br /&gt;
|-&lt;br /&gt;
|Code and Content Copyright || https://wiki.wesnoth.org/Wesnoth:Copyrights&lt;br /&gt;
|-&lt;br /&gt;
|Multiplayer server statistics || https://wesnothd.wesnoth.org/&lt;br /&gt;
|-&lt;br /&gt;
|Multiplayer statistics || https://replays.wesnoth.org/dashboard/&lt;br /&gt;
|-&lt;br /&gt;
|Multiplayer replays || https://replays.wesnoth.org&lt;br /&gt;
|-&lt;br /&gt;
|Unit advancement tree || https://units.wesnoth.org/&lt;br /&gt;
|-&lt;br /&gt;
|SteamDB || https://steamdb.info/app/599390/&lt;br /&gt;
|-&lt;br /&gt;
|Forum for users and developers || https://forums.wesnoth.org/ [https://forums.wesnoth.org/search.php?search_id=newposts new posts]&lt;br /&gt;
|-&lt;br /&gt;
|List of Frequently Proposed Ideas || https://forums.wesnoth.org/viewtopic.php?f=12&amp;amp;t=34904&lt;br /&gt;
|-&lt;br /&gt;
|IRC channel (Libera.Chat) || ircs://irc.libera.chat/#wesnoth&lt;br /&gt;
|-&lt;br /&gt;
|Discord server || https://discord.gg/battleforwesnoth&lt;br /&gt;
|-&lt;br /&gt;
|IRC logs || https://wesnoth.org/irclogs/&lt;br /&gt;
|-&lt;br /&gt;
|Mastodon Account || https://fosstodon.org/@wesnoth&lt;br /&gt;
|-&lt;br /&gt;
|Project statistics || https://openhub.net/p/wesnoth&lt;br /&gt;
|-&lt;br /&gt;
!colspan=2 style='text-align:left'|&lt;br /&gt;
&lt;br /&gt;
=== Developers ===&lt;br /&gt;
|-&lt;br /&gt;
|Git web interface || https://github.com/wesnoth/wesnoth ([https://git-scm.com/ git] [https://git-scm.com/documentation doc])&lt;br /&gt;
|-&lt;br /&gt;
|Jenkins CI || https://jenkins.wesnoth.org:8443/&lt;br /&gt;
|-&lt;br /&gt;
| Github CI || https://github.com/wesnoth/wesnoth/actions&lt;br /&gt;
|-&lt;br /&gt;
|Code documentation || https://devdocs.wesnoth.org/&lt;br /&gt;
|-&lt;br /&gt;
|GUI(2) documentation || https://wiki.wesnoth.org/GUIToolkit&lt;br /&gt;
|-&lt;br /&gt;
|Lua documentation || https://wiki.wesnoth.org/LuaAPI&lt;br /&gt;
|-&lt;br /&gt;
|WML documentation || https://wiki.wesnoth.org/WML&lt;br /&gt;
|-&lt;br /&gt;
|WFL documentation || https://wiki.wesnoth.org/WFL&lt;br /&gt;
|-&lt;br /&gt;
|Mailing lists || [https://groups.io/g/wesnoth-packagers wesnoth-packagers] - [https://groups.io/g/wesnoth-translations wesnoth-translations] ([https://listengine.tuxfamily.org/wesnoth.org/ old] - [https://mailman.wesnoth.org/ oldold])&lt;br /&gt;
|-&lt;br /&gt;
|Bug/Feature tracker || https://bugs.wesnoth.org/&lt;br /&gt;
|-&lt;br /&gt;
|Patch tracker || https://patches.wesnoth.org/&lt;br /&gt;
|-&lt;br /&gt;
|wesnoth.org server stats || https://collectd.wesnoth.org&lt;br /&gt;
|-&lt;br /&gt;
|IRC channel (Libera.Chat) || ircs://irc.libera.chat/wesnoth-dev&lt;br /&gt;
|-&lt;br /&gt;
!colspan=2 style='text-align:left'|&lt;br /&gt;
&lt;br /&gt;
=== Other Links ===&lt;br /&gt;
|-&lt;br /&gt;
|1vs1 Wesnoth ladder || https://wesnoth.gamingladder.info/&lt;br /&gt;
|-&lt;br /&gt;
|Wesnoth matches with commentary || http://www.youtube.com/user/NekisBrutalWesnoth&lt;br /&gt;
|-&lt;br /&gt;
|Wesnoth campaign with commentary in german || https://www.youtube.com/playlist?list=PLc3DmuDuA2imW1vg9xXMNjGHm8VaXvEaz&lt;br /&gt;
|-&lt;br /&gt;
|WSNPP || [[WSNPP|http://wiki.wesnoth.org/WSNPP]]&lt;br /&gt;
|-&lt;br /&gt;
|Run Wesnoth online (Windows) || http://spoon.net/the-battle-for-wesnoth&lt;br /&gt;
|-&lt;br /&gt;
!colspan=2 style='text-align:left'|&lt;br /&gt;
=== Multilingual Players' Sites ===&lt;br /&gt;
|-&lt;br /&gt;
|Community in China || http://wesnoth.cn/&lt;br /&gt;
|-&lt;br /&gt;
|Polish Community || https://www.wesnoth.com.pl/forum/index.php&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
[[Category:Wesnoth Wiki]]&lt;/div&gt;</summary>
		<author><name>Soliton</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.wesnoth.org/index.php?title=UsefulLinks&amp;diff=74661</id>
		<title>UsefulLinks</title>
		<link rel="alternate" type="text/html" href="https://wiki.wesnoth.org/index.php?title=UsefulLinks&amp;diff=74661"/>
		<updated>2025-12-11T18:20:45Z</updated>

		<summary type="html">&lt;p&gt;Soliton: /* Developers */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
!colspan=2 style='text-align:left'|&lt;br /&gt;
=== Battle for Wesnoth ===&lt;br /&gt;
|-&lt;br /&gt;
|Home Page || https://www.wesnoth.org/&lt;br /&gt;
|-&lt;br /&gt;
|GitHub Project Page || https://github.com/wesnoth/&lt;br /&gt;
|-&lt;br /&gt;
|SPI project page || https://www.spi-inc.org/projects/wesnoth/&lt;br /&gt;
|-&lt;br /&gt;
|Changelog || https://changelog.wesnoth.org/ [http://stable-changelog.wesnoth.org stable]&lt;br /&gt;
|-&lt;br /&gt;
|Roadmap || https://wiki.wesnoth.org/1.19_Roadmap&lt;br /&gt;
|-&lt;br /&gt;
|This wiki || [[StartingPoints|https://wiki.wesnoth.org/]]&lt;br /&gt;
|-&lt;br /&gt;
|The manual || https://manual.wesnoth.org/&lt;br /&gt;
|-&lt;br /&gt;
|Translation statistics || https://gettext.wesnoth.org/&lt;br /&gt;
|-&lt;br /&gt;
|Add-on server web interface || https://addons.wesnoth.org/ [http://stable-addons.wesnoth.org stable] [http://dev-addons.wesnoth.org dev]&lt;br /&gt;
|-&lt;br /&gt;
|Code and Content Copyright || https://wiki.wesnoth.org/Wesnoth:Copyrights&lt;br /&gt;
|-&lt;br /&gt;
|Multiplayer server statistics || https://wesnothd.wesnoth.org/&lt;br /&gt;
|-&lt;br /&gt;
|Multiplayer statistics || https://replays.wesnoth.org/dashboard/&lt;br /&gt;
|-&lt;br /&gt;
|Multiplayer replays || https://replays.wesnoth.org&lt;br /&gt;
|-&lt;br /&gt;
|Unit advancement tree || https://units.wesnoth.org/&lt;br /&gt;
|-&lt;br /&gt;
|SteamDB || https://steamdb.info/app/599390/&lt;br /&gt;
|-&lt;br /&gt;
|Forum for users and developers || https://forums.wesnoth.org/ [https://forums.wesnoth.org/search.php?search_id=newposts new posts]&lt;br /&gt;
|-&lt;br /&gt;
|List of Frequently Proposed Ideas || https://forums.wesnoth.org/viewtopic.php?f=12&amp;amp;t=34904&lt;br /&gt;
|-&lt;br /&gt;
|IRC channel (Libera.Chat) || ircs://irc.libera.chat/#wesnoth&lt;br /&gt;
|-&lt;br /&gt;
|Discord server || https://discord.gg/battleforwesnoth&lt;br /&gt;
|-&lt;br /&gt;
|IRC logs || https://wesnoth.org/irclogs/&lt;br /&gt;
|-&lt;br /&gt;
|Mastodon Account || https://fosstodon.org/@wesnoth&lt;br /&gt;
|-&lt;br /&gt;
|Project statistics || https://openhub.net/p/wesnoth&lt;br /&gt;
|-&lt;br /&gt;
!colspan=2 style='text-align:left'|&lt;br /&gt;
&lt;br /&gt;
=== Developers ===&lt;br /&gt;
|-&lt;br /&gt;
|Git web interface || https://github.com/wesnoth/wesnoth ([https://git-scm.com/ git] [https://git-scm.com/documentation doc])&lt;br /&gt;
|-&lt;br /&gt;
|Jenkins CI || https://jenkins.wesnoth.org:8443/&lt;br /&gt;
|-&lt;br /&gt;
| Github CI || https://github.com/wesnoth/wesnoth/actions&lt;br /&gt;
|-&lt;br /&gt;
|Code documentation || https://devdocs.wesnoth.org/&lt;br /&gt;
|-&lt;br /&gt;
|GUI(2) documentation || https://wiki.wesnoth.org/GUIToolkit&lt;br /&gt;
|-&lt;br /&gt;
|Lua documentation || https://wiki.wesnoth.org/LuaAPI&lt;br /&gt;
|-&lt;br /&gt;
|WML documentation || https://wiki.wesnoth.org/WML&lt;br /&gt;
|-&lt;br /&gt;
|Compatibility-breaking changes || https://forums.wesnoth.org/viewtopic.php?t=58532&lt;br /&gt;
|-&lt;br /&gt;
|WFL documentation || https://wiki.wesnoth.org/WFL&lt;br /&gt;
|-&lt;br /&gt;
|Mailing lists || [https://groups.io/g/wesnoth-packagers wesnoth-packagers] - [https://groups.io/g/wesnoth-translations wesnoth-translations] ([https://listengine.tuxfamily.org/wesnoth.org/ old] - [https://mailman.wesnoth.org/ oldold])&lt;br /&gt;
|-&lt;br /&gt;
|Bug/Feature tracker || https://bugs.wesnoth.org/&lt;br /&gt;
|-&lt;br /&gt;
|Patch tracker || https://patches.wesnoth.org/&lt;br /&gt;
|-&lt;br /&gt;
|wesnoth.org server stats || https://collectd.wesnoth.org&lt;br /&gt;
|-&lt;br /&gt;
|IRC channel (Libera.Chat) || ircs://irc.libera.chat/wesnoth-dev&lt;br /&gt;
|-&lt;br /&gt;
!colspan=2 style='text-align:left'|&lt;br /&gt;
&lt;br /&gt;
=== Other Links ===&lt;br /&gt;
|-&lt;br /&gt;
|1vs1 Wesnoth ladder || https://wesnoth.gamingladder.info/&lt;br /&gt;
|-&lt;br /&gt;
|Wesnoth matches with commentary || http://www.youtube.com/user/NekisBrutalWesnoth&lt;br /&gt;
|-&lt;br /&gt;
|Wesnoth campaign with commentary in german || https://www.youtube.com/playlist?list=PLc3DmuDuA2imW1vg9xXMNjGHm8VaXvEaz&lt;br /&gt;
|-&lt;br /&gt;
|WSNPP || [[WSNPP|http://wiki.wesnoth.org/WSNPP]]&lt;br /&gt;
|-&lt;br /&gt;
|Run Wesnoth online (Windows) || http://spoon.net/the-battle-for-wesnoth&lt;br /&gt;
|-&lt;br /&gt;
!colspan=2 style='text-align:left'|&lt;br /&gt;
=== Multilingual Players' Sites ===&lt;br /&gt;
|-&lt;br /&gt;
|Community in China || http://wesnoth.cn/&lt;br /&gt;
|-&lt;br /&gt;
|Polish Community || https://www.wesnoth.com.pl/forum/index.php&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
[[Category:Wesnoth Wiki]]&lt;/div&gt;</summary>
		<author><name>Soliton</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.wesnoth.org/index.php?title=UnitTypeWML&amp;diff=74656</id>
		<title>UnitTypeWML</title>
		<link rel="alternate" type="text/html" href="https://wiki.wesnoth.org/index.php?title=UnitTypeWML&amp;diff=74656"/>
		<updated>2025-12-02T16:54:22Z</updated>

		<summary type="html">&lt;p&gt;Soliton: /* Unit Type */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{WML Tags}}&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
== Unit Type ==&lt;br /&gt;
&lt;br /&gt;
Each '''[unit_type]''' tag defines one unit type. (for the use of [unit] to create a unit, see [[SingleUnitWML]])&lt;br /&gt;
&lt;br /&gt;
Unit animation syntax is described in [[AnimationWML]]. In addition to the animation tags described there, the following key/tags are recognized:&lt;br /&gt;
* '''advances_to''': When this unit has ''experience'' greater than or equal to ''experience'', it is replaced by a unit of the type that the value of ''advances_to'' refers to. All modifications that have been done to the unit are applied to the unit it is replaced by. The special value 'null' says that the unit does not advance but gets an AMLA instead. Can be a comma-separated list of units that can be chosen from upon advancing.&lt;br /&gt;
* '''alignment''': one of lawful/neutral/chaotic/liminal (See [[TimeWML]]). Default is &amp;quot;neutral&amp;quot;.&lt;br /&gt;
* '''attacks''': the number of times that this unit can attack each turn. Default is 1.&lt;br /&gt;
* '''cost''': when a player recruits a unit of this type, the player loses ''cost'' gold. If this would cause gold to drop below 0,  the unit cannot be recruited. Default is 1.&lt;br /&gt;
* '''recall_cost''': {{DevFeature1.13|0}} the default recall cost of units of this type, overriding the recall cost set in scenario [[SideWML|[side]]] tags or the global [[GameConfigWML|[game_config]]] value. Individual units may override this value in [[SingleUnitWML|[unit]]]. A value of -1 is equivalent to not specifying this attribute. {{DevFeature1.15|0}} Units are now recalled for AI sides even if the recall_cost is larger than the unit's worth (essentially its cost, plus potentially a bonus for experience points). In 1.14 and earlier, units were not recalled by the AI in this case even if this was the only recall/recruit action possible to the AI.&lt;br /&gt;
* '''description''': (translatable) the text displayed in the unit descriptor box for this unit. Default 'No description available...'. &lt;br /&gt;
* '''do_not_list''': Not used by the game, but by tools for browsing and listing the unit tree. If this is 'yes', the unit will be ignored by these tools. {{DevFeature1.13|?}} When placing units in debug mode this unit isn't listed (but can still be placed using the :create command). This restriction is lifted in version &amp;lt;b&amp;gt;1.14.3&amp;lt;/b&amp;gt;.&lt;br /&gt;
* '''ellipse''': the ellipse image to display under the unit, which is normally team-colored. Default is &amp;quot;misc/ellipse&amp;quot;. &amp;quot;-nozoc&amp;quot; and &amp;quot;-leader&amp;quot; are automatically appended for units without zone of control and with canrecruit=yes respectively. The [http://www.wesnoth.org/macro-reference.xhtml#IS_HERO IS_HERO]/[http://www.wesnoth.org/macro-reference.xhtml#MAKE_HERO MAKE_HERO]/[http://www.wesnoth.org/macro-reference.xhtml#UNMAKE_HERO UNMAKE_HERO] macros change the ellipse to/back from &amp;quot;misc/ellipse-hero&amp;quot;. Finally, setting this to &amp;quot;none&amp;quot; will cause the unit to not have any ellipses displayed under it regardless of the user's preferences.&amp;lt;br/&amp;gt;WARNING: Be aware that setting this to &amp;quot;misc/ellipse-hero&amp;quot; for a unit with canrecruit=yes will result in the ellipse being &amp;quot;misc/ellipse-hero-leader&amp;quot;, which is not a supported combination (it doesn't have a graphic, and will cause error logs that the graphic is missing). This is tracked as bug [https://github.com/wesnoth/wesnoth/issues/6258 6258] on GitHub.&amp;lt;br/&amp;gt;{{DevFeature1.17|26}} canrecruit=yes is now supported with &amp;quot;misc/ellipse-hero&amp;quot;, since &amp;quot;misc/ellipse-hero-leader&amp;quot; has been added in [https://github.com/wesnoth/wesnoth/pull/8375 8375].&lt;br /&gt;
* '''experience''': When this unit has experience greater than or equal to ''experience'', it is replaced by a unit with 0 experience of the type that the value of ''advances_to'' refers to. All modifications that have been done to the unit are applied to the unit it is replaced by.&lt;br /&gt;
* '''flag_rgb''': usually set by [http://www.wesnoth.org/macro-reference.xhtml#MAGENTA_IS_THE_TEAM_COLOR MAGENTA_IS_THE_TEAM_COLOR]; specifies the colours in the base flag to use for team-colouring the unit, expressed as a colour name (such as magenta) or a comma-separated list of RGB values (in hex format).&lt;br /&gt;
* '''gender''': has a value of either ''male'' or ''female'', and determines which of the keys ''male_names'' and ''female_names''  should be read. When a unit of this type is recruited, it will be randomly assigned a name by the random name generator, which will use these names as a base. If '''gender''' is not specified it defaults to ''male''.&lt;br /&gt;
* '''halo''': an image to place centered on the unit. It is drawn on top of the unit, and on top of surrounding units if the image is larger than one hex. It works similarly to the halo attribute of {{tag|InterfaceActionsWML|item}}, and it can be animated with a comma-separated list of images.&lt;br /&gt;
* '''hide_help''': (yes|no) default=no. Determines if the unit type will appear in the in-game help.&lt;br /&gt;
* '''hitpoints''': the maximum HP that the unit has, and the HP it has when it is created.&lt;br /&gt;
* '''id''': the value of the ''type'' key for units of this type. This is required and must be unique among all [unit_type] tags. An ''id'' must consist only of alphanumerics and spaces (or underscores). ''type'' keys are found in [[SingleUnitWML]] and [[FilterWML]]. For example, id=Drake Flare&lt;br /&gt;
*'''ignore_race_traits''': 'yes' or 'no' (default). Determines whether racial traits (see [[UnitsWML]]) are applied. &lt;br /&gt;
* '''image''': sets the base image of the unit, which is used on the map.&lt;br /&gt;
* '''image_icon''': sets an alternative image to be used to represent the unit in any UI dialogs such as the recruit dialog, attack dialog and the unit image box in the sidebar. This is usually a variant of the image with any transparent padding removed, and is usually needed for images that have extra transparent padding for correct positioning on the game map. The image specified by this key will be scaled to 72x72px in the Unit Recruit/Unit Create dialog's listbox and 144x144px on the unit preview panel (the panel that shows the unit's detailed stats, located on left side on recruit/create dialog and on both sides of the attack dialog). [[ImagePathFunctions#Crop_Function|~CROP]] function can be useful here. Scaling might not be a good idea because it will be internally scaled as mentioned above. You can see Loyalists Paladin or the Fire Dragon/Skeletal Dragon units as an example.&lt;br /&gt;
* '''level''': the amount of upkeep the unit costs.  After this unit fights, its opponent gains ''level'' experience. See also kill_experience ([[GameConfigWML]]), and leadership ([[AbilitiesWML]]).&lt;br /&gt;
* '''upkeep''': the amount of upkeep the unit costs if it differs from its level.&lt;br /&gt;
* '''movement''': the number of move points that this unit receives each turn.&lt;br /&gt;
* '''movement_type''': See [[UnitsWML#.5Bmovetype.5D|movetype]]. Note that the tags '''[movement_costs]''', '''[vision_costs]''', '''[defense]''', and '''[resistance]''' can be used to modify this movetype.&lt;br /&gt;
* '''name''': (translatable) displayed in the Status Table for units of this type.&lt;br /&gt;
* '''num_traits''': the number of traits that units of this type should receive when they are recruited, overriding the value set in the [[UnitsWML#.5Brace.5D|[race]]] tag.&lt;br /&gt;
* '''profile''': the portrait image to use for this unit type. You can also set a portrait for an individual unit instead of the whole unit type (see [[SingleUnitWML]]). The engine first looks for the image in the transparent subdirectory and if found that image is used. If not found it will use the image as-is. If the image width or height is equal or above 300 the engine will scale the image with a factor between 1/2 and 1. For images which should only be shown on the right side in the dialog append ~RIGHT() to the image.&lt;br /&gt;
** If &amp;quot;unit_image&amp;quot; is given instead of a filename, uses the unit's base image as the portrait (in the same manner that unit types without portraits do by default).&lt;br /&gt;
** If &amp;quot;none&amp;quot; is given instead of a filename, no image will be displayed.&lt;br /&gt;
* '''small_profile''': the image to use when a smaller portrait is needed than the one used for messages (e.g., in the help system). When this attribute is missing, the value of the '''profile''' attribute is used instead. When present, the heuristic for finding a transparent portrait is disabled for the '''profile''' attribute, so the correct '''profile''' should be set too. If '''profile''' is not present, '''small_profile''' is ignored. Note that image modifiers are allowed; they might be useful for cropping and rescaling a portrait:&lt;br /&gt;
 small_profile=&amp;quot;portraits/elves/transparent/marksman+female.png~CROP(0,20,380,380)~SCALE(205,205)&amp;quot;&lt;br /&gt;
 profile=&amp;quot;portraits/elves/transparent/marksman+female.png&amp;quot;&lt;br /&gt;
* '''race''': See {{tag|UnitsWML|race}}.  Also used in standard unit filter (see [[FilterWML]]). Mainline Wesnoth features following values:  bats, drake, dwarf, elf, falcon, goblin, gryphon, human, dunefolk, lizard, mechanical, merman, monster, naga, ogre, orc, troll, undead, wolf, wose. They are defined in /data/core/units.cfg.&lt;br /&gt;
* '''undead_variation''': When a unit of this type is killed by a weapon with the plague special, this variation is applied to the new plague unit that is created, whatever its type. For example, if the plague special creates Walking Corpses and undead_variation is set to &amp;quot;troll&amp;quot;, you'll get a troll Walking Corpse. Defaults to the undead_variation set in this unit type's race.&lt;br /&gt;
* '''usage''': the way that the AI should recruit this unit, as determined by the scenario designer. (See ''recruitment_pattern'', [[AiWML]]).  The following are conventions on usage:&lt;br /&gt;
** ''scout'': Fast, mobile unit meant for exploration and village grabbing.&lt;br /&gt;
** ''fighter'': Melee fighter, melee attack substantially more powerful than ranged.&lt;br /&gt;
** ''archer'': Ranged fighter, ranged attack substantially more powerful than melee.&lt;br /&gt;
** ''mixed fighter'': Melee and ranged fighter, melee and ranged attacks roughly equal.&lt;br /&gt;
** ''healer'': Specialty 'heals' or 'cures'.&lt;br /&gt;
:Note that this field primarily affects recruitment.  It also has a small effect on unit movement (the AI tries to keep scouts away from enemies, to some extent).  It does not affect the AI's behavior in combat; that is always computed from attack power and hitpoints. Non-standard usages may be used as well.&lt;br /&gt;
* '''vision''': the number of vision points to calculate the unit's sight range. Defaults to ''movement'' if not present.&lt;br /&gt;
* '''jamming''': the number of jamming points. Defaults to ''0'' if not present. See [[UnitsWML#.5Bmovetype.5D|[jamming_costs]]]&lt;br /&gt;
* '''zoc''': if &amp;quot;yes&amp;quot; the unit will have a zone of control regardless of level.  If present but set to anything other than &amp;quot;yes,&amp;quot; the unit will have no zone of control.  If the tag is omitted, zone of control is dictated by unit level (level 0 = no zoc, level 1+ = has zoc).&lt;br /&gt;
* '''die_sound''': sets the sound, which is used when the unit dies.&lt;br /&gt;
* '''healed_sound''': sets the sound used when the unit is healed in any way (default: heal.wav).&lt;br /&gt;
* '''hp_bar_scaling''': Overrides the attribute in ([[GameConfigWML]]).&lt;br /&gt;
* '''xp_bar_scaling''': Overrides the attribute in ([[GameConfigWML]]).&lt;br /&gt;
* '''bar_offset_x''', '''bar_offset_y''': The offset of the hp and xp bars from the normal bar position of 72x72 unit sprite.&lt;br /&gt;
&lt;br /&gt;
== After max level advancement (AMLA) ==&lt;br /&gt;
* '''[advancement]''': describes what happens to a unit when it reaches the XP required for advancement.  It is considered as an advancement in the same way as advancement described by '''advances_to'''; however, if the player chooses this advancement, the unit will have one or more effects applied to it instead of advancing.&lt;br /&gt;
** '''id''': unique identifier for this advancement; ''Required'' if there are multiple advancement options, or if ''strict_amla=no''.&lt;br /&gt;
** '''always_display''': if set to true displays the AMLA option even if it is the only available one.&lt;br /&gt;
** '''description''': a description displayed as the option for this advancement if there is another advancement option that the player must choose from; otherwise, the advancement is chosen automatically and this key is irrelevant.&lt;br /&gt;
** '''image''': an image to display next to the description in the advancement menu.&lt;br /&gt;
** '''max_times''': default 1.  The maximum times the unit can be awarded this advancement. Pass -1 for &amp;quot;unlimited&amp;quot;.&lt;br /&gt;
** '''strict_amla''':  (yes|no) default=no. Disable the AMLA if the unit can advance to another unit.&lt;br /&gt;
** '''major_amla''': (yes|no) default=no. Sets whether the unit's XP bar is blue(=yes) or purple(=no). In case of more [advancement] tags, if there is one with major_amla=yes, the XP bar will be blue.&lt;br /&gt;
** '''require_amla''': An optional list of AMLA ''id'' keys that act as prerequisites for this advancement to become available.  Order is not important, and an AMLA id can be repeated any number of times to indicate that another advancement must be chosen several times before this advancement option will become available.&lt;br /&gt;
*** example: &amp;lt;tt&amp;gt;require_amla=tough,tough,incr_damage&amp;lt;/tt&amp;gt; assumes there exist other [advancement] options called ''id=tough'' and ''id=incr_damage''.  Once ''tough'' is chosen twice and ''incr_damage'' is chosen once, then the current [advancement] will become available.&lt;br /&gt;
*** ''require_amla=tough,incr_damage,tough'' is an equivalent way of expressing this.&lt;br /&gt;
** '''exclude_amla''': {{DevFeature1.13|2}} An optional list of AMLA ''id'' keys that represent AMLAs that are mutually exclusive to this one. Order is not important, and an AMLA id can be repeated. If the unit already has any of the AMLAs that appear once in this list, then this AMLA will not be made available. If an AMLA id appears multiple times in the list, then this AMLA will be made available only if the other AMLA has been chosen less than the number of times it appears in the list. Of course, for this to really make two AMLAs mutually exclusive, you need to add ''exclude_amla'' to both AMLA defintions.&lt;br /&gt;
** '''[effect]''': A modification applied to the unit whenever this advancement is chosen.  See [[EffectWML]]&lt;br /&gt;
** '''[filter]''': A  [[StandardUnitFilter]],  the advancement will only be available when the unit passes this filter during the time the advancement dialog is shown.&lt;br /&gt;
&lt;br /&gt;
== Attacks ==&lt;br /&gt;
* '''[attack]''': one of the unit's attacks.&lt;br /&gt;
** '''description''': a translatable text for name of the attack, to be displayed to the user.&lt;br /&gt;
** '''name''': the name of the attack. Used as a default description, if ''description'' is not present, and to determine the default icon, if ''icon'' is not present (see below).  Non-translatable.  Used for the ''has_weapon'' key and animation filters; see [[StandardUnitFilter]] and [[AnimationWML]]&lt;br /&gt;
** '''type''': the damage type of the attack.  Used in determining resistance to this attack (see {{tag|UnitsWML|movetype|resistance}}). Usually this is one of ''blade'', ''pierce'', ''impact'', ''fire'', ''cold'', or ''arcane'', but it can be set to anything (as long as it contains only letters, numbers, and underscores). When using a custom type, you will need to set its user-visible name using [[LanguageWML]]. {{DevFeature1.15|0}} When showing the icon for a custom damage type in the sidebar, the game will look for a file called icons/profiles/''type''.png under your addon's images folder. For example, the icon for a damage type called ''electric'' would be at images/icons/profiles/electric.png.&lt;br /&gt;
** '''[specials]''': contains the specials of the attack. See [[AbilitiesWML#The_.5Bspecials.5D_tag|AbilitiesWML]].&lt;br /&gt;
** '''specials_list''': {{DevFeature1.19|17}} A comma-separated list of weapon special [[AbilitiesWML#Common_keys_and_tags_for_every_ability|'''unique_id''']]s. If defined in the registry [[UnitsWML#.5Bweapon_specials.5D|[units][weapon_specials]]], these will be added to this attack as if their full definition was included in '''[weapon_specials]'''. Example: ''weapon_specials=plague,magical''.&lt;br /&gt;
** '''icon''': the image to use as an icon for the attack in the attack choice menu, as a path relative to the images directory. Defaults to the attack's name in the attacks directory (Ex. if ''name=sword'' then default is ''icon=attacks/sword.png''). &lt;br /&gt;
** '''range''': the range of the attack.  Used to determine the enemy's retaliation, which will be of the same type. The range can be anything (as long as it contains only letters, numbers, and underscores), but the standard values are ''melee'' and ''ranged''. Units can only retaliate against attacks for which they have a corresponding attack of the same range. When using a custom range, you will need to set its user-visible name using [[LanguageWML]]. {{DevFeature1.15|0}} When showing the icon for a custom range in the sidebar the game will look for a file called icons/profiles/''range''_attack.png under your addon's images folder. For example, the icon for a range called ''very_long'' would be at images/icons/profiles/very_long_attack.png.&lt;br /&gt;
** '''max_range''': maximum distance (in number of hexes) to which this attack works. Default is 1.&lt;br /&gt;
*** This currently lacks UI and AI support.&lt;br /&gt;
** '''min_range''': minimum distance (in number of hexes) to which this attack works. Default is 1.&lt;br /&gt;
*** This currently lacks UI and AI support.&lt;br /&gt;
** '''damage''': the damage of this attack&lt;br /&gt;
** '''number''': the number of strikes per attack this weapon has&lt;br /&gt;
** '''accuracy''': a number added to the chance to hit whenever using this weapon offensively (i.e. during a strike with this attack, regardless of who initiated the combat); negative values work too&lt;br /&gt;
** '''parry''': a number deducted from the enemy chance to hit whenever using this weapon defensively (i.e. during the enemy's strike, regardless of who initiated the combat); negative values work too&lt;br /&gt;
** '''movement_used''': determines how many movement points using this attack expends. By default all movement is used up, set this to 0 to make attacking with this attack expend no movement.&lt;br /&gt;
** '''attacks_used''': {{DevFeature1.17|12}} determines how many attacks this attack expends (default 1). This number is deducted from the unit's &amp;lt;tt&amp;gt;attacks_left&amp;lt;/tt&amp;gt; when they use this attack.&lt;br /&gt;
** '''attack_weight''': multiplier for total damage that the AI should use to choose which attack to use when attacking (and offer to player as default). Setting it to 0 disables the attack on attack. Until {{DevFeature1.19|2}} positive attack_weight was ignored.&lt;br /&gt;
** '''defense_weight''': used to determine which attack is used for retaliation. This affects gameplay, as the player is not allowed to determine his unit's retaliation weapon. Setting it to 0 disable the attacks on defense.&lt;br /&gt;
** '''alignment''': {{DevFeature1.19|5}} decouples the attack's alignment from the unit's alignment. One of ''lawful'', ''neutral'', ''chaotic'', ''liminal'' (See [[TimeWML]]). If unspecified, the unit alignment is used. Only useful for units with multiple attacks, otherwise you can change the unit alignment instead.&lt;br /&gt;
&lt;br /&gt;
== Other tags ==&lt;br /&gt;
* {{anchor|base_unit|'''[base_unit]'''}}: Contains one attribute, '''id''', which must be the ID of a unit type.  If specified, the UnitTypeWML for that unit is copied into this one, as if by [[InternalActionsWML#.5Bset_variables.5D|[set_variables]mode=merge]]. Additionally, the unit will be marked as variation of the base unit in its own help page, but not in the help page of the base unit.&lt;br /&gt;
&lt;br /&gt;
* '''[abilities]''': Defines the abilities of a unit. See [[AbilitiesWML]]&lt;br /&gt;
* '''abilities_list''': {{DevFeature1.19|17}} A comma-separated list of ability [[AbilitiesWML#Common_keys_and_tags_for_every_ability|'''unique_id''']]s. If defined in the registry [[UnitsWML#.5Babilities.5D|[units][abilities]]], these will be added to this unit type as if their full definition was included in '''[abilities]'''. Example: ''abilities=heals_8,regenerates''.&lt;br /&gt;
&lt;br /&gt;
* '''[event]''': Any [event] written inside the [unit_type] tag will get included into any scenario where a unit of this type appears in. Note that such events get included when a unit of this type first appears in the scenario, not automatically when the scenario begins (meaning that ''name=prestart'' events, for example, would usually never trigger). See [[EventWML]] and [[WML_Abilities|WML Abilities]]. {{DevFeature1.19|4}} Abilities support [event].&lt;br /&gt;
&lt;br /&gt;
* {{anchor|variation|'''[variation]'''}}: Defines a variation of a unit. Variations are invoked with an [effect] tag or the variation= attribute in [[SingleUnitWML]]. They are currently used for graphical variations (giving character sprites new weapons) but theoretically you could do anything with it.&lt;br /&gt;
** '''variation_id''': Mandatory. The value of '''variation=''' used in SingleUnitWML to choose this variant.&lt;br /&gt;
** '''variation_name''': Translatable. The name of the variation, which is displayed in the help and in debug mode. Not setting this looks bad unless combined with '''hide_help'''=yes.&lt;br /&gt;
** '''inherit''': if ''yes'', inherits all the properties of the base unit, as if by [[InternalActionsWML#.5Bset_variables.5D|[set_variables]mode=merge]]. Defaults to no.&lt;br /&gt;
*** The '''id''' key is always inherited, regardless of the value of '''inherit'''.&lt;br /&gt;
** All keys and tags of '''[unit_type]''', except ''[advancefrom]'', ''[base_unit]'', ''[female]'', ''[male]'', and ''[variation]''.&lt;br /&gt;
&lt;br /&gt;
* '''[male]''', '''[female]''': These can specify a variation based on gender for a unit. If these are provided, they will automatically apply based upon the gender of a unit.&lt;br /&gt;
** '''inherit''': if ''yes'', inherits all the properties of the base unit, as if by [[InternalActionsWML#.5Bset_variables.5D|[set_variables]mode=merge]]. Defaults to yes.&lt;br /&gt;
*** The '''id''' key is always inherited, regardless of the value of '''inherit'''.&lt;br /&gt;
** All '''[unit_type]''' tags and keys, excluding ''[advancefrom]'', ''[base_unit]'', ''[female]'', and ''[male]''.&lt;br /&gt;
* '''[trait]''': Adds an additional trait to the pool. See [[UnitsWML]] for the syntax.&lt;br /&gt;
* '''[special_note]''' {{DevFeature1.15|2}} see [[UnitTypeWML#Special_Notes|below]].&lt;br /&gt;
&lt;br /&gt;
== Special Notes ==&lt;br /&gt;
&lt;br /&gt;
Use of the '''[special_note]''' tags and attributes results in a bulleted list of special notes in the unit type's help page and in the sidebar tooltip for the unit type's name. Prior to 1.15.2, the old format for special notes was simply text included in the '''[unit_type]description''' attribute.&lt;br /&gt;
&lt;br /&gt;
Note that the sidebar tooltip shows the notes for the current unit, but opening the help-browser by right-clicking on a unit shows the notes for generic units of that type. These can be different if the unit has '''[modifications]'''.&lt;br /&gt;
&lt;br /&gt;
Text given in the following attributes will be collected and shown as the special notes for units and unit types:&lt;br /&gt;
&lt;br /&gt;
* {{DevFeature1.15|2}} [unit_type][special_note]note=&lt;br /&gt;
* {{DevFeature1.15|2}} [unit][special_note]note= (these are used ''instead of'' any defined in the [unit_type])&lt;br /&gt;
* {{DevFeature1.15|14}} [movetype][special_note]note=&lt;br /&gt;
* {{DevFeature1.15|14}} [''ability tag name'']special_note=&lt;br /&gt;
* {{DevFeature1.15|14}} [attack][specials][''special tag name'']special_note=&lt;br /&gt;
* {{DevFeature1.15|14}} [language]special_note_damage_type_''TYPE''=&lt;br /&gt;
    &lt;br /&gt;
It's no longer necessary to put these notes in each unit_type's .cfg file, and the macros for doing so are now deprecated.&lt;br /&gt;
&lt;br /&gt;
== Removed keys ==&lt;br /&gt;
&lt;br /&gt;
These don't work any more, the documentation is left here as an aid to porting old code.&lt;br /&gt;
&lt;br /&gt;
* {{anchor|advancefrom|'''[advancefrom]'''}}: {{DevFeature1.15|4}} replaced by [[ModificationWML|[modify_unit_type]]]. Defines the previous unit type on the advancement tree. Allows a campaign-specific unit to be spliced into an already existing advancement tree.  It should generally be used only inside a campaign ifdef, to prevent changes to other campaigns. Since all multiplayer content shares MULTIPLAYER define, using advancefrom changes unit type even if the addon is not actively used. For that reason multiplayer advancefrom may only be used with unit types defined in the same addon - then everyone who has the unit has it with same advancements.  This tag makes changes to the ''advances_to'' and ''experience'' keys of a base unit to make it advance into this unit.  It takes these keys:&lt;br /&gt;
** ''unit'': the id of the base unit from which this unit advances.  This adds the unit into the list of units which ''unit'' can advance into.&lt;br /&gt;
** ''experience'': (optional) If present the experience needed to advance is set to this value. If there are more than one [advancefrom] tags referencing the same base unit within the same preprocessor scope (e.g. a campaign #ifdef) with experience= keys, the lowest value of these is chosen.  Note: this will also lower the experience required to advance to other units which the base unit can advance into.&lt;br /&gt;
: If the previous unit type makes use of '''[male]''' and/or '''[female]''' tags, then the current (new) unit type is expected to also. That is, the subtypes defined by those tags will only receive this advancement if the new type has a corresponding tag.&lt;br /&gt;
{{DevFeature1.15|4}} '''[advancefrom]''' was effectively removed in 1.15.4. The intention was to deprecate it, but  the compatibility code that was meant to support it in 1.16 was untested and nonfunctional.&lt;br /&gt;
&lt;br /&gt;
== Deprecating units ==&lt;br /&gt;
&lt;br /&gt;
A macro is provided for deprecating a unit, which uses the built-in deprecation system but hard-codes the level to 3 (meaning &amp;quot;for removal&amp;quot;). The syntax is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=wml&amp;gt;{DEPRECATED_UNIT old_id new_id version}&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can also set the new_id to an empty string if there is no replacement.&lt;br /&gt;
&lt;br /&gt;
== See Also ==&lt;br /&gt;
&lt;br /&gt;
* [[AnimationWML]]&lt;br /&gt;
* [[ReferenceWML]]&lt;br /&gt;
* [[TerrainWML]]&lt;br /&gt;
&lt;br /&gt;
[[Category: WML Reference]]&lt;/div&gt;</summary>
		<author><name>Soliton</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.wesnoth.org/index.php?title=Cpp_features_blocked_by_version&amp;diff=74649</id>
		<title>Cpp features blocked by version</title>
		<link rel="alternate" type="text/html" href="https://wiki.wesnoth.org/index.php?title=Cpp_features_blocked_by_version&amp;diff=74649"/>
		<updated>2025-11-28T22:35:16Z</updated>

		<summary type="html">&lt;p&gt;Soliton: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Summary ==&lt;br /&gt;
This is a listing of C++ features that would be useful to have but can't yet be used. The Feature column is the language or standard library feature (https://en.cppreference.com/w/cpp/compiler_support is a good reference). The Benefit column is what having this feature will allow to be done. The remaining three columns are for the minimum requirements for the feature to be available on each platform. The minimum requirements can be anything - Visual Studio version, compiler version, OS version, etc.&lt;br /&gt;
&lt;br /&gt;
== Benefits that don't justify version increases ==&lt;br /&gt;
This is a non-exhaustive list:&lt;br /&gt;
* Improving compile speed.&lt;br /&gt;
* Pretty much any standard library feature that we can just as well get through boost or other means.&lt;br /&gt;
* Core language features that allow writing more succinct code.&lt;br /&gt;
&lt;br /&gt;
== Benefits that do justify version increases ==&lt;br /&gt;
This is a non-exhaustive list:&lt;br /&gt;
* Required to fix a bug that has a significant impact to players.&lt;br /&gt;
* Core language features that make classes of bugs impossible or significantly harder to accidentally introduce.&lt;br /&gt;
* Required to fix a relevant security vulnerability.&lt;br /&gt;
* A group of multiple smaller features that individually don't justify a version increase, if there's minimal to no impact to developers and players.&lt;br /&gt;
&lt;br /&gt;
== Features ==&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Feature !! Benefit !! Windows !! macOS !! Linux !! Notes&lt;br /&gt;
|-&lt;br /&gt;
| Modules || Faster compile time || Unknown || Unknown || Unknown || While part of C++20, usable support seems to be progressing very slowly.&lt;br /&gt;
|-&lt;br /&gt;
| std::starts_with and ends_with || Simplies string checking in various places, including filesystem || MSVC STL 19.21 (VS 2019 16.1) || Apple Clang 10.0.0 (Xcode 10.0 beta (10L176w), 10.0 (10A255), 10.1 (10B61)) || GCC libstdc++ 9/Clang libc++ 6 || Boost offers similar functions.&lt;br /&gt;
|-&lt;br /&gt;
| std::format || Cleans up our numerous uses of manual string concatenation, especially with pango strings in the UI || Unknown || Unknown || Unknown || The wesnoth variable substitution facility offers similar functions, though with a little less versatility (but it could be extended).&lt;br /&gt;
|-&lt;br /&gt;
| std::span || Potential to reduce templates where we only need a container view || Unknown || Unknown || Unknown || &lt;br /&gt;
|-&lt;br /&gt;
| Concepts || Cleaner template requirements (increased code clarity) || Unknown || Unknown || Unknown || https://gcc.gnu.org/bugzilla/show_bug.cgi?id=concepts&lt;br /&gt;
|-&lt;br /&gt;
| Standard feature check macros || Ability to enable features on an individual basis without doing a whole-language flag || Unknown || Unknown || Unknown || Clang and likely GCC already support them on older versions as an extension.&lt;br /&gt;
|-&lt;br /&gt;
| std::filesystem || || Unknown || Just need to target 10.15 || Unknown || We do have boost....&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
[[Category:Development]]&lt;/div&gt;</summary>
		<author><name>Soliton</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.wesnoth.org/index.php?title=Context-free_grammar&amp;diff=74635</id>
		<title>Context-free grammar</title>
		<link rel="alternate" type="text/html" href="https://wiki.wesnoth.org/index.php?title=Context-free_grammar&amp;diff=74635"/>
		<updated>2025-11-19T10:58:26Z</updated>

		<summary type="html">&lt;p&gt;Soliton: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Context-free grammar can be used to generate random strings, from short words to entire paragraphs. If you are interested in its theory, read more on [https://en.wikipedia.org/wiki/Context-free_grammar Wikipedia's article on the topic].&lt;br /&gt;
&lt;br /&gt;
== Syntax ==&lt;br /&gt;
In WML, it uses its own simple syntax. It is usually a translatable string and should be in &amp;lt;nowiki&amp;gt;&amp;lt;&amp;lt;strong quotes&amp;gt;&amp;gt;&amp;lt;/nowiki&amp;gt;. The code is composed from nonterminals. They are written on separate lines. Each nonterminal is substituted by one of its possibilities separated by the '''|''' symbol, the name is separated from possibilities with '''='''. The nonterminal that makes the result is named &amp;lt;nowiki&amp;gt;main&amp;lt;/nowiki&amp;gt;. The possibilities can contain other nonterminals, marked by &amp;lt;nowiki&amp;gt;{curly brackets}&amp;lt;/nowiki&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Including literal vertical bars or curly braces can be done by using the following predefined nonterminals:&lt;br /&gt;
* &amp;lt;code&amp;gt;{!}&amp;lt;/code&amp;gt; - expands to a |&lt;br /&gt;
* &amp;lt;code&amp;gt;{(}&amp;lt;/code&amp;gt; - expands to a {&lt;br /&gt;
* &amp;lt;code&amp;gt;{)}&amp;lt;/code&amp;gt; - expands to a }&lt;br /&gt;
&lt;br /&gt;
== Examples ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=wml&amp;gt;&lt;br /&gt;
name_generator= _ &amp;lt;&amp;lt;&lt;br /&gt;
    main=Hello world|Hi world|Ahoi world&lt;br /&gt;
&amp;gt;&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The result is either ''Hello world'' or ''Hi world'' or ''Ahoi world''.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=wml&amp;gt;&lt;br /&gt;
name_generator= _ &amp;lt;&amp;lt;&lt;br /&gt;
    main=Hello {noun}|Hi {noun}&lt;br /&gt;
    noun=world|planet|Universe|Earth&lt;br /&gt;
&amp;gt;&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The result is either ''Hello'' or ''Hi'', followed by one of the four possible nouns, ''world'', ''planet'', ''Universe'' or ''Earth''.&lt;br /&gt;
&lt;br /&gt;
== Other rules ==&lt;br /&gt;
A nonterminal can reference itself, which can, under the right circumstances, lead to a loop that expands indefinitely, causing a stack overflow. Avoid this unless you really know what you are doing.&lt;br /&gt;
&lt;br /&gt;
Each nonterminal has a reduced probability for possibilities that were chosen the last time.&lt;br /&gt;
&lt;br /&gt;
== External links ==&lt;br /&gt;
* [https://dugy.github.io/?M2NvbvRmdWzsbGFu5zJzb3VyY+V0eXDlf21haW49e0hlbGxvfSwge3Zpc2l0b3J9IQpIZWxsbz1IZWxsb3xIZXl8V2VsY29tZQp2aXNpdG9yPXZpc2l0b3J8ZnJpZW5kfHBhbABjY2ZnAkA= Dugi's online context-free grammar tester] (warning: if opening, be sure to do so in a new tab)&lt;/div&gt;</summary>
		<author><name>Soliton</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.wesnoth.org/index.php?title=Context-free_grammar&amp;diff=74634</id>
		<title>Context-free grammar</title>
		<link rel="alternate" type="text/html" href="https://wiki.wesnoth.org/index.php?title=Context-free_grammar&amp;diff=74634"/>
		<updated>2025-11-19T10:53:40Z</updated>

		<summary type="html">&lt;p&gt;Soliton: /* Syntax */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Context-free grammar can be used to generate random strings, from short words to entire paragraphs. If you are interested in its theory, read more on [https://en.wikipedia.org/wiki/Context-free_grammar Wikipedia's article on the topic].&lt;br /&gt;
&lt;br /&gt;
== Syntax ==&lt;br /&gt;
In WML, it uses its own simple syntax. It is usually a translatable string and should be in &amp;lt;nowiki&amp;gt;&amp;lt;&amp;lt;strong quotes&amp;gt;&amp;gt;&amp;lt;/nowiki&amp;gt;. The code is composed from nonterminals. They are written on separate lines. Each nonterminal is substituted by one of its possibilities separated by the '''|''' symbol, the name is separated from possibilities with '''='''. The nonterminal that makes the result is named &amp;lt;nowiki&amp;gt;main&amp;lt;/nowiki&amp;gt;. The possibilities can contain other nonterminals, marked by &amp;lt;nowiki&amp;gt;{curly brackets}&amp;lt;/nowiki&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Examples ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=wml&amp;gt;&lt;br /&gt;
name_generator= _ &amp;lt;&amp;lt;&lt;br /&gt;
    main=Hello world|Hi world|Ahoi world&lt;br /&gt;
&amp;gt;&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The result is either ''Hello world'' or ''Hi world'' or ''Ahoi world''.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=wml&amp;gt;&lt;br /&gt;
name_generator= _ &amp;lt;&amp;lt;&lt;br /&gt;
    main=Hello {noun}|Hi {noun}&lt;br /&gt;
    noun=world|planet|Universe|Earth&lt;br /&gt;
&amp;gt;&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The result is either ''Hello'' or ''Hi'', followed by one of the four possible nouns, ''world'', ''planet'', ''Universe'' or ''Earth''.&lt;br /&gt;
&lt;br /&gt;
== Other rules ==&lt;br /&gt;
A nonterminal can reference itself, which can, under the right circumstances, lead to a loop that expands indefinitely, causing a stack overflow. Avoid this unless you really know what you are doing.&lt;br /&gt;
&lt;br /&gt;
Each nonterminal has a reduced probability for possibilities that were chosen the last time.&lt;br /&gt;
&lt;br /&gt;
A production may include vertical bars or curly braces by using the following predefined nonterminals:&lt;br /&gt;
* &amp;lt;code&amp;gt;{!}&amp;lt;/code&amp;gt; - expands to a |&lt;br /&gt;
* &amp;lt;code&amp;gt;{(}&amp;lt;/code&amp;gt; - expands to a {&lt;br /&gt;
* &amp;lt;code&amp;gt;{)}&amp;lt;/code&amp;gt; - expands to a }&lt;br /&gt;
&lt;br /&gt;
== External links ==&lt;br /&gt;
* [https://dugy.github.io/?M2NvbvRmdWzsbGFu5zJzb3VyY+V0eXDlf21haW49e0hlbGxvfSwge3Zpc2l0b3J9IQpIZWxsbz1IZWxsb3xIZXl8V2VsY29tZQp2aXNpdG9yPXZpc2l0b3J8ZnJpZW5kfHBhbABjY2ZnAkA= Dugi's online context-free grammar tester] (warning: if opening, be sure to do so in a new tab)&lt;/div&gt;</summary>
		<author><name>Soliton</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.wesnoth.org/index.php?title=Android&amp;diff=74547</id>
		<title>Android</title>
		<link rel="alternate" type="text/html" href="https://wiki.wesnoth.org/index.php?title=Android&amp;diff=74547"/>
		<updated>2025-10-02T11:04:15Z</updated>

		<summary type="html">&lt;p&gt;Soliton: /* Other version code scheme drafts */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This pages contains some specific information about the Battle for Wesnoth new Android port (1.19+)&lt;br /&gt;
&lt;br /&gt;
== Playing controls ==&lt;br /&gt;
* Tap a unit to select/deselect it.&lt;br /&gt;
* Tap a unit, then tap the target hex to show defense stats of that unit and footsteps. (Similar to hover on PC)&lt;br /&gt;
* Tap a unit, then double tap on the target hex to move it. Alternative, you can drag along the path to choose the exact path which the unit is supposed to move by.&lt;br /&gt;
* Drag from attacker unit towards attacked unit to attack.&lt;br /&gt;
&lt;br /&gt;
== The Settings menu (Splash screen) ==&lt;br /&gt;
&lt;br /&gt;
== Logs and debugging steps ==&lt;br /&gt;
* Install adb (Android Debug Bridge) on your computer. Search internet for information about your OS. Install drivers for your phone/tablet if necessary.&lt;br /&gt;
* Enable Developer Mode on your Android device (phone/tablet). Again, the internet is your friend. On newer devices, you need tap Settings &amp;gt; About Phone &amp;gt; Build Number 7 times until it says &amp;quot;You are now a developer&amp;quot;, then go into the Setting &amp;gt; System &amp;gt; Developer Options (newly appeared), and find &amp;quot;USB Debugging&amp;quot; in the menu and turn that on.&lt;br /&gt;
* Connect phone to PC. Do &amp;lt;code&amp;gt;adb logcat&amp;lt;/code&amp;gt; or similar from a terminal/command prompt to see if your device appears on the list and is authorized. Tap ok on your phone if any permission request appears.&lt;br /&gt;
* Run &amp;lt;code&amp;gt;adb logcat -c&amp;lt;/code&amp;gt; (clears existing logs), then &amp;lt;code&amp;gt;adb logcat &amp;gt; log.txt&amp;lt;/code&amp;gt; (or &amp;lt;code&amp;gt;adb logcat&amp;lt;/code&amp;gt; and copy from terminal). Run Wesnoth on phone. Reproduce the crash.&lt;br /&gt;
* stop &amp;lt;code&amp;gt;adb logcat&amp;lt;/code&amp;gt; on PC, and attach the &amp;lt;code&amp;gt;log.txt&amp;lt;/code&amp;gt; to your issue report on github along with detailed steps of the bug, and use the Android label.&lt;br /&gt;
&lt;br /&gt;
(Note: adb can be &amp;lt;code&amp;gt;./adb.exe&amp;lt;/code&amp;gt; on Windows. Use internet for help on any of the steps if needed, this is supposed to be a preliminary guideline. Steps might slightly differ based on manufacturer or Android version.)&lt;br /&gt;
&lt;br /&gt;
=== Enabling taps ===&lt;br /&gt;
It is useful for debugging purposes, especially if you're sharing a screen recording of your bug, to show where you're tapping on the screen in the screen recording. See [https://discussio.zendesk.com/hc/en-gb/articles/4625151970065-How-to-Show-Taps-for-Mobile-Screen-Sharing-on-Android here] for how to enable that.&lt;br /&gt;
&lt;br /&gt;
=== Turning off Developer Mode ===&lt;br /&gt;
Go to System &amp;gt; Developer Options and turn off  the '''Use developer options''' toggle.&lt;br /&gt;
&lt;br /&gt;
=== Dev Notes ===&lt;br /&gt;
==== Version Code scheme (1191601001 - post 1.19.16 fixup) ====&lt;br /&gt;
&amp;lt;code&amp;gt;MmmPPppVVV&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Where,&lt;br /&gt;
* &amp;lt;code&amp;gt;M&amp;lt;/code&amp;gt; - Major version code, so far at 1; since the max versionCode is 21000000 it can go up to 2&lt;br /&gt;
* &amp;lt;code&amp;gt;mm&amp;lt;/code&amp;gt; - Minor version code.&lt;br /&gt;
* &amp;lt;code&amp;gt;PP&amp;lt;/code&amp;gt; - Patch version code.&lt;br /&gt;
* &amp;lt;code&amp;gt;pp&amp;lt;/code&amp;gt; - Android patch version/any other use.&lt;br /&gt;
* &amp;lt;code&amp;gt;VVV&amp;lt;/code&amp;gt; - Reserved for ABI/Variants.&lt;br /&gt;
** Last digit - ABI (&amp;lt;code&amp;gt;['armeabi-v7a': 1, 'arm64-v8a': 2, 'x86': 3, 'x86_64': 4]&amp;lt;/code&amp;gt;)&lt;br /&gt;
** Rest unused (variants if we need them)&lt;br /&gt;
&lt;br /&gt;
==== New Version Code scheme draft ====&lt;br /&gt;
This is but one possible idea among many, and is not final.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;MSUUmmPPppVV&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Where,&lt;br /&gt;
* 1 - Major version code. Wesnoth's version's first digit is almost always 1, but the max versionCode is 21000000 so it can go upto 2 if needed.&lt;br /&gt;
* S - store identifier (must be greater than 2 to allow upgrade from previous scheme.) For example:&lt;br /&gt;
** &amp;lt;code&amp;gt;2&amp;lt;/code&amp;gt; - F-Droid&lt;br /&gt;
** &amp;lt;code&amp;gt;3&amp;lt;/code&amp;gt; - Google Play&lt;br /&gt;
** Others if needed.&lt;br /&gt;
* UU - unused/unspecified.&lt;br /&gt;
* mm - Minor version&lt;br /&gt;
* PP - Patch version&lt;br /&gt;
* pp - Android Patch version&lt;br /&gt;
* VV - ABI/Variants&lt;br /&gt;
** Last digit - ABI (&amp;lt;code&amp;gt;['armeabi-v7a': 1, 'arm64-v8a': 2, 'x86': 3, 'x86_64': 4]&amp;lt;/code&amp;gt;)&lt;br /&gt;
** Last but one digit - Unused (variants if we need them)&lt;br /&gt;
&lt;br /&gt;
E.g., 1.20.14 with hotfix 1, Fdroid, arm64 ABI would be: &amp;lt;code&amp;gt;120020140102&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==== Other version code scheme drafts ====&lt;br /&gt;
&lt;br /&gt;
Given that we only have 10 digits to work with (max being 2.1e9, which is signed INT_MAX with some margin), the above scheme is not possible. The PR to remove/disable the existing version codes on f-droid has been rejected, so we're probably stuck with version codes &amp;gt; 1.19e9. &lt;br /&gt;
The highest version code currently (2025-10-02) in use is 1191601002.&lt;br /&gt;
&lt;br /&gt;
Further constraints are:&lt;br /&gt;
* version codes should go up&lt;br /&gt;
* each ABI needs its own version code&lt;br /&gt;
* we may have multiple APK releases for one &amp;quot;regular wesnoth version&amp;quot; to fix android-only issues (android patch version)&lt;br /&gt;
* we may have builds that differ per store (F-droid creates the file /data/dist with contents &amp;quot;F-Droid&amp;quot; during the build process)&lt;br /&gt;
* we may want various variants of builds, that is, a &amp;quot;clean&amp;quot; build, a build with google play integrations, a build with a different integration, and so on. This may or may not be tied to the store the APK is distributed on&lt;br /&gt;
&lt;br /&gt;
Drafts of possible approaches:&lt;br /&gt;
&lt;br /&gt;
===== &amp;lt;code&amp;gt;MMMPPpxxVA&amp;lt;/code&amp;gt; =====&lt;br /&gt;
* MMM - Combined Major/Minor: 1.19 = 119, but each subsequent minor *or* major bump increases this number by 1. This remains visually the same until 2.0 happens.&lt;br /&gt;
* PP - Patch version&lt;br /&gt;
* p - Android patch version&lt;br /&gt;
* V - Build variant (0 is clean, 1 might be google play integrations. Could be a bitfield or an enum)&lt;br /&gt;
* A - ABI (as above)&lt;br /&gt;
* x - Unspecified, available for expanding these fields or adding other flags (like store and/or integrations)&lt;br /&gt;
&lt;br /&gt;
Example: &amp;lt;code&amp;gt;1220320002&amp;lt;/code&amp;gt; would be version 1.22 (or 2.0 or 2.2, but 2 stables from 1.18), patch 3, android patch 2, default (clean) variant, arm64&lt;br /&gt;
&lt;br /&gt;
===== &amp;lt;code&amp;gt;12MMMPPpVA&amp;lt;/code&amp;gt; =====&lt;br /&gt;
Basically the same thing, just shifted to the right by eating up the unspecified digits, and with the first digits fixed to 12. Leaves 8 &amp;quot;additional epochs&amp;quot; available for future expansion.&lt;br /&gt;
&lt;br /&gt;
Example: &amp;lt;code&amp;gt;1212203202&amp;lt;/code&amp;gt; would be version 1.22.3.2 clean arm64, as above.&lt;br /&gt;
&lt;br /&gt;
===== &amp;lt;code&amp;gt;12MMPPpxVA&amp;lt;/code&amp;gt; =====&lt;br /&gt;
Removes the major version digit, freeing up 1 digit. Not functionally different from the major-minor scheme, but reduces the number of available version bumps until epoch change.&lt;br /&gt;
&lt;br /&gt;
Example: &amp;lt;code&amp;gt;1222032002&amp;lt;/code&amp;gt; would be version 1.22.3.2 clean arm64, as above.&lt;/div&gt;</summary>
		<author><name>Soliton</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.wesnoth.org/index.php?title=Android&amp;diff=74538</id>
		<title>Android</title>
		<link rel="alternate" type="text/html" href="https://wiki.wesnoth.org/index.php?title=Android&amp;diff=74538"/>
		<updated>2025-10-01T09:18:52Z</updated>

		<summary type="html">&lt;p&gt;Soliton: /* Version Code scheme (1.19.16) */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This pages contains some specific information about the Battle for Wesnoth new Android port (1.19+)&lt;br /&gt;
&lt;br /&gt;
== Playing controls ==&lt;br /&gt;
* Tap a unit to select/deselect it.&lt;br /&gt;
* Tap a unit, then tap the target hex to show defense stats of that unit and footsteps. (Similar to hover on PC)&lt;br /&gt;
* Tap a unit, then double tap on the target hex to move it. Alternative, you can drag along the path to choose the exact path which the unit is supposed to move by.&lt;br /&gt;
* Drag from attacker unit towards attacked unit to attack.&lt;br /&gt;
&lt;br /&gt;
== The Settings menu (Splash screen) ==&lt;br /&gt;
&lt;br /&gt;
== Logs and debugging steps ==&lt;br /&gt;
* Install adb (Android Debug Bridge) on your computer. Search internet for information about your OS. Install drivers for your phone/tablet if necessary.&lt;br /&gt;
* Enable Developer Mode on your Android device (phone/tablet). Again, the internet is your friend. On newer devices, you need tap Settings &amp;gt; About Phone &amp;gt; Build Number 7 times until it says &amp;quot;You are now a developer&amp;quot;, then go into the Setting &amp;gt; System &amp;gt; Developer Options (newly appeared), and find &amp;quot;USB Debugging&amp;quot; in the menu and turn that on.&lt;br /&gt;
* Connect phone to PC. Do &amp;lt;code&amp;gt;adb logcat&amp;lt;/code&amp;gt; or similar from a terminal/command prompt to see if your device appears on the list and is authorized. Tap ok on your phone if any permission request appears.&lt;br /&gt;
* Run &amp;lt;code&amp;gt;adb logcat -c&amp;lt;/code&amp;gt; (clears existing logs), then &amp;lt;code&amp;gt;adb logcat &amp;gt; log.txt&amp;lt;/code&amp;gt; (or &amp;lt;code&amp;gt;adb logcat&amp;lt;/code&amp;gt; and copy from terminal). Run Wesnoth on phone. Reproduce the crash.&lt;br /&gt;
* stop &amp;lt;code&amp;gt;adb logcat&amp;lt;/code&amp;gt; on PC, and attach the &amp;lt;code&amp;gt;log.txt&amp;lt;/code&amp;gt; to your issue report on github along with detailed steps of the bug, and use the Android label.&lt;br /&gt;
&lt;br /&gt;
(Note: adb can be &amp;lt;code&amp;gt;./adb.exe&amp;lt;/code&amp;gt; on Windows. Use internet for help on any of the steps if needed, this is supposed to be a preliminary guideline. Steps might slightly differ based on manufacturer or Android version.)&lt;br /&gt;
&lt;br /&gt;
=== Enabling taps ===&lt;br /&gt;
It is useful for debugging purposes, especially if you're sharing a screen recording of your bug, to show where you're tapping on the screen in the screen recording. See [https://discussio.zendesk.com/hc/en-gb/articles/4625151970065-How-to-Show-Taps-for-Mobile-Screen-Sharing-on-Android here] for how to enable that.&lt;br /&gt;
&lt;br /&gt;
=== Turning off Developer Mode ===&lt;br /&gt;
Go to System &amp;gt; Developer Options and turn off  the '''Use developer options''' toggle.&lt;br /&gt;
&lt;br /&gt;
=== Dev Notes ===&lt;br /&gt;
==== Version Code scheme (1191601001 - post 1.19.16 fixup) ====&lt;br /&gt;
&amp;lt;code&amp;gt;MmmPPppVVV&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Where,&lt;br /&gt;
* &amp;lt;code&amp;gt;M&amp;lt;/code&amp;gt; - Major version code, so far at 1; since the max versionCode is 21000000 it can go up to 2&lt;br /&gt;
* &amp;lt;code&amp;gt;mm&amp;lt;/code&amp;gt; - Minor version code.&lt;br /&gt;
* &amp;lt;code&amp;gt;PP&amp;lt;/code&amp;gt; - Patch version code.&lt;br /&gt;
* &amp;lt;code&amp;gt;pp&amp;lt;/code&amp;gt; - Android patch version/any other use.&lt;br /&gt;
* &amp;lt;code&amp;gt;VVV&amp;lt;/code&amp;gt; - Reserved for ABI/Variants.&lt;br /&gt;
** Last digit - ABI (&amp;lt;code&amp;gt;['armeabi-v7a': 1, 'arm64-v8a': 2, 'x86': 3, 'x86_64': 4]&amp;lt;/code&amp;gt;)&lt;br /&gt;
** Rest unused (variants if we need them)&lt;br /&gt;
&lt;br /&gt;
==== New Version Code scheme draft ====&lt;br /&gt;
This is but one possible idea among many, and is not final.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;1SUUMMmmPPVV&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Where,&lt;br /&gt;
* 1 - since Wesnoth first digit is almost always 1 and the max versionCode is 21000000.&lt;br /&gt;
* S - store identifier (must be greater than 2 to allow upgrade from previous scheme.) For example:&lt;br /&gt;
** &amp;lt;code&amp;gt;2&amp;lt;/code&amp;gt; - F-Droid&lt;br /&gt;
** &amp;lt;code&amp;gt;3&amp;lt;/code&amp;gt; - Google Play&lt;br /&gt;
** Others if needed.&lt;br /&gt;
* UU - unused/unspecified.&lt;br /&gt;
* MM - Major version&lt;br /&gt;
* mm - Minor version&lt;br /&gt;
* PP - Patch version&lt;br /&gt;
* VV - ABI/Variants&lt;br /&gt;
** Last digit - ABI (&amp;lt;code&amp;gt;['armeabi-v7a': 1, 'arm64-v8a': 2, 'x86': 3, 'x86_64': 4]&amp;lt;/code&amp;gt;)&lt;br /&gt;
** Last but one digit - Unused (variants if we need them)&lt;/div&gt;</summary>
		<author><name>Soliton</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.wesnoth.org/index.php?title=Android&amp;diff=74537</id>
		<title>Android</title>
		<link rel="alternate" type="text/html" href="https://wiki.wesnoth.org/index.php?title=Android&amp;diff=74537"/>
		<updated>2025-10-01T09:16:40Z</updated>

		<summary type="html">&lt;p&gt;Soliton: /* Version Code scheme (1.19.16) */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This pages contains some specific information about the Battle for Wesnoth new Android port (1.19+)&lt;br /&gt;
&lt;br /&gt;
== Playing controls ==&lt;br /&gt;
* Tap a unit to select/deselect it.&lt;br /&gt;
* Tap a unit, then tap the target hex to show defense stats of that unit and footsteps. (Similar to hover on PC)&lt;br /&gt;
* Tap a unit, then double tap on the target hex to move it. Alternative, you can drag along the path to choose the exact path which the unit is supposed to move by.&lt;br /&gt;
* Drag from attacker unit towards attacked unit to attack.&lt;br /&gt;
&lt;br /&gt;
== The Settings menu (Splash screen) ==&lt;br /&gt;
&lt;br /&gt;
== Logs and debugging steps ==&lt;br /&gt;
* Install adb (Android Debug Bridge) on your computer. Search internet for information about your OS. Install drivers for your phone/tablet if necessary.&lt;br /&gt;
* Enable Developer Mode on your Android device (phone/tablet). Again, the internet is your friend. On newer devices, you need tap Settings &amp;gt; About Phone &amp;gt; Build Number 7 times until it says &amp;quot;You are now a developer&amp;quot;, then go into the Setting &amp;gt; System &amp;gt; Developer Options (newly appeared), and find &amp;quot;USB Debugging&amp;quot; in the menu and turn that on.&lt;br /&gt;
* Connect phone to PC. Do &amp;lt;code&amp;gt;adb logcat&amp;lt;/code&amp;gt; or similar from a terminal/command prompt to see if your device appears on the list and is authorized. Tap ok on your phone if any permission request appears.&lt;br /&gt;
* Run &amp;lt;code&amp;gt;adb logcat -c&amp;lt;/code&amp;gt; (clears existing logs), then &amp;lt;code&amp;gt;adb logcat &amp;gt; log.txt&amp;lt;/code&amp;gt; (or &amp;lt;code&amp;gt;adb logcat&amp;lt;/code&amp;gt; and copy from terminal). Run Wesnoth on phone. Reproduce the crash.&lt;br /&gt;
* stop &amp;lt;code&amp;gt;adb logcat&amp;lt;/code&amp;gt; on PC, and attach the &amp;lt;code&amp;gt;log.txt&amp;lt;/code&amp;gt; to your issue report on github along with detailed steps of the bug, and use the Android label.&lt;br /&gt;
&lt;br /&gt;
(Note: adb can be &amp;lt;code&amp;gt;./adb.exe&amp;lt;/code&amp;gt; on Windows. Use internet for help on any of the steps if needed, this is supposed to be a preliminary guideline. Steps might slightly differ based on manufacturer or Android version.)&lt;br /&gt;
&lt;br /&gt;
=== Enabling taps ===&lt;br /&gt;
It is useful for debugging purposes, especially if you're sharing a screen recording of your bug, to show where you're tapping on the screen in the screen recording. See [https://discussio.zendesk.com/hc/en-gb/articles/4625151970065-How-to-Show-Taps-for-Mobile-Screen-Sharing-on-Android here] for how to enable that.&lt;br /&gt;
&lt;br /&gt;
=== Turning off Developer Mode ===&lt;br /&gt;
Go to System &amp;gt; Developer Options and turn off  the '''Use developer options''' toggle.&lt;br /&gt;
&lt;br /&gt;
=== Dev Notes ===&lt;br /&gt;
==== Version Code scheme (1.19.16) ====&lt;br /&gt;
&amp;lt;code&amp;gt;MmmPPppVVV&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Where,&lt;br /&gt;
* &amp;lt;code&amp;gt;M&amp;lt;/code&amp;gt; - Major version code, so far at 1; since the max versionCode is 21000000 it can go up to 2&lt;br /&gt;
* &amp;lt;code&amp;gt;mm&amp;lt;/code&amp;gt; - Minor version code.&lt;br /&gt;
* &amp;lt;code&amp;gt;PP&amp;lt;/code&amp;gt; - Patch version code.&lt;br /&gt;
* &amp;lt;code&amp;gt;pp&amp;lt;/code&amp;gt; - Android patch version/any other use.&lt;br /&gt;
* &amp;lt;code&amp;gt;VVV&amp;lt;/code&amp;gt; - Reserved for ABI/Variants.&lt;br /&gt;
** Last digit - ABI (&amp;lt;code&amp;gt;['armeabi-v7a': 1, 'arm64-v8a': 2, 'x86': 3, 'x86_64': 4]&amp;lt;/code&amp;gt;)&lt;br /&gt;
** Rest unused (variants if we need them)&lt;br /&gt;
&lt;br /&gt;
==== New Version Code scheme draft ====&lt;br /&gt;
This is but one possible idea among many, and is not final.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;1SUUMMmmPPVV&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Where,&lt;br /&gt;
* 1 - since Wesnoth first digit is almost always 1 and the max versionCode is 21000000.&lt;br /&gt;
* S - store identifier (must be greater than 2 to allow upgrade from previous scheme.) For example:&lt;br /&gt;
** &amp;lt;code&amp;gt;2&amp;lt;/code&amp;gt; - F-Droid&lt;br /&gt;
** &amp;lt;code&amp;gt;3&amp;lt;/code&amp;gt; - Google Play&lt;br /&gt;
** Others if needed.&lt;br /&gt;
* UU - unused/unspecified.&lt;br /&gt;
* MM - Major version&lt;br /&gt;
* mm - Minor version&lt;br /&gt;
* PP - Patch version&lt;br /&gt;
* VV - ABI/Variants&lt;br /&gt;
** Last digit - ABI (&amp;lt;code&amp;gt;['armeabi-v7a': 1, 'arm64-v8a': 2, 'x86': 3, 'x86_64': 4]&amp;lt;/code&amp;gt;)&lt;br /&gt;
** Last but one digit - Unused (variants if we need them)&lt;/div&gt;</summary>
		<author><name>Soliton</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.wesnoth.org/index.php?title=Android&amp;diff=74536</id>
		<title>Android</title>
		<link rel="alternate" type="text/html" href="https://wiki.wesnoth.org/index.php?title=Android&amp;diff=74536"/>
		<updated>2025-10-01T09:15:53Z</updated>

		<summary type="html">&lt;p&gt;Soliton: /* Version Code scheme (1.19.16) */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This pages contains some specific information about the Battle for Wesnoth new Android port (1.19+)&lt;br /&gt;
&lt;br /&gt;
== Playing controls ==&lt;br /&gt;
* Tap a unit to select/deselect it.&lt;br /&gt;
* Tap a unit, then tap the target hex to show defense stats of that unit and footsteps. (Similar to hover on PC)&lt;br /&gt;
* Tap a unit, then double tap on the target hex to move it. Alternative, you can drag along the path to choose the exact path which the unit is supposed to move by.&lt;br /&gt;
* Drag from attacker unit towards attacked unit to attack.&lt;br /&gt;
&lt;br /&gt;
== The Settings menu (Splash screen) ==&lt;br /&gt;
&lt;br /&gt;
== Logs and debugging steps ==&lt;br /&gt;
* Install adb (Android Debug Bridge) on your computer. Search internet for information about your OS. Install drivers for your phone/tablet if necessary.&lt;br /&gt;
* Enable Developer Mode on your Android device (phone/tablet). Again, the internet is your friend. On newer devices, you need tap Settings &amp;gt; About Phone &amp;gt; Build Number 7 times until it says &amp;quot;You are now a developer&amp;quot;, then go into the Setting &amp;gt; System &amp;gt; Developer Options (newly appeared), and find &amp;quot;USB Debugging&amp;quot; in the menu and turn that on.&lt;br /&gt;
* Connect phone to PC. Do &amp;lt;code&amp;gt;adb logcat&amp;lt;/code&amp;gt; or similar from a terminal/command prompt to see if your device appears on the list and is authorized. Tap ok on your phone if any permission request appears.&lt;br /&gt;
* Run &amp;lt;code&amp;gt;adb logcat -c&amp;lt;/code&amp;gt; (clears existing logs), then &amp;lt;code&amp;gt;adb logcat &amp;gt; log.txt&amp;lt;/code&amp;gt; (or &amp;lt;code&amp;gt;adb logcat&amp;lt;/code&amp;gt; and copy from terminal). Run Wesnoth on phone. Reproduce the crash.&lt;br /&gt;
* stop &amp;lt;code&amp;gt;adb logcat&amp;lt;/code&amp;gt; on PC, and attach the &amp;lt;code&amp;gt;log.txt&amp;lt;/code&amp;gt; to your issue report on github along with detailed steps of the bug, and use the Android label.&lt;br /&gt;
&lt;br /&gt;
(Note: adb can be &amp;lt;code&amp;gt;./adb.exe&amp;lt;/code&amp;gt; on Windows. Use internet for help on any of the steps if needed, this is supposed to be a preliminary guideline. Steps might slightly differ based on manufacturer or Android version.)&lt;br /&gt;
&lt;br /&gt;
=== Enabling taps ===&lt;br /&gt;
It is useful for debugging purposes, especially if you're sharing a screen recording of your bug, to show where you're tapping on the screen in the screen recording. See [https://discussio.zendesk.com/hc/en-gb/articles/4625151970065-How-to-Show-Taps-for-Mobile-Screen-Sharing-on-Android here] for how to enable that.&lt;br /&gt;
&lt;br /&gt;
=== Turning off Developer Mode ===&lt;br /&gt;
Go to System &amp;gt; Developer Options and turn off  the '''Use developer options''' toggle.&lt;br /&gt;
&lt;br /&gt;
=== Dev Notes ===&lt;br /&gt;
==== Version Code scheme (1.19.16) ====&lt;br /&gt;
&amp;lt;code&amp;gt;MmmPPppVVV&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Where,&lt;br /&gt;
* &amp;lt;code&amp;gt;MM&amp;lt;/code&amp;gt; - Major version code, so far at 1; since the max versionCode is 21000000 it can go up to 2&lt;br /&gt;
* &amp;lt;code&amp;gt;mm&amp;lt;/code&amp;gt; - Minor version code.&lt;br /&gt;
* &amp;lt;code&amp;gt;PP&amp;lt;/code&amp;gt; - Patch version code.&lt;br /&gt;
* &amp;lt;code&amp;gt;pp&amp;lt;/code&amp;gt; - Android patch version/any other use.&lt;br /&gt;
* &amp;lt;code&amp;gt;VVV&amp;lt;/code&amp;gt; - Reserved for ABI/Variants.&lt;br /&gt;
** Last digit - ABI (&amp;lt;code&amp;gt;['armeabi-v7a': 1, 'arm64-v8a': 2, 'x86': 3, 'x86_64': 4]&amp;lt;/code&amp;gt;)&lt;br /&gt;
** Rest unused (variants if we need them)&lt;br /&gt;
&lt;br /&gt;
==== New Version Code scheme draft ====&lt;br /&gt;
This is but one possible idea among many, and is not final.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;1SUUMMmmPPVV&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Where,&lt;br /&gt;
* 1 - since Wesnoth first digit is almost always 1 and the max versionCode is 21000000.&lt;br /&gt;
* S - store identifier (must be greater than 2 to allow upgrade from previous scheme.) For example:&lt;br /&gt;
** &amp;lt;code&amp;gt;2&amp;lt;/code&amp;gt; - F-Droid&lt;br /&gt;
** &amp;lt;code&amp;gt;3&amp;lt;/code&amp;gt; - Google Play&lt;br /&gt;
** Others if needed.&lt;br /&gt;
* UU - unused/unspecified.&lt;br /&gt;
* MM - Major version&lt;br /&gt;
* mm - Minor version&lt;br /&gt;
* PP - Patch version&lt;br /&gt;
* VV - ABI/Variants&lt;br /&gt;
** Last digit - ABI (&amp;lt;code&amp;gt;['armeabi-v7a': 1, 'arm64-v8a': 2, 'x86': 3, 'x86_64': 4]&amp;lt;/code&amp;gt;)&lt;br /&gt;
** Last but one digit - Unused (variants if we need them)&lt;/div&gt;</summary>
		<author><name>Soliton</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.wesnoth.org/index.php?title=UsefulLinks&amp;diff=74521</id>
		<title>UsefulLinks</title>
		<link rel="alternate" type="text/html" href="https://wiki.wesnoth.org/index.php?title=UsefulLinks&amp;diff=74521"/>
		<updated>2025-09-22T12:31:27Z</updated>

		<summary type="html">&lt;p&gt;Soliton: /* Battle for Wesnoth */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
!colspan=2 style='text-align:left'|&lt;br /&gt;
=== Battle for Wesnoth ===&lt;br /&gt;
|-&lt;br /&gt;
|Home Page || https://www.wesnoth.org/&lt;br /&gt;
|-&lt;br /&gt;
|GitHub Project Page || https://github.com/wesnoth/&lt;br /&gt;
|-&lt;br /&gt;
|SPI project page || https://www.spi-inc.org/projects/wesnoth/&lt;br /&gt;
|-&lt;br /&gt;
|Changelog || https://changelog.wesnoth.org/ [http://stable-changelog.wesnoth.org stable]&lt;br /&gt;
|-&lt;br /&gt;
|Roadmap || https://wiki.wesnoth.org/1.19_Roadmap&lt;br /&gt;
|-&lt;br /&gt;
|This wiki || [[StartingPoints|https://wiki.wesnoth.org/]]&lt;br /&gt;
|-&lt;br /&gt;
|The manual || https://manual.wesnoth.org/&lt;br /&gt;
|-&lt;br /&gt;
|Translation statistics || https://gettext.wesnoth.org/&lt;br /&gt;
|-&lt;br /&gt;
|Add-on server web interface || https://addons.wesnoth.org/ [http://stable-addons.wesnoth.org stable] [http://dev-addons.wesnoth.org dev]&lt;br /&gt;
|-&lt;br /&gt;
|Code and Content Copyright || https://wiki.wesnoth.org/Wesnoth:Copyrights&lt;br /&gt;
|-&lt;br /&gt;
|Multiplayer server statistics || https://wesnothd.wesnoth.org/&lt;br /&gt;
|-&lt;br /&gt;
|Multiplayer statistics || https://replays.wesnoth.org/dashboard/&lt;br /&gt;
|-&lt;br /&gt;
|Multiplayer replays || https://replays.wesnoth.org&lt;br /&gt;
|-&lt;br /&gt;
|Unit advancement tree || https://units.wesnoth.org/&lt;br /&gt;
|-&lt;br /&gt;
|SteamDB || https://steamdb.info/app/599390/&lt;br /&gt;
|-&lt;br /&gt;
|Forum for users and developers || https://forums.wesnoth.org/ [https://forums.wesnoth.org/search.php?search_id=newposts new posts]&lt;br /&gt;
|-&lt;br /&gt;
|List of Frequently Proposed Ideas || https://forums.wesnoth.org/viewtopic.php?f=12&amp;amp;t=34904&lt;br /&gt;
|-&lt;br /&gt;
|IRC channel (Libera.Chat) || ircs://irc.libera.chat/#wesnoth&lt;br /&gt;
|-&lt;br /&gt;
|Discord server || https://discord.gg/battleforwesnoth&lt;br /&gt;
|-&lt;br /&gt;
|IRC logs || https://wesnoth.org/irclogs/&lt;br /&gt;
|-&lt;br /&gt;
|Mastodon Account || https://fosstodon.org/@wesnoth&lt;br /&gt;
|-&lt;br /&gt;
|Project statistics || https://openhub.net/p/wesnoth&lt;br /&gt;
|-&lt;br /&gt;
!colspan=2 style='text-align:left'|&lt;br /&gt;
&lt;br /&gt;
=== Developers ===&lt;br /&gt;
|-&lt;br /&gt;
|Git web interface || https://github.com/wesnoth/wesnoth ([https://git-scm.com/ git] [https://git-scm.com/documentation doc])&lt;br /&gt;
|-&lt;br /&gt;
|Jenkins CI || https://jenkins.wesnoth.org:8443/&lt;br /&gt;
|-&lt;br /&gt;
| Github CI || https://github.com/wesnoth/wesnoth/actions&lt;br /&gt;
|-&lt;br /&gt;
|Code documentation || https://devdocs.wesnoth.org/&lt;br /&gt;
|-&lt;br /&gt;
|GUI(2) documentation || https://wiki.wesnoth.org/GUIToolkit&lt;br /&gt;
|-&lt;br /&gt;
|Lua documentation || https://wiki.wesnoth.org/LuaAPI&lt;br /&gt;
|-&lt;br /&gt;
|WML documentation || https://wiki.wesnoth.org/WML&lt;br /&gt;
|-&lt;br /&gt;
|WFL documentation || https://wiki.wesnoth.org/WFL&lt;br /&gt;
|-&lt;br /&gt;
|Mailing lists || [https://groups.io/g/wesnoth-packagers wesnoth-packagers] - [https://groups.io/g/wesnoth-translations wesnoth-translations] ([https://listengine.tuxfamily.org/wesnoth.org/ old] - [https://mailman.wesnoth.org/ oldold])&lt;br /&gt;
|-&lt;br /&gt;
|Bug/Feature tracker || https://bugs.wesnoth.org/&lt;br /&gt;
|-&lt;br /&gt;
|Patch tracker || https://patches.wesnoth.org/&lt;br /&gt;
|-&lt;br /&gt;
|wesnoth.org server stats || https://collectd.wesnoth.org&lt;br /&gt;
|-&lt;br /&gt;
|IRC channel (Libera.Chat) || ircs://irc.libera.chat/wesnoth-dev&lt;br /&gt;
|-&lt;br /&gt;
!colspan=2 style='text-align:left'|&lt;br /&gt;
&lt;br /&gt;
=== Other Links ===&lt;br /&gt;
|-&lt;br /&gt;
|1vs1 Wesnoth ladder || https://wesnoth.gamingladder.info/&lt;br /&gt;
|-&lt;br /&gt;
|Wesnoth matches with commentary || http://www.youtube.com/user/NekisBrutalWesnoth&lt;br /&gt;
|-&lt;br /&gt;
|Wesnoth campaign with commentary in german || https://www.youtube.com/playlist?list=PLc3DmuDuA2imW1vg9xXMNjGHm8VaXvEaz&lt;br /&gt;
|-&lt;br /&gt;
|WSNPP || [[WSNPP|http://wiki.wesnoth.org/WSNPP]]&lt;br /&gt;
|-&lt;br /&gt;
|Run Wesnoth online (Windows) || http://spoon.net/the-battle-for-wesnoth&lt;br /&gt;
|-&lt;br /&gt;
!colspan=2 style='text-align:left'|&lt;br /&gt;
=== Multilingual Players' Sites ===&lt;br /&gt;
|-&lt;br /&gt;
|Community in China || http://wesnoth.cn/&lt;br /&gt;
|-&lt;br /&gt;
|Polish Community || https://www.wesnoth.com.pl/forum/index.php&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
[[Category:Wesnoth Wiki]]&lt;/div&gt;</summary>
		<author><name>Soliton</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.wesnoth.org/index.php?title=AddonServers&amp;diff=74520</id>
		<title>AddonServers</title>
		<link rel="alternate" type="text/html" href="https://wiki.wesnoth.org/index.php?title=AddonServers&amp;diff=74520"/>
		<updated>2025-09-17T11:42:30Z</updated>

		<summary type="html">&lt;p&gt;Soliton: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;To connect to the default Add-on server from inside Wesnoth, use the &amp;lt;code&amp;gt;Add-ons&amp;lt;/code&amp;gt; option from the title screen. &lt;br /&gt;
&lt;br /&gt;
Alternatively, there is a website generated from the Add-on server contents here: [https://addons.wesnoth.org addons.wesnoth.org]. The web page is for reference purposes, archival purposes, and for people who cannot use the game client for technical reasons or otherwise. You may have a look at the list of add-ons available from each one and optionally download their contents from there. The recommended way is to install via the in-game client.&lt;br /&gt;
&lt;br /&gt;
Also, from the in-game client, it is possible to connect to another version's Add-on server by using the correct port number like this: &amp;lt;code&amp;gt;addons.wesnoth.org:15018&amp;lt;/code&amp;gt;. The last two digits of the port specified (&amp;lt;code&amp;gt;15018&amp;lt;/code&amp;gt;) are the same as the minor number (&amp;lt;code&amp;gt;&amp;lt;major&amp;gt;.&amp;lt;minor&amp;gt;.&amp;lt;patch&amp;gt;&amp;lt;/code&amp;gt;) of the Wesnoth version whose Add-on server you wish to connect to. In this example, it will connect to the Add-on server of version 1.18.x. Note that this is in general not recommended because add-ons from another version may not be compatible or refuse to correctly work, and is intended for advanced users or for development purposes only. The port scheme may change at any point in the future and is not recommended to be used as a permanent link. The port for the latest development server (trunk/master) is 15004.&lt;/div&gt;</summary>
		<author><name>Soliton</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.wesnoth.org/index.php?title=InterfaceActionsWML&amp;diff=74507</id>
		<title>InterfaceActionsWML</title>
		<link rel="alternate" type="text/html" href="https://wiki.wesnoth.org/index.php?title=InterfaceActionsWML&amp;diff=74507"/>
		<updated>2025-09-01T11:21:52Z</updated>

		<summary type="html">&lt;p&gt;Soliton: /* [label] */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{WML Tags}}&lt;br /&gt;
== Interface actions ==&lt;br /&gt;
&lt;br /&gt;
Part of [[ActionWML]], interface actions are actions that do not have a direct effect on gameplay;&lt;br /&gt;
instead, they show something to the player.  The main interface tags&lt;br /&gt;
are '''[message]''' and '''[objectives]''', but several other tags affect&lt;br /&gt;
the interface also.&lt;br /&gt;
&lt;br /&gt;
== [inspect] ==&lt;br /&gt;
This user interface instantly displays the gamestate inspector dialog at the current scenario state (the same one that can be brought up with [[CommandMode|the ''':inspect''' command]]), which can be used to inspect the values of WML variables, AI configuration, recall lists, and more.&lt;br /&gt;
&lt;br /&gt;
* '''name''': optional attribute to specify the name of this gamestate inspector dialog. It is just a label to help differentiate between different invocations of gamestate inspector dialog.&lt;br /&gt;
&lt;br /&gt;
== [message] ==&lt;br /&gt;
The most commonly used interface action is [message], which displays a message to the user in a dialog box. It can also be used to take input from the user.&lt;br /&gt;
&lt;br /&gt;
The following key/tags are accepted for [message]:&lt;br /&gt;
* [[StandardUnitFilter]]: The unit whose profile and name are displayed. Do not use a [filter] tag. If no unit matching this filter is found, the message is not displayed (The unit has probably been killed).&amp;lt;br&amp;gt;[message] elements should be constructed so that it is either guaranteed that a certain unit is alive, or so that dialog flows smoothly even if the message isn't displayed.&lt;br /&gt;
&lt;br /&gt;
* '''speaker''': an alternative to standard unit filter. You may specify as the value of the speaker attribute a unit id or any of the following special values:&lt;br /&gt;
** '''narrator''': the dialog box is displayed without a caption for the unit speaking or a unit image&lt;br /&gt;
** '''unit''': the primary unit for the event is speaking&lt;br /&gt;
** '''second_unit''': the secondary unit for the event is speaking&lt;br /&gt;
&lt;br /&gt;
* '''message''': (translatable) the text to display to the right of the image. ''message'' is sometimes multiple lines; if it is, be sure to use quotes(''' ' ''' or ''' &amp;quot; ''')&lt;br /&gt;
* '''male_message''', '''female_message''': {{DevFeature1.13|2}} (translatable) Used instead of ''message'' if the unit's gender matches. Never used if there is no unit (ie ''speaker=narrator''). {{DevFeature1.13|6}} This matches the primary unit, not the secondary unit.&lt;br /&gt;
* '''wait_description''': {{DevFeature1.13|2}} the description of this message displayed when other players in a mp game wait for one player doing input in a [message] (with [option]s or [text_input]).&lt;br /&gt;
* '''[show_if]''': if present then this message will only be displayed if the conditional statement in this tag is passed (see [[ConditionalActionsWML#Condition_Tags|ConditionalActionsWML]])&lt;br /&gt;
* '''side_for''': (default: all sides) comma-separated list of sides for who message is shown. This will &amp;lt;b&amp;gt;not&amp;lt;/b&amp;gt; work with messages that take user input ([option]/[text_input]), which can only ever be shown to the current player. {{DevFeature1.13|0}} side_for= is now also accepted for messages with user input, it specifies on which side the message is shown (defaults to the currently playing side). For messages with input it does not accept a comma seperated list only a single number.&lt;br /&gt;
* '''image''': (default: profile image of speaker) the image to display to the left of the message text. Append ~RIGHT() if you want the image to appear on the right side. &lt;br /&gt;
** {{DevFeature1.13|0}} &amp;lt;b&amp;gt;none:&amp;lt;/b&amp;gt; display no image&lt;br /&gt;
* '''mirror''': {{DevFeature1.13|5}} whether to mirror the image specified by the '''image''' attribute.&lt;br /&gt;
* '''second_image''': {{DevFeature1.13|6}} same as the '''image''' attribute, but the image is displayed on the right of the message text. {{DevFeature1.17|7}} not working anymore {{DevFeature1.19|9}} working again&lt;br /&gt;
* '''second_mirror''': {{DevFeature1.13|6}} same as '''mirror''', but for the '''second_image''' attribute.&lt;br /&gt;
* '''image_pos''': {{DevFeature1.13|5}} whether to show the image on the left or right; supercedes the use of ~RIGHT() described above&lt;br /&gt;
* '''caption''': (default: name of speaker) the caption to display beside the image. Name to be displayed. Note: use a translation mark to avoid wmllint errors.&lt;br /&gt;
* '''scroll''': Boolean specifying whether the game view should scroll to the speaking unit. Defaults to ''yes''.&lt;br /&gt;
* '''highlight''': {{DevFeature1.13|5}} Boolean specifying whether to highlight the speaker. Defaults to ''yes''.&lt;br /&gt;
* '''sound''': a sound effect (wav file) to play as the message is displayed. This can be a comma-separated list, from which one will be randomly chosen.&lt;br /&gt;
* '''voice''', '''male_voice''', '''female_voice''': {{DevFeature1.13|?}} a sound to be played as the message is displayed. This can also be a comma-separated list, from which one will be randomly chosen. This is intended for voiceovers for the message. The gendered forms are applied the same as for '''message'''. They are never used when the speaker is the narrator - only '''voice''' is used in that case.&lt;br /&gt;
* {{anchor|message-option|'''[option]'''}}: No '''[option]''' elements have to be used. If '''[option]''' elements are present, then each option will be displayed in a menu for the user to select one option. ''Note: Messages with options will not be shown at all in prestart events''&lt;br /&gt;
** '''message''': (translatable) the text displayed for the option. {{DevFeature1.15|1}} This is now a synonym for '''description='''.&lt;br /&gt;
** '''image''', '''label''', '''description''', '''default''': See [[DescriptionWML#WML_Format|DescriptionWML]].&lt;br /&gt;
** '''value''': {{DevFeature1.13|?}} Gives the option a value to be stored in a variable.&lt;br /&gt;
** '''[show_if]''': if present then this option will only be displayed if the conditional statement in this tag is passed (see [[ConditionalActionsWML#Condition_Tags|ConditionalActionsWML]])&lt;br /&gt;
** '''[command]''': an element containing actions which are executed if the option is selected.&lt;br /&gt;
* '''variable''': {{DevFeature1.13|?}} If present, either the index or the value of the chosen option will be stored in the specified variable. Option indexing starts from 1. If option has '''[show_if]''' condition evaluated as false, then it is hidden and excluded from the indexing.&lt;br /&gt;
* {{anchor|message-text_input|'''[text_input]'''}}: there can be only one [text_input] tag. this adds a text input field to the message. ''Note: Messages with text_input will not be shown at all in prestart events''&lt;br /&gt;
** '''variable''': the variable that the user's input will be written to&lt;br /&gt;
** '''label''': a text label to the left of the input field&lt;br /&gt;
** '''max_length''': the maximum number of characters that may be typed into the field&lt;br /&gt;
** '''text''': text that is written into the field in the beginning&lt;br /&gt;
* Check [[EventWML#Multiplayer_safety]] to find out in which events you can safely use '''[option]''' and '''[text_input]''' without causing OOS.&lt;br /&gt;
&lt;br /&gt;
=== Formatting ===&lt;br /&gt;
'''[message]''' and other tags such as unit names (user_description), objectives, and floating text can make use of [https://docs.gtk.org/Pango/pango_markup.html#pango-markup Pango markup formatting codes].&lt;br /&gt;
&lt;br /&gt;
Prefer to use single quotes (') instead of double quotes (&amp;quot;) within the formatting string, as double quotes would need to be escaped in WML (&amp;quot;&amp;quot;). Escaping markup can be done with [https://github.com/wesnoth/wesnoth/blob/9daa10a9f27c5a95520e871417bbd72aa52aa688/src/font/pango/escape.hpp#L38-L42 HTML entities].&lt;br /&gt;
&lt;br /&gt;
For example, if you wanted to write &amp;quot;You are victorious!&amp;quot; in large, italic, gold letters, you might write it this way:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&amp;lt;span color='#BCB088' size='large' font-style='italic'&amp;gt;You are victorious!&amp;lt;/span&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
These are the codes taken from the Pango markup formatting guide:&lt;br /&gt;
&lt;br /&gt;
*'''font''', '''font_desc''': A font description string, such as &amp;quot;Sans Italic 12&amp;quot;.&lt;br /&gt;
*'''font_family''', '''face''': A font family name.&lt;br /&gt;
*'''font_size''', '''size''': Font size in 1024ths of a point, or one of the absolute sizes 'xx-small', 'x-small', 'small', 'medium', 'large', 'x-large', 'xx-large', or one of the relative sizes 'smaller' or 'larger'.&lt;br /&gt;
*'''font_style''', '''style''': One of 'normal', 'oblique', 'italic'.&lt;br /&gt;
*'''font_weight''', '''weight''': One of 'ultralight', 'light', 'normal', 'bold', 'ultrabold', 'heavy', or a numeric weight.&lt;br /&gt;
*'''font_variant''', '''variant''': One of 'normal' or 'smallcaps'.&lt;br /&gt;
*'''font_stretch''', '''stretch''': One of 'ultracondensed', 'extracondensed', 'condensed', 'semicondensed', 'normal', 'semiexpanded', 'expanded', 'extraexpanded', 'ultraexpanded'.&lt;br /&gt;
*'''foreground''', '''fgcolor''', '''color''': An RGB color specification such as '#00FF00' or a color name such as 'red'. The full list of color names may be found in Pango's [https://github.com/GNOME/pango/blob/main/tools/rgb.txt rgb.txt] file.&lt;br /&gt;
*'''background, bgcolor''': An RGB color specification such as '#00FF00' or a color name such as 'red'.&lt;br /&gt;
*'''underline''': One of 'none', 'single', 'double', 'low', 'error'.&lt;br /&gt;
*'''underline_color''': The color of underlines; an RGB color specification such as '#00FF00' or a color name such as 'red'.&lt;br /&gt;
*'''rise''': Vertical displacement, in 10000ths of an em. Can be negative for subscript, positive for superscript.&lt;br /&gt;
*'''strikethrough''': 'true' or 'false' whether to strike through the text.&lt;br /&gt;
*'''strikethrough_color''': The color of strikethrough lines; an RGB color specification such as '#00FF00' or a color name such as 'red'&lt;br /&gt;
*'''fallback''': 'true' or 'false' whether to enable fallback. If disabled, then characters will only be used from the closest matching font on the system. No fallback will be done to other fonts on the system that might contain the characters in the text. Fallback is enabled by default. Most applications should not disable fallback.&lt;br /&gt;
*'''letter_spacing''': Inter-letter spacing in 1024ths of a point.&lt;br /&gt;
*'''gravity''': One of 'south', 'east', 'north', 'west', 'auto'.&lt;br /&gt;
*'''gravity_hint''': One of 'natural', 'strong', 'line'.&lt;br /&gt;
&lt;br /&gt;
The following pango attributes are also available directly as attributes of the '''[message]''' tag:&lt;br /&gt;
{{DevFeature1.13|4}}&lt;br /&gt;
&lt;br /&gt;
*'''font'''&lt;br /&gt;
*'''font_family'''&lt;br /&gt;
*'''font_size'''&lt;br /&gt;
*'''font_style'''&lt;br /&gt;
*'''font_weight'''&lt;br /&gt;
*'''font_variant'''&lt;br /&gt;
*'''font_stretch'''&lt;br /&gt;
*'''color'''&lt;br /&gt;
*'''bgcolor'''&lt;br /&gt;
*'''underline'''&lt;br /&gt;
*'''underline_color'''&lt;br /&gt;
*'''rise'''&lt;br /&gt;
*'''strikethrough'''&lt;br /&gt;
*'''strikethrough_color'''&lt;br /&gt;
*'''fallback'''&lt;br /&gt;
*'''letter_spacing'''&lt;br /&gt;
*'''gravity'''&lt;br /&gt;
*'''gravity_hint'''&lt;br /&gt;
&lt;br /&gt;
== [objectives] ==&lt;br /&gt;
The other tag used for plot development is '''[objectives]'''.&lt;br /&gt;
The '''[objectives]''' tag overwrites any previously set objectives,&lt;br /&gt;
and displays text which should describe the objectives of the scenario.&lt;br /&gt;
Scenario objectives are displayed on the player's first turn after the tag is used,&lt;br /&gt;
or as part of the event if it triggers during that player's turn.&lt;br /&gt;
Objectives can also be accessed at any time in a scenario using the&lt;br /&gt;
&amp;quot;Scenario Objectives&amp;quot; game menu option, making this tag useful for&lt;br /&gt;
scenario-specific information that the player may need to refer to during play.&lt;br /&gt;
&lt;br /&gt;
Attributes of '''[objectives]''':&lt;br /&gt;
* '''side''': Default '0'. The side to set the objectives for. A value of 0 sets objectives for all sides. note: There are side-specific objectives and default objectives, which are used in case a side doesn't have specific ones. Specifying 0 sets the default ones.&lt;br /&gt;
* '''[[StandardSideFilter]]''' tags and keys: Sets the objectives of all matching sides to these passed specifications (the rest of this [objectives] tag). If no sides (such as when passing side=0) or all sides match, sets the default objectives, and the side specific ones for the matching sides otherwise.&lt;br /&gt;
* '''bullet''': Default '• '. Replaces the default bullet, with whatever is passed, for all objectives, gold carryover notes, and notes defined with [note].&lt;br /&gt;
* '''summary''': Displayed first in the objectives text, this should describe the basic objective for the overall scenario.  Can be omitted.&lt;br /&gt;
* '''note''': Displayed last in the objectives text, this is sometimes used for hints or additional information.  Can be omitted.&lt;br /&gt;
* '''victory_string''': Default ' _ &amp;quot;Victory:&amp;quot;', this text precedes the victory objectives. Can be set to &amp;quot;&amp;quot; too.&lt;br /&gt;
* '''defeat_string''': Default ' _ &amp;quot;Defeat:&amp;quot;', this text precedes the defeat objectives. Can be set to &amp;quot;&amp;quot; too.&lt;br /&gt;
* '''gold_carryover_string''': Default ' _ &amp;quot;Gold carryover:&amp;quot;', this text precedes the gold carryover information.&lt;br /&gt;
* '''notes_string''': Default ' _ &amp;quot;Notes:&amp;quot;', this text precedes the notes.&lt;br /&gt;
* '''silent''': Default: not present. If set to &amp;quot;yes&amp;quot;, the objectives are silently changed. Else, they will be shown to the user when appropriate.&lt;br /&gt;
* '''delayed_variable_substitution''': {{DevFeature1.13|8}} If set to yes, any variables or [insert_tag] are not substituted right away. Instead, they are substituted whenever the objectives are actually viewed.&lt;br /&gt;
&lt;br /&gt;
Tags of '''[objectives]''':&lt;br /&gt;
* {{anchor|objectives-objective|'''[objective]'''}}: describes a win or loss condition. Most scenarios have multiple win or loss conditions, so use a separate [objective] subtag for each line; this helps with translations.&lt;br /&gt;
** '''bullet''': Default '• ' or whatever is set in the parent [objectives] block. Replaces the default bullet, with whatever is provided, for the objective defined by the [objective] block.&lt;br /&gt;
** '''red''': Default '0' for winning objectives, '255' for losing objectives. Overrides the default red coloring of the entire objective, including the bullet.&lt;br /&gt;
** '''green''': Default '255' for winning objectives, '0' for losing objectives. Overrides the default green coloring of the entire objective, including the bullet.&lt;br /&gt;
** '''blue''': Default '0'. Overrides the default blue coloring of the entire objective, including the bullet.&lt;br /&gt;
** '''description''': text for the specific win or loss condition.&lt;br /&gt;
** '''caption''': a text which will be displayed above the ''description''. This can be used to display a subcategory of objectives below ''victory_string'' or ''defeat_string''.&lt;br /&gt;
** '''condition''': The color and placement of the text. Values are 'win'(colored green, placed after ''victory_string'') and 'lose'(colored red, placed after ''defeat_string'').&lt;br /&gt;
** '''show_turn_counter''': If set to yes, displays the number of turns remaining in the scenario. Default is no.&lt;br /&gt;
** '''[show_if]''': A condition that disables the objective if it doesn't hold. Conditional objectives are refreshed at '''[show_objectives]''' time only, or when manually opening the scenario objectives.&lt;br /&gt;
* {{anchor|objectives-gold_carryover|'''[gold_carryover]'''}}: describes how the gold carryover works in this scenario. This is intended to be a more convenient way of displaying carryover information than using the note= key in [objectives].&lt;br /&gt;
** '''bullet''': Default '• ' or whatever is set in the parent [objectives] block. Replaces the default bullet with whatever is provided.&lt;br /&gt;
** '''red''': Default '255'. Overrides the default red coloring of the entire objective, including the bullet.&lt;br /&gt;
** '''green''': Default '255'. Overrides the default green coloring of the entire objective, including the bullet.&lt;br /&gt;
** '''blue''': Default '192'. Overrides the default blue coloring of the entire objective, including the bullet.&lt;br /&gt;
** '''bonus''' (boolean): whether an early finish bonus is granted. If omitted, early finish bonus is not mentioned.&lt;br /&gt;
** '''carryover_percentage''': the amount of carryover gold. If omitted, the amount is not mentioned.&lt;br /&gt;
** '''[show_if]''': {{DevFeature1.13|11}} Gold carryover will not be shown if the specified condition isn't met. Conditional gold carryover is refreshed at '''[show_objectives]''' time only.&lt;br /&gt;
* {{anchor|objectives-note|'''[note]'''}}: describes a note, usually used for hints or additional information. This is an easier way of adding several notes than concatenating them together into a single string to use with the ''note='' key.&lt;br /&gt;
** '''bullet''': Default '• ' or whatever is set in the parent [objectives] block. Replaces the default bullet with whatever is provided for the note defined by the [note] block.&lt;br /&gt;
** '''red''': Default '255'. Overrides the default red coloring of the entire note, including the bullet.&lt;br /&gt;
** '''green''': Default '255'. Overrides the default green coloring of the entire note, including the bullet.&lt;br /&gt;
** '''blue''': Default '255'. Overrides the default blue coloring of the entire note, including the bullet.&lt;br /&gt;
** '''description''': the text of the note.&lt;br /&gt;
** '''[show_if]''': The note will not be shown if the specified condition isn't met. Conditional notes are refreshed at '''[show_objectives]''' time only.&lt;br /&gt;
&lt;br /&gt;
== [set_menu_item] ==&lt;br /&gt;
This tag is used to add a custom option in the right-click context menu which can then be used to trigger arbitrary WML commands. The menu items can be set and modified during any event, for example during &amp;quot;start&amp;quot; or &amp;quot;prestart&amp;quot; events. The user can also assign hotkeys to these WML commands unless specified otherwise. When the hotkey is pressed the event will be fired/filtered at the current mouse position.&lt;br /&gt;
&lt;br /&gt;
'''Note:''' Due to limitations in portable devices where there are no scroll bars for context menus, there is a hard-coded limit of 7 custom WML menu items. If you really need to have more than 7 menu items, try combining some of them in a submenu. {{DevFeature1.13|0}} This limitation is being removed in a [http://forums.wesnoth.org/viewtopic.php?p=572554#p572554 future version] of Wesnoth.&lt;br /&gt;
&lt;br /&gt;
* '''id''': the unique id for this menu item. If a menu item with this id already exists, it allows you to set specific changes to that item. All menus will be sorted lexicographically by the id string. The ordering is underscores, digits, and finally letters.&lt;br /&gt;
* '''description''': the in-game text that will appear for this item in the menu.&lt;br /&gt;
* '''image''': the image to display next to this item, defaults to &amp;quot;buttons/WML-custom.png&amp;quot;&lt;br /&gt;
* '''needs_select''': if ''yes'' (default ''no''), then the latest select event (see [[EventWML]]) that triggered before this menu item was chosen will be transmitted over the network before this menu item action will be. This only has any effect in networked multiplayer, and is intended to allow more elaborate menu item behaviour there without causing out of sync errors. If you don't know what this means, just leave it. {{DevFeature1.13|6}} ''needs_select=yes'' is deprecated, consider using manual variable syncing with [sync_variable].&lt;br /&gt;
* '''synced''' {{DevFeature1.13|1}}: if ''no'' (default ''yes'') the command handler will only be run on the client that invoked the menu item; this means that changing the gamestate in a command handler of a menu item with ''synced=no'' will cause OOS&lt;br /&gt;
* '''use_hotkey''': if ''no'' (default ''yes''), then the user cannot assign hotkeys to this menu item. If ''only'', the menu item is only accessible via hotkeys, not via right-click context; you can use this in combination with [default_hotkey] if you want custom hotkeys in your campaign/mp. &lt;br /&gt;
* '''[show_if]''': If present, the menu item will only be available if the conditional statement (see [[ConditionalActionsWML#Condition_Tags|ConditionalActionsWML]]) within evaluates to true. When this is evaluated, the WML variables ''$x1'' and ''$y1'' will point to the location on which the context menu was invoked, so it's possible to for example only enable the option on empty hexes or on a particular unit.&lt;br /&gt;
* '''[filter_location]''': contains a [[StandardLocationFilter]] similar to the one found inside Single Unit Filters. The menu item will only be available on matching locations.&lt;br /&gt;
* '''[default_hotkey]''': contains a hotkey WML to specify what hotkey to assign to this, '''if the user has no hotkey assigned to this yet'''. (Unlike the rest of a menu item definition, modifying this tag has no effect on the game; it is only effective when initially defining a menu item.) Hotkey WML matches the format in the preferences file and contains the following keys:&lt;br /&gt;
** '''key''': a string that contains the key to assign to this.&lt;br /&gt;
** '''alt''', '''shift''', '''cmd'''(apple only), '''ctrl''':  boolean values.&lt;br /&gt;
** '''repeat_on_hold''' {{DevFeature1.13|12}}: if ''yes'' (default ''no''), holding the hotkey will repeat the action continuously, unless it blocks input with something like '''[message]'''. Due to a bug, versions older than 1.13.12 always repeat the action, with no way to disable it.&lt;br /&gt;
* '''[command]''': contains the WML actions to be executed when the menu item is selected. Again, the WML variables ''$x1'' and ''$y1'' will point to the location on which the context menu was invoked on.&lt;br /&gt;
** '''delayed_variable_substitution ''' (boolean yes|no, default: yes): If no, forces a variable substitution run onto the wml included in this [command] block. Use this, if you want variables which are to substitute to get the values they have at execution time of the event where this set_menu_item appears. Other than that, they get the values they have at invocation time of the menu item.&lt;br /&gt;
&lt;br /&gt;
== [clear_menu_item] ==&lt;br /&gt;
&lt;br /&gt;
Removes a menu item from the scenario.&lt;br /&gt;
Normally menu items are, including all their defining wml, automatically carried over between scenarios. This tag prevents this. (The behavior is comparable to set_variable/clear_variable).&lt;br /&gt;
* '''id''': (string): id of the menu item to clear. Can be a comma-separated list.&lt;br /&gt;
&lt;br /&gt;
== Other interface tags ==&lt;br /&gt;
&lt;br /&gt;
The following tags are also action tags:&lt;br /&gt;
&lt;br /&gt;
=== [change_theme] ===&lt;br /&gt;
&lt;br /&gt;
{{DevFeature1.13|8}}&lt;br /&gt;
&lt;br /&gt;
Change the current interface theme.&lt;br /&gt;
&lt;br /&gt;
* '''theme''': The ID of the new theme. Use &amp;lt;code&amp;gt;theme=&amp;lt;/code&amp;gt; (empty key) to switch back to the theme that the player has selected in Preferences. On &amp;lt;b&amp;gt;1.14.2&amp;lt;/b&amp;gt; and later it is also possible to omit the key entirely to achieve the same effect (on previous versions this will crash the Lua engine).&lt;br /&gt;
&lt;br /&gt;
=== [item] ===&lt;br /&gt;
Makes a graphical item appear on a certain hex. Note this only places the graphics for an item. It does not make the item do anything. Use a moveto event to make moving onto the item do something. &amp;lt;tt&amp;gt;''('''Hint:''' There are a number of predefined items that are used in various campaigns that you can make use of. You can find [http://www.wesnoth.org/macro-reference.xhtml#file:items.cfg a list of them] if you look into the items.cfg file in the wesnoth install directory (under /data/core/macros).)''&amp;lt;/tt&amp;gt;&lt;br /&gt;
* '''x''', '''y''': the location to place the item. (only for [event][item]: full [[StandardLocationFilter|SLF]] support)&lt;br /&gt;
* '''image''': the image (in ''images/'' as .png) to place on the hex. This image is aligned with the top-left of the hex (which is 72 pixels wide and 72 pixels tall). It is drawn underneath units. ''('''Hint:''' If using an image smaller than 72x72, then it might be useful to [[ImagePathFunctions#Blit_Function|BLIT]] the image onto &amp;lt;tt&amp;gt;misc/blank-hex.png&amp;lt;/tt&amp;gt; (a blank 72x72 image).)''&lt;br /&gt;
* '''halo''': an image to place centered on the hex. It is drawn on top of units. Use this instead of ''image'' if the image is bigger than the hex or if you want to animate an image ([https://github.com/wesnoth/wesnoth/issues/1219 #1219]). ''Example (where the integer after the colon is the duration of each frame or square bracket expansion as per [[AnimationWML]] is used): halo=scenery/fire1.png:100,scenery/fire2.png:100,scenery/fire3.png:100,scenery/fire4.png:100,scenery/fire5.png:100,scenery/fire6.png:100,scenery/fire7.png:100,scenery/fire8.png:100'' or equivalently (requires Wesnoth 1.11.2+): ''halo=scenery/fire[1~8].png:100''&lt;br /&gt;
* '''name''' an id that can be used to remove the item.&lt;br /&gt;
* '''team_name''': name of the team for which the item is to be displayed (hidden for others). For multiple teams just put all the names in one string, for example separated by commas. {{DevFeature1.15|0}} In 1.14 the '''[side]team_name''' attribute was expected to be a substring of this '''team_name'''. In 1.15 both are expected to be comma-separated lists of names and the item is visible if the lists intersect. ([https://github.com/wesnoth/wesnoth/pull/3533 #3533])&lt;br /&gt;
* '''visible_in_fog''': whether the item should be visible through fog or not. Default yes.&lt;br /&gt;
* '''submerge''': float, between 0 and 1: specifies how much of the image should be submerged. Gets multiplied with [[TerrainWML|[terrain]]]&amp;lt;nowiki/&amp;gt;submerge. Default 0.&lt;br /&gt;
* '''z_order''': float: defines the order the items get drawn in. Default 0.&lt;br /&gt;
* '''redraw''': (boolean yes|no, default: yes): If no, disables implicit calls to [[InterfaceActionsWML#.5Bredraw.5D|[redraw]]] when placing the items.&lt;br /&gt;
* '''[filter_team]''': {{DevFeature1.15|0}} A [[StandardSideFilter]]. Set '''team_name''' to the union of all '''[side]team_name''' attributes of all sides that match the SSF. ([https://github.com/wesnoth/wesnoth/pull/3533 #3533])&lt;br /&gt;
* {{DevFeature1.15|0}} If both '''team_name''' and '''[filter_team]''' are set, '''team_name''' is ignored.&lt;br /&gt;
&lt;br /&gt;
=== [remove_item] ===&lt;br /&gt;
Removes any graphical items on a given hex.&lt;br /&gt;
* [[StandardLocationFilter]]: the hexes to remove items from&lt;br /&gt;
* '''image''': if specified, only removes the given item if one of its 'image', 'halo' or 'name' attributes is exactly this value. (for 'halo' and 'image' this in particular means that the image name must include any [[ImagePathFunctions|image path functions]] appended to the original image name.)&lt;br /&gt;
&lt;br /&gt;
=== [print] ===&lt;br /&gt;
Displays a message across the screen. The message will disappear after a certain time, or when another [print] tag is encountered.&lt;br /&gt;
* '''text''': (translatable) the text to display. Can be an empty string to remove a previous message without showing a new one.&lt;br /&gt;
* '''size''': (default=12) the pointsize of the font to use&lt;br /&gt;
* '''duration''': the length of time to display the text for.&lt;br /&gt;
** (Before 1.15.4) This is measured in the number of 'frames', and the default is 50. A frame in Wesnoth is usually displayed for around 30ms.&lt;br /&gt;
** {{DevFeature1.15|4}} This is measured in milliseconds. Don't use the default value, because it's a mere 50ms.&lt;br /&gt;
** {{DevFeature1.15|14}} The default is 5000 milliseconds.&lt;br /&gt;
** {{DevFeature1.15|14}} The string '''unlimited''' displays the text until it's removed by another [print] tag.&lt;br /&gt;
* '''color''': (default '''0,0,0''') three comma-separated values giving the red, green and blue values (0-255).&lt;br /&gt;
* '''red''', '''green''', '''blue''': deprecated, use color=0,0,0 instead.&lt;br /&gt;
&lt;br /&gt;
=== [move_unit_fake] ===&lt;br /&gt;
Moves an image of a unit along a certain path on the map. The path does not need to be a continuous list of adjacent hexes, so for example only the start and end points can be given, in which case the straightest line between those points will be calculated and used.&lt;br /&gt;
* '''type''': the type of the unit whose image to use&lt;br /&gt;
* '''x''': a comma-separated list of x locations to move along&lt;br /&gt;
* '''y''': a comma-separated list of y locations to move along (x and y values are matched pairs)&lt;br /&gt;
* '''side''': the side of the fake unit, used for team-coloring the fake unit&lt;br /&gt;
* '''gender''': the gender of the fake unit. Example: gender=female&lt;br /&gt;
* '''variation''': the variation of the fake unit. Example: variation=undead&lt;br /&gt;
* '''image_mods''': [[ImagePathFunctions|image path functions]] sequence to be applied on the fake unit.&lt;br /&gt;
* '''force_scroll''':  Whether to scroll the map or not even when [[#.5Block_view.5D|[lock_view]]] is in effect or ''Follow Unit Actions'' is disabled in ''Advanced Preferences''. Defaults to ''yes'' starting with version '''1.11.6'''; the attribute did not exist in previous versions and this action behaved as if ''no'' was passed instead.&lt;br /&gt;
&lt;br /&gt;
=== [move_units_fake] ===&lt;br /&gt;
moves multiple images of units along paths on the map. These units are moved in lockstep.&lt;br /&gt;
* '''force_scroll''': {{DevFeature1.15|0}} Has the same meaning as in [move_unit_fake] but a different default.&lt;br /&gt;
* '''[fake_unit]''': A fake unit to move&lt;br /&gt;
** '''type''': the type of unit whose image to use&lt;br /&gt;
** '''x''': a comma-separated list of x locations to move along&lt;br /&gt;
** '''y''': a comma-separated list of y locations to move along (x and y values are matched pairs)&lt;br /&gt;
** '''side''': the side of the fake unit, used for team-coloring the fake unit&lt;br /&gt;
** '''skip_steps''': the number of steps to skip before this unit starts moving&lt;br /&gt;
&lt;br /&gt;
=== [hide_unit] ===&lt;br /&gt;
Temporarily prevents the engine from displaying the given unit. The unit does not become invisible, as it would be with the '''[hides]''' ability; it is still the same plain unit, but without an image. Useful in conjunction with '''[move_unit_fake]''': to move a leader unit into position on-screen. Until 1.8 each '''[hide_unit]''' tag only hides one unit.&lt;br /&gt;
* [[StandardUnitFilter]]: All matching units will be hidden&lt;br /&gt;
&lt;br /&gt;
=== [unhide_unit] ===&lt;br /&gt;
Stops the currently hidden units from being hidden.&lt;br /&gt;
* [[StandardUnitFilter]]: Only the matching units will be unhidden&lt;br /&gt;
&lt;br /&gt;
=== [lock_view] ===&lt;br /&gt;
Locks gamemap view scrolling for human players, so they cannot scroll the gamemap view until it is unlocked. WML or Lua actions such as '''[scroll_to]''' will continue to work normally, as they ignore this restriction; the locked/unlocked state is preserved when saving the current game.&lt;br /&gt;
&lt;br /&gt;
This feature is generally intended to be used in cutscenes to prevent the player scrolling away from scripted actions.&lt;br /&gt;
&lt;br /&gt;
{{DevFeature1.13|8}} This now also blocks the player from zooming the gamemap view. WML or Lua zoom will continue to work normally.&lt;br /&gt;
&lt;br /&gt;
=== [unlock_view] ===&lt;br /&gt;
Unlocks gamemap view scrolling for human players.&lt;br /&gt;
&lt;br /&gt;
=== [scroll] ===&lt;br /&gt;
Scroll a certain number of pixels in a given direction. Useful for earthquake/shaking effects.&lt;br /&gt;
* '''x''', '''y''': the number of pixels to scroll along the x and y axis&lt;br /&gt;
* '''side''': the side or sides for which this should happen. By default, the [scroll] happens for everyone.&lt;br /&gt;
* '''[filter_side]''': a [[StandardSideFilter]] to select the sides for which this should happen. By default, the [scroll] happens for everyone.&lt;br /&gt;
&lt;br /&gt;
=== [scroll_to] ===&lt;br /&gt;
Scroll to a given hex&lt;br /&gt;
* [[StandardLocationFilter]], do not use a [filter_location] sub-tag. If more than one location matches the filter, only the first matching location will be used.&lt;br /&gt;
* '''check_fogged''': whether to scroll even to locations covered in fog or shroud. Possible values ''yes'' (don't scroll to fog) and ''no'' (scroll even to fog), with ''no'' as the default.&lt;br /&gt;
* '''immediate''': whether to instantly warp to the target hex regardless of the scroll speed setting in Preferences (defaults to ''no'').&lt;br /&gt;
* '''highlight''': {{DevFeature1.13|5}} Whether to highlight the hex being scrolled to (defaults to ''no'').&lt;br /&gt;
* '''side''': the side or sides for which this should happen. By default, the [scroll_to] happens for everyone.&lt;br /&gt;
* '''[filter_side]''': a [[StandardSideFilter]] to select the sides for which this should happen. By default, the [scroll_to] happens for everyone.&lt;br /&gt;
&lt;br /&gt;
=== [scroll_to_unit] ===&lt;br /&gt;
Scroll to a given unit&lt;br /&gt;
* [[StandardUnitFilter]]; do not use a [filter] subtag.&lt;br /&gt;
* '''check_fogged''': whether to scroll even to locations covered in fog or shroud. Possible values ''yes'' (don't scroll to fog) and ''no'' (scroll even to fog), with ''no'' as the default.&lt;br /&gt;
* '''immediate''': whether to instantly warp to the target hex regardless of the scroll speed setting in Preferences (defaults to ''no'').&lt;br /&gt;
* '''highlight''': {{DevFeature1.13|5}} Whether to highlight the hex the unit is on (defaults to ''no'').&lt;br /&gt;
* '''for_side''': the side or sides for which this should happen. By default, the [scroll_to_unit] happens for everyone.&lt;br /&gt;
* '''[for_side]''': a [[StandardSideFilter]] to select the sides for which this should happen. By default, the [scroll_to_unit] happens for everyone.&lt;br /&gt;
&lt;br /&gt;
=== [select_unit] ===&lt;br /&gt;
Selects a given unit.&lt;br /&gt;
* [[StandardUnitFilter]]: The first unit found will be selected.&lt;br /&gt;
* '''fire_event''': whether a ''select'' event should be triggered or not (def. ''no''). (Note that select events aren't multiplayer save.)&lt;br /&gt;
* '''highlight''': whether the unit's current hex should be highlighted (def. ''yes'').&lt;br /&gt;
&lt;br /&gt;
'''Note:''' fire_event does not appear to work in 1.14 or 1.16.&lt;br /&gt;
&lt;br /&gt;
=== [sound]===&lt;br /&gt;
Plays a sound&lt;br /&gt;
* '''name''': the filename of the sound to play (in ''sounds/'' as .wav or .ogg). This can be a comma-separated list, from which one sound will be chosen randomly.&lt;br /&gt;
* '''repeat''': repeats the sound for a specified additional number of times (default=0)&lt;br /&gt;
&lt;br /&gt;
=== [sound_source] ===&lt;br /&gt;
Creates a sound source. &amp;quot;Sound sources&amp;quot; is a general name for a mechanism which makes possible for map elements to emit sounds according to some rules, where &amp;quot;map elements&amp;quot; can be specific locations or terrain types. For now, only sound sources tied to locations are supported.&lt;br /&gt;
* '''id''': a unique identification key of the sound source&lt;br /&gt;
* '''sounds''': a list of comma separated, randomly played sounds associated with the sound source&lt;br /&gt;
* '''delay''': a numerical value (in milliseconds) of the minimal delay between two playbacks of the source's sound if the source remains visible on the screen; if one scrolls out and back in, the source will be considered as ready to play&lt;br /&gt;
* '''chance''': a percentage (a value from 0 to 100) describing the chance of the source being activated every second after the delay has passed or when the source's location appears on the screen (note that it cannot play more than one file at the same time)&lt;br /&gt;
* '''check_fogged''': possible values ''yes'' and ''no'' - ''yes'' means the source will not play if its locations are fogged&lt;br /&gt;
* '''check_shrouded''': possible values ''yes'' and ''no'' - ''yes'' means the source will not play if its locations are shrouded&lt;br /&gt;
* '''x,y''': similar to x,y as found in a [[StandardLocationFilter]], these are the locations associated with the sound source&lt;br /&gt;
* '''fade_range''' (default = 3): distance in hexes that determines a &amp;quot;circular&amp;quot; area around the one specified by '''full_range''' where sound volume fades out linearly&lt;br /&gt;
* '''full_range''' (default = 14): distance in hexes that determines a &amp;quot;circular&amp;quot; area where source plays with full volume, relative to screen center&lt;br /&gt;
* '''loop''': number of times a sound sample should be looped if it stays visible. -1 means infinite (~65000)&lt;br /&gt;
&lt;br /&gt;
=== [story] ===&lt;br /&gt;
{{DevFeature1.13|8}}&lt;br /&gt;
&lt;br /&gt;
Shows the story screen.&lt;br /&gt;
* '''title''': Default title used if a part does not specify one — unlike the intro storyscreen, the scenario name is not used as a default title.&lt;br /&gt;
* '''[part]''', '''[if]''', '''[switch]''', '''[wml_message]''', '''[deprecated_message]''' : See [[IntroWML]].&lt;br /&gt;
&lt;br /&gt;
=== [remove_sound_source] ===&lt;br /&gt;
Removes a previously defined sound source.&lt;br /&gt;
* '''id''': the identification key of the sound source to remove&lt;br /&gt;
&lt;br /&gt;
=== [music] ===&lt;br /&gt;
Switches to playing different music&lt;br /&gt;
* '''name''': the filename of the music to play (in ''music/'' as .ogg)&lt;br /&gt;
* see [[MusicListWML]] for the correct syntax&lt;br /&gt;
&lt;br /&gt;
=== [volume] ===&lt;br /&gt;
Changes the game volume to a percent of the preferences volume for the game being played. Values can go from 0 to 100:  &lt;br /&gt;
* '''music''':  Changes the music volume.&lt;br /&gt;
* '''sound''':  Changes the sound volume.&lt;br /&gt;
&lt;br /&gt;
=== [color_adjust] ===&lt;br /&gt;
Adjust the color tint of terrain, by adjusting time-of-day coloring.&lt;br /&gt;
* '''red''', '''green''', '''blue''': values from -255 to 255, the amount to tint by for each color&lt;br /&gt;
&lt;br /&gt;
=== [screen_fade] ===&lt;br /&gt;
{{DevFeature1.17|6}}&lt;br /&gt;
&lt;br /&gt;
Overlay the game display with the given color, fading over the specified duration. This can be used for screen fade effects.&lt;br /&gt;
* '''red''', '''green''', '''blue''': values from 0 to 255, the final overlay color (defaults to 0,0,0)&lt;br /&gt;
* '''alpha''': value from 0 to 255, the strength of the effect. 0 means no effect and can be used to fade in. 255 means fully opaque and can be used to fully fade out to the given color. Intermediate values will end up with a partial overlay tint on the game screen.&lt;br /&gt;
* '''duration''': the length of time it will take to complete the fade, in milliseconds. If 0 the effect is immediate.&lt;br /&gt;
&lt;br /&gt;
=== [delay] ===&lt;br /&gt;
Pauses the game.&lt;br /&gt;
* '''time''': the time to pause in milliseconds&lt;br /&gt;
* '''accelerate ''' (boolean yes|no, default no): {{DevFeature1.13|0}} whether the delay is affected by acceleration. When [delay] is used to make an animation, this should be set to yes so that your animation matches the ones generated by the game.&lt;br /&gt;
&lt;br /&gt;
=== [redraw] ===&lt;br /&gt;
Redraws the screen (this normally isn't done during events, although some of the other interface actions cause the screen or parts of it to be redrawn).&lt;br /&gt;
* '''clear_shroud''' (boolean yes|no, default no): If yes, clears fog and shroud around existing units. Useful if you, for example, spawn friendly units in the middle of an event and want the shroud to update accordingly (otherwise units that spawn inside fog would remain invisible for the duration of the event, since the fog would not automatically get cleared around them).&lt;br /&gt;
* '''[[StandardSideFilter]]''': the sides for which to recalculate fog and shroud.&lt;br /&gt;
* '''side''': If used (forces clear_shroud=yes), clears fog and shroud for that side.&lt;br /&gt;
&lt;br /&gt;
=== [unit_overlay] ===&lt;br /&gt;
Sets an image that will be drawn over a particular unit, and follow it around&lt;br /&gt;
* [[StandardUnitFilter]]: All matching units will get the overlay (do not use [filter])&lt;br /&gt;
* '''image''': the image to place on the unit&lt;br /&gt;
* '''object_id''': object id to use, defaults to the '''image''' key with an &amp;quot;overlay_&amp;quot; prefix; this allows using [[DirectActionsWML#.5Bremove_object.5D|'''[remove_object]''']]&lt;br /&gt;
* '''duration''': object duration&lt;br /&gt;
&lt;br /&gt;
=== [remove_unit_overlay] ===&lt;br /&gt;
Removes a particular overlayed image from a unit&lt;br /&gt;
* [[StandardUnitFilter]]: The overlay will get removed from all matching units (do not use [filter])&lt;br /&gt;
* '''image''': the image to remove from the unit&lt;br /&gt;
* '''object_id''': object id to use&lt;br /&gt;
Using [[DirectActionsWML#.5Bremove_object.5D|'''[remove_object]''']] is also possible, see https://github.com/wesnoth/wesnoth/commit/26c2f941f2bcdd89528481e114c0375ad2a46271&lt;br /&gt;
&lt;br /&gt;
=== [animate_unit] ===&lt;br /&gt;
Uses an animation of a unit to animate it on screen (if the unit has the corresponding animation).&lt;br /&gt;
* '''flag''': The key to find the custom animation in the unit description (see the '''[extra_anim]''' description in [[AnimationWML]]). Standard animations can be triggered with the following keywords: ''leading recruited standing idling levelout levelin healing healed poisoned movement defend attack death victory pre_teleport post_teleport''&lt;br /&gt;
* '''[filter]''' with a [[StandardUnitFilter]] as argument, see [[FilterWML]]. By default, the unit at the event location will be animated. You can use this tag to choose any other unit to animate.&lt;br /&gt;
* '''[primary_attack]''': If this tag is not present, the filter for animation will be triggered with no attack. If it is here, all attacks from the unit will be filtered, and a matching one will be used to filter the animation. Takes a weapon filter as argument, see [[FilterWML]].&lt;br /&gt;
* '''[secondary_attack]''': Similar to '''[primary_attack]'''. May be needed to trigger a defense animation correctly, if there are more than one animations available for the defending unit.&lt;br /&gt;
* '''hits''': yes/no/hit/miss/kill: which according variation of a attack/defense animation shall be chosen (required)&lt;br /&gt;
* '''text''': a text to hover during the animation &lt;br /&gt;
* '''male_text''', '''female_text''': {{DevFeature1.13|2}} (translatable) gender-specific versions of the above&lt;br /&gt;
* '''red''': red value for the text color (0-255)&lt;br /&gt;
* '''green''': green value for the text color&lt;br /&gt;
* '''blue''': blue value for the text color&lt;br /&gt;
* '''with_bars''': yes/no: whether to display the status bars during the animation (e.g. the hitpoint bar)&lt;br /&gt;
* '''[animate]''': a sub block with the same syntax as '''[animate_unit]''' except that the '''[filter]''' block is mandatory to find the unit. This block will find and animate another unit simultaneously.&lt;br /&gt;
* '''[facing]''': a [[StandardLocationFilter]] specifying what hex the unit should be facing when animated&lt;br /&gt;
&lt;br /&gt;
=== [label] ===&lt;br /&gt;
Places a label on the map.&lt;br /&gt;
* '''x''', '''y''': the location of the label. {{DevFeature1.13|1}} (only for [event][label]: full [[StandardLocationFilter|SLF]] support)&lt;br /&gt;
* '''text''': what the label should say. If you put an empty string &amp;lt;code&amp;gt;&amp;quot;&amp;quot;&amp;lt;/code&amp;gt; as an argument, the label will be completely removed. Use this method if you want to remove a specific label from any location.&lt;br /&gt;
* '''team_name''': if specified, the label will only be visible to the given team.&lt;br /&gt;
* '''color''': color of the label. The format is r,g,b; r, g and b are numbers between 0 and 255. When you use Pango markup in the text, you cannot use this, but in that case you could colorize the text via Pango markup.&lt;br /&gt;
* '''visible_in_fog''': whether the label should be visible through fog or not. Default yes.&lt;br /&gt;
* '''visible_in_shroud''': whether the label should be visible through shroud or not. Default no.&lt;br /&gt;
* '''immutable''': whether this label is protected from being removed or changed by players. Default yes.&lt;br /&gt;
* '''category''': the Show/Hide Labels dialog allows showing/hiding all labels of a given category by toggling a checkbox.&lt;br /&gt;
* '''tooltip''': A tooltip visible when putting the mouse over the hex the label is on&lt;br /&gt;
* '''side''': the number of the side that placed the label. Can be 0 for labels placed by WML.&lt;br /&gt;
&lt;br /&gt;
=== [floating_text]===&lt;br /&gt;
Floats text (similar to the damage and healing numbers) on the given locations.&lt;br /&gt;
* [[StandardLocationFilter]]: the text will be floated on all matching locations simultaneously (do not use [filter] unless you intend to match one or more units).&lt;br /&gt;
* '''text''': the text to display.&lt;br /&gt;
&lt;br /&gt;
The default text color is &amp;lt;span style=&amp;quot;color: #6b8cff;&amp;quot;&amp;gt;'''#6b8cff'''&amp;lt;/span&amp;gt;. To change the color, use [[#Formatting|Pango markup]]. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# Float some golden yellow text at 20,20.&lt;br /&gt;
[floating_text]&lt;br /&gt;
   x,y=20,20&lt;br /&gt;
   text=&amp;quot;&amp;lt;span color='#cccc33'&amp;gt;&amp;quot; + _ &amp;quot;Your text here&amp;quot; + &amp;quot;&amp;lt;/span&amp;gt;&amp;quot;&lt;br /&gt;
[/floating_text]&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== [deprecated_message] ===&lt;br /&gt;
Shows a deprecated message in the message area, this feature is only intended to be used to warn about deprecated macros in mainline. The message is not translatable.&lt;br /&gt;
* '''message''': the message to show.&lt;br /&gt;
* '''level''': {{DevFeature1.13|10}} The deprecation level, a number from 1 to 3.&lt;br /&gt;
* '''what''': {{DevFeature1.13|10}} The name of the thing being deprecated. Use this instead of '''message''' if possible; a stock message will be generated from it. Use '''message''' only if more information is required; it will be appended to the stock message. This should not be translatable&lt;br /&gt;
* '''version''': {{DevFeature1.13|10}} For deprecation levels 2 and 3, this indicates the version in which the feature could be removed. It does ''not'' indicate the version in which it became deprecated. &lt;br /&gt;
&lt;br /&gt;
The meanings of the deprecation levels are as follows:&lt;br /&gt;
&lt;br /&gt;
# Deprecated, but will only be removed if absolutely necessary. The '''version''' key is ignored.&lt;br /&gt;
# It will be removed no earlier than a specified version.&lt;br /&gt;
# It will be removed in the next stable version&lt;br /&gt;
# It has already been removed, leaving just a stub to inform users of how to update their code.&lt;br /&gt;
&lt;br /&gt;
Note that as of 1.13.11, deprecation messages show only in the log, not in the chat message area. The '''message''' can be translatable, but does not need to be.&lt;br /&gt;
&lt;br /&gt;
=== [wml_message] ===&lt;br /&gt;
Outputs a message to Wesnoth's console output. Intended for campaign designers to output silent text to the console, without annoying the player; then, that text might contain information useful for later bug-reporting. WML wrapper of [[LuaAPI/wesnoth#wesnoth.log]], see the link for more description.&lt;br /&gt;
* '''message''': the message to show.&lt;br /&gt;
* '''to_chat''': controls whether message is visible in chat, though logger=wml means message is visible anyways. Default ''no''.&lt;br /&gt;
* '''logger''': one of '''info''', '''debug''', '''warning''', '''error''', '''wml'''. Default ''info''.&lt;br /&gt;
&lt;br /&gt;
=== [test_condition] ===&lt;br /&gt;
&lt;br /&gt;
{{DevFeature1.13|2}}&lt;br /&gt;
&lt;br /&gt;
Evaluates the contained conditional tags. If they evaluate to the expected value, it prints out a message to the console explaining which part of the condition caused this result in a way similar to [wml_message]. This can be used if your conditional test is failing and you're not sure why.&lt;br /&gt;
&lt;br /&gt;
* '''result''': Whether you expect the conditions to fail or succeed. If no (the default), a message will be printed if the conditional tags fail. If yes, a message will instead be printed if the conditional tags pass.&lt;br /&gt;
* '''logger''': Same as for [wml_message]. Defaults to &amp;quot;warning&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
=== [open_help] ===&lt;br /&gt;
Opens the in-game help.&lt;br /&gt;
* '''topic''': the id of the topic to open&lt;br /&gt;
&lt;br /&gt;
Examples of ids:&lt;br /&gt;
* unit_Mage&lt;br /&gt;
* unit_Dark Adept&lt;br /&gt;
* weaponspecial_charge&lt;br /&gt;
* terrain_human_castle&lt;br /&gt;
&lt;br /&gt;
The engine will print the topic ids if run from the command line with the ''--log-debug=help'' option.&lt;br /&gt;
&lt;br /&gt;
=== [show_objectives] ===&lt;br /&gt;
refreshes the objectives defined by [objectives] and its [show_if] tags, and displays them. (It is also called whenever the user explicitly asks for the objectives; this matters only if the tag was overridden by a [[LuaWML#register_wml_action|Lua]] script.)&lt;br /&gt;
* '''side''': the side to show the objectives. If not set, all sides are used.&lt;br /&gt;
* '''[[StandardSideFilter]]''' tags and keys: Tag affects the matching sides instead of just all or the one given by the integer value of the side= key.&lt;br /&gt;
&lt;br /&gt;
=== [chat] ===&lt;br /&gt;
Displays a message in the chat area, not visible for observers. Alternative unconditionally visible for everyone: [[LuaWML:Display#wesnoth.message]]. {{DevFeature1.13|9}} can be visible for observers.&lt;br /&gt;
* '''speaker''': (default=&amp;quot;WML&amp;quot;) A string for the name of the sender of the message.&lt;br /&gt;
* '''message''': The message that should be displayed.&lt;br /&gt;
* '''observable''' (boolean yes|no, default yes): {{DevFeature1.13|9}} Whether the message is displayed for observers.&lt;br /&gt;
* '''[[StandardSideFilter]]''' tags and keys as argument; if the same client controls multiple sides that match, then the message will only be displayed once.&lt;br /&gt;
&lt;br /&gt;
=== [zoom] ===&lt;br /&gt;
&lt;br /&gt;
{{DevFeature1.13|8}}&lt;br /&gt;
&lt;br /&gt;
Changes the zoom level of the map.&lt;br /&gt;
&lt;br /&gt;
* '''factor''': The new zoom factor, measured as a multiple of the base zoom.&lt;br /&gt;
* '''relative''': If yes, zoom relative to current zoom level. Otherwise, set the absolute zoom level. Default no.&lt;br /&gt;
&lt;br /&gt;
== Useful Macros ==&lt;br /&gt;
There are some predefined macros that you find useful for interface 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;
* '''{HIGHLIGHT_UNIT}''' Highlight a unit on the map. Use this to show important units&lt;br /&gt;
* '''{HIGHLIGHT_IMAGE}''' Places and highlights an image on the map. Use this to show important items or locations&lt;br /&gt;
* '''{SET_IMAGE}''' Places an image on the map which has no other function.&lt;br /&gt;
* '''{QUAKE &amp;lt;soundfile&amp;gt;}''' Creates a tremor-like screenshake and plays &amp;lt;soundfile&amp;gt;. For example, '''{QUAKE (rumble.ogg)}'''.&lt;br /&gt;
* '''{FLASH_WHITE}''' Flash the screen white momentarily. You can also replace WHITE with RED, BLUE or GREEN for a different colour.&lt;br /&gt;
&lt;br /&gt;
== See Also ==&lt;br /&gt;
* [[DirectActionsWML]]&lt;br /&gt;
* [[InternalActionsWML]]&lt;br /&gt;
* [[EventWML]]&lt;br /&gt;
* [[ReferenceWML]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category: WML Reference]]&lt;br /&gt;
[[Category: ActionsWML]]&lt;/div&gt;</summary>
		<author><name>Soliton</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.wesnoth.org/index.php?title=UnitTypeWML&amp;diff=74494</id>
		<title>UnitTypeWML</title>
		<link rel="alternate" type="text/html" href="https://wiki.wesnoth.org/index.php?title=UnitTypeWML&amp;diff=74494"/>
		<updated>2025-08-22T16:04:41Z</updated>

		<summary type="html">&lt;p&gt;Soliton: /* Unit Type */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{WML Tags}}&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
== Unit Type ==&lt;br /&gt;
&lt;br /&gt;
Each '''[unit_type]''' tag defines one unit type. (for the use of [unit] to create a unit, see [[SingleUnitWML]])&lt;br /&gt;
&lt;br /&gt;
Unit animation syntax is described in [[AnimationWML]]. In addition to the animation tags described there, the following key/tags are recognized:&lt;br /&gt;
* '''advances_to''': When this unit has ''experience'' greater than or equal to ''experience'', it is replaced by a unit of the type that the value of ''advances_to'' refers to. All modifications that have been done to the unit are applied to the unit it is replaced by. The special value 'null' says that the unit does not advance but gets an AMLA instead. Can be a comma-separated list of units that can be chosen from upon advancing.&lt;br /&gt;
* '''alignment''': one of lawful/neutral/chaotic/liminal (See [[TimeWML]]). Default is &amp;quot;neutral&amp;quot;.&lt;br /&gt;
* '''attacks''': the number of times that this unit can attack each turn. Default is 1.&lt;br /&gt;
* '''cost''': when a player recruits a unit of this type, the player loses ''cost'' gold. If this would cause gold to drop below 0,  the unit cannot be recruited. Default is 1.&lt;br /&gt;
* '''recall_cost''': {{DevFeature1.13|0}} the default recall cost of units of this type, overriding the recall cost set in scenario [[SideWML|[side]]] tags or the global [[GameConfigWML|[game_config]]] value. Individual units may override this value in [[SingleUnitWML|[unit]]]. A value of -1 is equivalent to not specifying this attribute. {{DevFeature1.15|0}} Units are now recalled for AI sides even if the recall_cost is larger than the unit's worth (essentially its cost, plus potentially a bonus for experience points). In 1.14 and earlier, units were not recalled by the AI in this case even if this was the only recall/recruit action possible to the AI.&lt;br /&gt;
* '''description''': (translatable) the text displayed in the unit descriptor box for this unit. Default 'No description available...'. &lt;br /&gt;
* '''do_not_list''': Not used by the game, but by tools for browsing and listing the unit tree. If this is 'yes', the unit will be ignored by these tools. {{DevFeature1.13|?}} When placing units in debug mode this unit isn't listed (but can still be placed using the :create command). This restriction is lifted in version &amp;lt;b&amp;gt;1.14.3&amp;lt;/b&amp;gt;.&lt;br /&gt;
* '''ellipse''': the ellipse image to display under the unit, which is normally team-colored. Default is &amp;quot;misc/ellipse&amp;quot;. &amp;quot;-nozoc&amp;quot; and &amp;quot;-leader&amp;quot; are automatically appended for units without zone of control and with canrecruit=yes respectively. The [http://www.wesnoth.org/macro-reference.xhtml#IS_HERO IS_HERO]/[http://www.wesnoth.org/macro-reference.xhtml#MAKE_HERO MAKE_HERO]/[http://www.wesnoth.org/macro-reference.xhtml#UNMAKE_HERO UNMAKE_HERO] macros change the ellipse to/back from &amp;quot;misc/ellipse-hero&amp;quot;. Finally, setting this to &amp;quot;none&amp;quot; will cause the unit to not have any ellipses displayed under it regardless of the user's preferences.&amp;lt;br/&amp;gt;WARNING: Be aware that setting this to &amp;quot;misc/ellipse-hero&amp;quot; for a unit with canrecruit=yes will result in the ellipse being &amp;quot;misc/ellipse-hero-leader&amp;quot;, which is not a supported combination (it doesn't have a graphic, and will cause error logs that the graphic is missing). This is tracked as bug [https://github.com/wesnoth/wesnoth/issues/6258 6258] on GitHub.&amp;lt;br/&amp;gt;{{DevFeature1.17|26}} canrecruit=yes is now supported with &amp;quot;misc/ellipse-hero&amp;quot;, since &amp;quot;misc/ellipse-hero-leader&amp;quot; has been added in [https://github.com/wesnoth/wesnoth/pull/8375 8375].&lt;br /&gt;
* '''experience''': When this unit has experience greater than or equal to ''experience'', it is replaced by a unit with 0 experience of the type that the value of ''advances_to'' refers to. All modifications that have been done to the unit are applied to the unit it is replaced by.&lt;br /&gt;
* '''flag_rgb''': usually set by [http://www.wesnoth.org/macro-reference.xhtml#MAGENTA_IS_THE_TEAM_COLOR MAGENTA_IS_THE_TEAM_COLOR]; specifies the colours in the base flag to use for team-colouring the unit, expressed as a colour name (such as magenta) or a comma-separated list of RGB values (in hex format).&lt;br /&gt;
* '''gender''': has a value of either ''male'' or ''female'', and determines which of the keys ''male_names'' and ''female_names''  should be read. When a unit of this type is recruited, it will be randomly assigned a name by the random name generator, which will use these names as a base. If '''gender''' is not specified it defaults to ''male''.&lt;br /&gt;
* '''halo''': an image to place centered on the unit. It is drawn on top of the unit, and on top of surrounding units if the image is larger than one hex. It works similarly to the halo attribute of {{tag|InterfaceActionsWML|item}}, and it can be animated with a comma-separated list of images.&lt;br /&gt;
* '''hide_help''': (yes|no) default=no. Determines if the unit type will appear in the in-game help.&lt;br /&gt;
* '''hitpoints''': the maximum HP that the unit has, and the HP it has when it is created.&lt;br /&gt;
* '''id''': the value of the ''type'' key for units of this type. This is required and must be unique among all [unit_type] tags. An ''id'' must consist only of alphanumerics and spaces (or underscores). ''type'' keys are found in [[SingleUnitWML]] and [[FilterWML]]. For example, id=Drake Flare&lt;br /&gt;
*'''ignore_race_traits''': 'yes' or 'no' (default). Determines whether racial traits (see [[UnitsWML]]) are applied. &lt;br /&gt;
* '''image''': sets the base image of the unit, which is used on the map.&lt;br /&gt;
* '''image_icon''': sets an alternative image to be used to represent the unit in any UI dialogs such as the recruit dialog, attack dialog and the unit image box in the sidebar. This is usually a variant of the image with any transparent padding removed, and is usually needed for images that have extra transparent padding for correct positioning on the game map. The image specified by this key will be scaled to 72x72px in the Unit Recruit/Unit Create dialog's listbox and 144x144px on the unit preview panel (the panel that shows the unit's detailed stats, located on left side on recruit/create dialog and on both sides of the attack dialog). [[ImagePathFunctions#Crop_Function|~CROP]] function can be useful here. Scaling might not be a good idea because it will be internally scaled as mentioned above. You can see Loyalists Paladin or the Fire Dragon/Skeletal Dragon units as an example.&lt;br /&gt;
* '''level''': the amount of upkeep the unit costs.  After this unit fights, its opponent gains ''level'' experience. See also kill_experience ([[GameConfigWML]]), and leadership ([[AbilitiesWML]]).&lt;br /&gt;
* '''upkeep''': the amount of upkeep the unit costs if it differs from its level.&lt;br /&gt;
* '''movement''': the number of move points that this unit receives each turn.&lt;br /&gt;
* '''movement_type''': See [[UnitsWML#.5Bmovetype.5D|movetype]]. Note that the tags '''[movement_costs]''', '''[vision_costs]''', '''[defense]''', and '''[resistance]''' can be used to modify this movetype.&lt;br /&gt;
* '''name''': (translatable) displayed in the Status Table for units of this type.&lt;br /&gt;
* '''num_traits''': the number of traits that units of this type should receive when they are recruited, overriding the value set in the [race] tag.&lt;br /&gt;
* '''profile''': the portrait image to use for this unit type. You can also set a portrait for an individual unit instead of the whole unit type (see [[SingleUnitWML]]). The engine first looks for the image in the transparent subdirectory and if found that image is used. If not found it will use the image as-is. If the image width or height is equal or above 300 the engine will scale the image with a factor between 1/2 and 1. For images which should only be shown on the right side in the dialog append ~RIGHT() to the image.&lt;br /&gt;
** If &amp;quot;unit_image&amp;quot; is given instead of a filename, uses the unit's base image as the portrait (in the same manner that unit types without portraits do by default).&lt;br /&gt;
** If &amp;quot;none&amp;quot; is given instead of a filename, no image will be displayed.&lt;br /&gt;
* '''small_profile''': the image to use when a smaller portrait is needed than the one used for messages (e.g., in the help system). When this attribute is missing, the value of the '''profile''' attribute is used instead. When present, the heuristic for finding a transparent portrait is disabled for the '''profile''' attribute, so the correct '''profile''' should be set too. If '''profile''' is not present, '''small_profile''' is ignored. Note that image modifiers are allowed; they might be useful for cropping and rescaling a portrait:&lt;br /&gt;
 small_profile=&amp;quot;portraits/elves/transparent/marksman+female.png~CROP(0,20,380,380)~SCALE(205,205)&amp;quot;&lt;br /&gt;
 profile=&amp;quot;portraits/elves/transparent/marksman+female.png&amp;quot;&lt;br /&gt;
* '''race''': See {{tag|UnitsWML|race}}.  Also used in standard unit filter (see [[FilterWML]]). Mainline Wesnoth features following values:  bats, drake, dwarf, elf, falcon, goblin, gryphon, human, dunefolk, lizard, mechanical, merman, monster, naga, ogre, orc, troll, undead, wolf, wose. They are defined in /data/core/units.cfg.&lt;br /&gt;
* '''undead_variation''': When a unit of this type is killed by a weapon with the plague special, this variation is applied to the new plague unit that is created, whatever its type. For example, if the plague special creates Walking Corpses and undead_variation is set to &amp;quot;troll&amp;quot;, you'll get a troll Walking Corpse. Defaults to the undead_variation set in this unit type's race.&lt;br /&gt;
* '''usage''': the way that the AI should recruit this unit, as determined by the scenario designer. (See ''recruitment_pattern'', [[AiWML]]).  The following are conventions on usage:&lt;br /&gt;
** ''scout'': Fast, mobile unit meant for exploration and village grabbing.&lt;br /&gt;
** ''fighter'': Melee fighter, melee attack substantially more powerful than ranged.&lt;br /&gt;
** ''archer'': Ranged fighter, ranged attack substantially more powerful than melee.&lt;br /&gt;
** ''mixed fighter'': Melee and ranged fighter, melee and ranged attacks roughly equal.&lt;br /&gt;
** ''healer'': Specialty 'heals' or 'cures'.&lt;br /&gt;
:Note that this field primarily affects recruitment.  It also has a small effect on unit movement (the AI tries to keep scouts away from enemies, to some extent).  It does not affect the AI's behavior in combat; that is always computed from attack power and hitpoints. Non-standard usages may be used as well.&lt;br /&gt;
* '''vision''': the number of vision points to calculate the unit's sight range. Defaults to ''movement'' if not present.&lt;br /&gt;
* '''jamming''': the number of jamming points. Defaults to ''0'' if not present. See [[UnitsWML#.5Bmovetype.5D|[jamming_costs]]]&lt;br /&gt;
* '''zoc''': if &amp;quot;yes&amp;quot; the unit will have a zone of control regardless of level.  If present but set to anything other than &amp;quot;yes,&amp;quot; the unit will have no zone of control.  If the tag is omitted, zone of control is dictated by unit level (level 0 = no zoc, level 1+ = has zoc).&lt;br /&gt;
* '''die_sound''': sets the sound, which is used when the unit dies.&lt;br /&gt;
* '''healed_sound''': sets the sound used when the unit is healed in any way (default: heal.wav).&lt;br /&gt;
* '''hp_bar_scaling''': Overrides the attribute in ([[GameConfigWML]]).&lt;br /&gt;
* '''xp_bar_scaling''': Overrides the attribute in ([[GameConfigWML]]).&lt;br /&gt;
* '''bar_offset_x''', '''bar_offset_y''': The offset of the hp and xp bars from the normal bar position of 72x72 unit sprite.&lt;br /&gt;
&lt;br /&gt;
== After max level advancement (AMLA) ==&lt;br /&gt;
* '''[advancement]''': describes what happens to a unit when it reaches the XP required for advancement.  It is considered as an advancement in the same way as advancement described by '''advances_to'''; however, if the player chooses this advancement, the unit will have one or more effects applied to it instead of advancing.&lt;br /&gt;
** '''id''': unique identifier for this advancement; ''Required'' if there are multiple advancement options, or if ''strict_amla=no''.&lt;br /&gt;
** '''always_display''': if set to true displays the AMLA option even if it is the only available one.&lt;br /&gt;
** '''description''': a description displayed as the option for this advancement if there is another advancement option that the player must choose from; otherwise, the advancement is chosen automatically and this key is irrelevant.&lt;br /&gt;
** '''image''': an image to display next to the description in the advancement menu.&lt;br /&gt;
** '''max_times''': default 1.  The maximum times the unit can be awarded this advancement. Pass -1 for &amp;quot;unlimited&amp;quot;.&lt;br /&gt;
** '''strict_amla''':  (yes|no) default=no. Disable the AMLA if the unit can advance to another unit.&lt;br /&gt;
** '''major_amla''': (yes|no) default=no. Sets whether the unit's XP bar is blue(=yes) or purple(=no). In case of more [advancement] tags, if there is one with major_amla=yes, the XP bar will be blue.&lt;br /&gt;
** '''require_amla''': An optional list of AMLA ''id'' keys that act as prerequisites for this advancement to become available.  Order is not important, and an AMLA id can be repeated any number of times to indicate that another advancement must be chosen several times before this advancement option will become available.&lt;br /&gt;
*** example: &amp;lt;tt&amp;gt;require_amla=tough,tough,incr_damage&amp;lt;/tt&amp;gt; assumes there exist other [advancement] options called ''id=tough'' and ''id=incr_damage''.  Once ''tough'' is chosen twice and ''incr_damage'' is chosen once, then the current [advancement] will become available.&lt;br /&gt;
*** ''require_amla=tough,incr_damage,tough'' is an equivalent way of expressing this.&lt;br /&gt;
** '''exclude_amla''': {{DevFeature1.13|2}} An optional list of AMLA ''id'' keys that represent AMLAs that are mutually exclusive to this one. Order is not important, and an AMLA id can be repeated. If the unit already has any of the AMLAs that appear once in this list, then this AMLA will not be made available. If an AMLA id appears multiple times in the list, then this AMLA will be made available only if the other AMLA has been chosen less than the number of times it appears in the list. Of course, for this to really make two AMLAs mutually exclusive, you need to add ''exclude_amla'' to both AMLA defintions.&lt;br /&gt;
** '''[effect]''': A modification applied to the unit whenever this advancement is chosen.  See [[EffectWML]]&lt;br /&gt;
** '''[filter]''': A  [[StandardUnitFilter]],  the advancement will only be available when the unit passes this filter during the time the advancement dialog is shown.&lt;br /&gt;
&lt;br /&gt;
== Attacks ==&lt;br /&gt;
* '''[attack]''': one of the unit's attacks.&lt;br /&gt;
** '''description''': a translatable text for name of the attack, to be displayed to the user.&lt;br /&gt;
** '''name''': the name of the attack. Used as a default description, if ''description'' is not present, and to determine the default icon, if ''icon'' is not present (see below).  Non-translatable.  Used for the ''has_weapon'' key and animation filters; see [[StandardUnitFilter]] and [[AnimationWML]]&lt;br /&gt;
** '''type''': the damage type of the attack.  Used in determining resistance to this attack (see {{tag|UnitsWML|movetype|resistance}}). Usually this is one of ''blade'', ''pierce'', ''impact'', ''fire'', ''cold'', or ''arcane'', but it can be set to anything (as long as it contains only letters, numbers, and underscores). When using a custom type, you will need to set its user-visible name using [[LanguageWML]]. {{DevFeature1.15|0}} When showing the icon for a custom damage type in the sidebar, the game will look for a file called icons/profiles/''type''.png under your addon's images folder. For example, the icon for a damage type called ''electric'' would be at images/icons/profiles/electric.png.&lt;br /&gt;
** '''[specials]''': contains the specials of the attack. See [[AbilitiesWML#The_.5Bspecials.5D_tag|AbilitiesWML]].&lt;br /&gt;
** '''icon''': the image to use as an icon for the attack in the attack choice menu, as a path relative to the images directory. Defaults to the attack's name in the attacks directory (Ex. if ''name=sword'' then default is ''icon=attacks/sword.png''). &lt;br /&gt;
** '''range''': the range of the attack.  Used to determine the enemy's retaliation, which will be of the same type. The range can be anything (as long as it contains only letters, numbers, and underscores), but the standard values are ''melee'' and ''ranged''. Units can only retaliate against attacks for which they have a corresponding attack of the same range. When using a custom range, you will need to set its user-visible name using [[LanguageWML]]. {{DevFeature1.15|0}} When showing the icon for a custom range in the sidebar the game will look for a file called icons/profiles/''range''_attack.png under your addon's images folder. For example, the icon for a range called ''very_long'' would be at images/icons/profiles/very_long_attack.png.&lt;br /&gt;
** '''max_range''': maximum distance (in number of hexes) to which this attack works. Default is 1.&lt;br /&gt;
*** This currently lacks UI and AI support.&lt;br /&gt;
** '''min_range''': minimum distance (in number of hexes) to which this attack works. Default is 1.&lt;br /&gt;
*** This currently lacks UI and AI support.&lt;br /&gt;
** '''damage''': the damage of this attack&lt;br /&gt;
** '''number''': the number of strikes per attack this weapon has&lt;br /&gt;
** '''accuracy''': a number added to the chance to hit whenever using this weapon offensively (i.e. during a strike with this attack, regardless of who initiated the combat); negative values work too&lt;br /&gt;
** '''parry''': a number deducted from the enemy chance to hit whenever using this weapon defensively (i.e. during the enemy's strike, regardless of who initiated the combat); negative values work too&lt;br /&gt;
** '''movement_used''': determines how many movement points using this attack expends. By default all movement is used up, set this to 0 to make attacking with this attack expend no movement.&lt;br /&gt;
** '''attacks_used''': {{DevFeature1.17|12}} determines how many attacks this attack expends (default 1). This number is deducted from the unit's &amp;lt;tt&amp;gt;attacks_left&amp;lt;/tt&amp;gt; when they use this attack.&lt;br /&gt;
** '''attack_weight''': multiplier for total damage that the AI should use to choose which attack to use when attacking (and offer to player as default). Setting it to 0 disables the attack on attack. Until {{DevFeature1.19|2}} positive attack_weight was ignored.&lt;br /&gt;
** '''defense_weight''': used to determine which attack is used for retaliation. This affects gameplay, as the player is not allowed to determine his unit's retaliation weapon. Setting it to 0 disable the attacks on defense.&lt;br /&gt;
** '''alignment''': {{DevFeature1.19|5}} one of lawful/neutral/chaotic/liminal (See TimeWML). Default is unit alignment.&lt;br /&gt;
&lt;br /&gt;
== Other tags ==&lt;br /&gt;
* {{anchor|base_unit|'''[base_unit]'''}}: Contains one attribute, '''id''', which must be the ID of a unit type.  If specified, the UnitTypeWML for that unit is copied into this one, as if by [[InternalActionsWML#.5Bset_variables.5D|[set_variables]mode=merge]]. Additionally, the unit will be marked as variation of the base unit in its own help page, but not in the help page of the base unit.&lt;br /&gt;
&lt;br /&gt;
* '''[abilities]''': Defines the abilities of a unit. See [[AbilitiesWML]]&lt;br /&gt;
&lt;br /&gt;
* '''[event]''': Any [event] written inside the [unit_type] tag will get included into any scenario where a unit of this type appears in. Note that such events get included when a unit of this type first appears in the scenario, not automatically when the scenario begins (meaning that ''name=prestart'' events, for example, would usually never trigger). See [[EventWML]] and [[WML_Abilities|WML Abilities]]. {{DevFeature1.19|4}} Abilities support [event].&lt;br /&gt;
&lt;br /&gt;
* {{anchor|variation|'''[variation]'''}}: Defines a variation of a unit. Variations are invoked with an [effect] tag or the variation= attribute in [[SingleUnitWML]]. They are currently used for graphical variations (giving character sprites new weapons) but theoretically you could do anything with it.&lt;br /&gt;
** '''variation_id''': Mandatory. The value of '''variation=''' used in SingleUnitWML to choose this variant.&lt;br /&gt;
** '''variation_name''': Translatable. The name of the variation, which is displayed in the help and in debug mode. Not setting this looks bad unless combined with '''hide_help'''=yes.&lt;br /&gt;
** '''inherit''': if ''yes'', inherits all the properties of the base unit, as if by [[InternalActionsWML#.5Bset_variables.5D|[set_variables]mode=merge]]. Defaults to no.&lt;br /&gt;
*** The '''id''' key is always inherited, regardless of the value of '''inherit'''.&lt;br /&gt;
** All keys and tags of '''[unit_type]''', except ''[advancefrom]'', ''[base_unit]'', ''[female]'', ''[male]'', and ''[variation]''.&lt;br /&gt;
&lt;br /&gt;
* '''[male]''', '''[female]''': These can specify a variation based on gender for a unit. If these are provided, they will automatically apply based upon the gender of a unit.&lt;br /&gt;
** '''inherit''': if ''yes'', inherits all the properties of the base unit, as if by [[InternalActionsWML#.5Bset_variables.5D|[set_variables]mode=merge]]. Defaults to yes.&lt;br /&gt;
*** The '''id''' key is always inherited, regardless of the value of '''inherit'''.&lt;br /&gt;
** All '''[unit_type]''' tags and keys, excluding ''[advancefrom]'', ''[base_unit]'', ''[female]'', and ''[male]''.&lt;br /&gt;
* '''[trait]''': Adds an additional trait to the pool. See [[UnitsWML]] for the syntax.&lt;br /&gt;
* '''[special_note]''' {{DevFeature1.15|2}} see [[UnitTypeWML#Special_Notes|below]].&lt;br /&gt;
&lt;br /&gt;
== Special Notes ==&lt;br /&gt;
&lt;br /&gt;
Use of the '''[special_note]''' tags and attributes results in a bulleted list of special notes in the unit type's help page and in the sidebar tooltip for the unit type's name. Prior to 1.15.2, the old format for special notes was simply text included in the '''[unit_type]description''' attribute.&lt;br /&gt;
&lt;br /&gt;
Note that the sidebar tooltip shows the notes for the current unit, but opening the help-browser by right-clicking on a unit shows the notes for generic units of that type. These can be different if the unit has '''[modifications]'''.&lt;br /&gt;
&lt;br /&gt;
Text given in the following attributes will be collected and shown as the special notes for units and unit types:&lt;br /&gt;
&lt;br /&gt;
* {{DevFeature1.15|2}} [unit_type][special_note]note=&lt;br /&gt;
* {{DevFeature1.15|2}} [unit][special_note]note= (these are used ''instead of'' any defined in the [unit_type])&lt;br /&gt;
* {{DevFeature1.15|14}} [movetype][special_note]note=&lt;br /&gt;
* {{DevFeature1.15|14}} [''ability tag name'']special_note=&lt;br /&gt;
* {{DevFeature1.15|14}} [attack][specials][''special tag name'']special_note=&lt;br /&gt;
* {{DevFeature1.15|14}} [language]special_note_damage_type_''TYPE''=&lt;br /&gt;
    &lt;br /&gt;
It's no longer necessary to put these notes in each unit_type's .cfg file, and the macros for doing so are now deprecated.&lt;br /&gt;
&lt;br /&gt;
== Removed keys ==&lt;br /&gt;
&lt;br /&gt;
These don't work any more, the documentation is left here as an aid to porting old code.&lt;br /&gt;
&lt;br /&gt;
* {{anchor|advancefrom|'''[advancefrom]'''}}: {{DevFeature1.15|4}} replaced by [[ModificationWML|[modify_unit_type]]]. Defines the previous unit type on the advancement tree. Allows a campaign-specific unit to be spliced into an already existing advancement tree.  It should generally be used only inside a campaign ifdef, to prevent changes to other campaigns. Since all multiplayer content shares MULTIPLAYER define, using advancefrom changes unit type even if the addon is not actively used. For that reason multiplayer advancefrom may only be used with unit types defined in the same addon - then everyone who has the unit has it with same advancements.  This tag makes changes to the ''advances_to'' and ''experience'' keys of a base unit to make it advance into this unit.  It takes these keys:&lt;br /&gt;
** ''unit'': the id of the base unit from which this unit advances.  This adds the unit into the list of units which ''unit'' can advance into.&lt;br /&gt;
** ''experience'': (optional) If present the experience needed to advance is set to this value. If there are more than one [advancefrom] tags referencing the same base unit within the same preprocessor scope (e.g. a campaign #ifdef) with experience= keys, the lowest value of these is chosen.  Note: this will also lower the experience required to advance to other units which the base unit can advance into.&lt;br /&gt;
: If the previous unit type makes use of '''[male]''' and/or '''[female]''' tags, then the current (new) unit type is expected to also. That is, the subtypes defined by those tags will only receive this advancement if the new type has a corresponding tag.&lt;br /&gt;
{{DevFeature1.15|4}} '''[advancefrom]''' was effectively removed in 1.15.4. The intention was to deprecate it, but  the compatibility code that was meant to support it in 1.16 was untested and nonfunctional.&lt;br /&gt;
&lt;br /&gt;
== Deprecating units ==&lt;br /&gt;
&lt;br /&gt;
A macro is provided for deprecating a unit, which uses the built-in deprecation system but hard-codes the level to 3 (meaning &amp;quot;for removal&amp;quot;). The syntax is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=wml&amp;gt;{DEPRECATED_UNIT old_id new_id version}&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can also set the new_id to an empty string if there is no replacement.&lt;br /&gt;
&lt;br /&gt;
== See Also ==&lt;br /&gt;
&lt;br /&gt;
* [[AnimationWML]]&lt;br /&gt;
* [[ReferenceWML]]&lt;br /&gt;
* [[TerrainWML]]&lt;br /&gt;
&lt;br /&gt;
[[Category: WML Reference]]&lt;/div&gt;</summary>
		<author><name>Soliton</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.wesnoth.org/index.php?title=UnitTypeWML&amp;diff=74493</id>
		<title>UnitTypeWML</title>
		<link rel="alternate" type="text/html" href="https://wiki.wesnoth.org/index.php?title=UnitTypeWML&amp;diff=74493"/>
		<updated>2025-08-22T16:00:02Z</updated>

		<summary type="html">&lt;p&gt;Soliton: /* Unit Type */ clarify portrait scaling&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{WML Tags}}&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
== Unit Type ==&lt;br /&gt;
&lt;br /&gt;
Each '''[unit_type]''' tag defines one unit type. (for the use of [unit] to create a unit, see [[SingleUnitWML]])&lt;br /&gt;
&lt;br /&gt;
Unit animation syntax is described in [[AnimationWML]]. In addition to the animation tags described there, the following key/tags are recognized:&lt;br /&gt;
* '''advances_to''': When this unit has ''experience'' greater than or equal to ''experience'', it is replaced by a unit of the type that the value of ''advances_to'' refers to. All modifications that have been done to the unit are applied to the unit it is replaced by. The special value 'null' says that the unit does not advance but gets an AMLA instead. Can be a comma-separated list of units that can be chosen from upon advancing.&lt;br /&gt;
* '''alignment''': one of lawful/neutral/chaotic/liminal (See [[TimeWML]]). Default is &amp;quot;neutral&amp;quot;.&lt;br /&gt;
* '''attacks''': the number of times that this unit can attack each turn. Default is 1.&lt;br /&gt;
* '''cost''': when a player recruits a unit of this type, the player loses ''cost'' gold. If this would cause gold to drop below 0,  the unit cannot be recruited. Default is 1.&lt;br /&gt;
* '''recall_cost''': {{DevFeature1.13|0}} the default recall cost of units of this type, overriding the recall cost set in scenario [[SideWML|[side]]] tags or the global [[GameConfigWML|[game_config]]] value. Individual units may override this value in [[SingleUnitWML|[unit]]]. A value of -1 is equivalent to not specifying this attribute. {{DevFeature1.15|0}} Units are now recalled for AI sides even if the recall_cost is larger than the unit's worth (essentially its cost, plus potentially a bonus for experience points). In 1.14 and earlier, units were not recalled by the AI in this case even if this was the only recall/recruit action possible to the AI.&lt;br /&gt;
* '''description''': (translatable) the text displayed in the unit descriptor box for this unit. Default 'No description available...'. &lt;br /&gt;
* '''do_not_list''': Not used by the game, but by tools for browsing and listing the unit tree. If this is 'yes', the unit will be ignored by these tools. {{DevFeature1.13|?}} When placing units in debug mode this unit isn't listed (but can still be placed using the :create command). This restriction is lifted in version &amp;lt;b&amp;gt;1.14.3&amp;lt;/b&amp;gt;.&lt;br /&gt;
* '''ellipse''': the ellipse image to display under the unit, which is normally team-colored. Default is &amp;quot;misc/ellipse&amp;quot;. &amp;quot;-nozoc&amp;quot; and &amp;quot;-leader&amp;quot; are automatically appended for units without zone of control and with canrecruit=yes respectively. The [http://www.wesnoth.org/macro-reference.xhtml#IS_HERO IS_HERO]/[http://www.wesnoth.org/macro-reference.xhtml#MAKE_HERO MAKE_HERO]/[http://www.wesnoth.org/macro-reference.xhtml#UNMAKE_HERO UNMAKE_HERO] macros change the ellipse to/back from &amp;quot;misc/ellipse-hero&amp;quot;. Finally, setting this to &amp;quot;none&amp;quot; will cause the unit to not have any ellipses displayed under it regardless of the user's preferences.&amp;lt;br/&amp;gt;WARNING: Be aware that setting this to &amp;quot;misc/ellipse-hero&amp;quot; for a unit with canrecruit=yes will result in the ellipse being &amp;quot;misc/ellipse-hero-leader&amp;quot;, which is not a supported combination (it doesn't have a graphic, and will cause error logs that the graphic is missing). This is tracked as bug [https://github.com/wesnoth/wesnoth/issues/6258 6258] on GitHub.&amp;lt;br/&amp;gt;{{DevFeature1.17|26}} canrecruit=yes is now supported with &amp;quot;misc/ellipse-hero&amp;quot;, since &amp;quot;misc/ellipse-hero-leader&amp;quot; has been added in [https://github.com/wesnoth/wesnoth/pull/8375 8375].&lt;br /&gt;
* '''experience''': When this unit has experience greater than or equal to ''experience'', it is replaced by a unit with 0 experience of the type that the value of ''advances_to'' refers to. All modifications that have been done to the unit are applied to the unit it is replaced by.&lt;br /&gt;
* '''flag_rgb''': usually set by [http://www.wesnoth.org/macro-reference.xhtml#MAGENTA_IS_THE_TEAM_COLOR MAGENTA_IS_THE_TEAM_COLOR]; specifies the colours in the base flag to use for team-colouring the unit, expressed as a colour name (such as magenta) or a comma-separated list of RGB values (in hex format).&lt;br /&gt;
* '''gender''': has a value of either ''male'' or ''female'', and determines which of the keys ''male_names'' and ''female_names''  should be read. When a unit of this type is recruited, it will be randomly assigned a name by the random name generator, which will use these names as a base. If '''gender''' is not specified it defaults to ''male''.&lt;br /&gt;
* '''halo''': an image to place centered on the unit. It is drawn on top of the unit, and on top of surrounding units if the image is larger than one hex. It works similarly to the halo attribute of {{tag|InterfaceActionsWML|item}}, and it can be animated with a comma-separated list of images.&lt;br /&gt;
* '''hide_help''': (yes|no) default=no. Determines if the unit type will appear in the in-game help.&lt;br /&gt;
* '''hitpoints''': the maximum HP that the unit has, and the HP it has when it is created.&lt;br /&gt;
* '''id''': the value of the ''type'' key for units of this type. This is required and must be unique among all [unit_type] tags. An ''id'' must consist only of alphanumerics and spaces (or underscores). ''type'' keys are found in [[SingleUnitWML]] and [[FilterWML]]. For example, id=Drake Flare&lt;br /&gt;
*'''ignore_race_traits''': 'yes' or 'no' (default). Determines whether racial traits (see [[UnitsWML]]) are applied. &lt;br /&gt;
* '''image''': sets the base image of the unit, which is used on the map.&lt;br /&gt;
* '''image_icon''': sets an alternative image to be used to represent the unit in any UI dialogs such as the recruit dialog, attack dialog and the unit image box in the sidebar. This is usually a variant of the image with any transparent padding removed, and is usually needed for images that have extra transparent padding for correct positioning on the game map. The image specified by this key will be scaled to 72x72px in the Unit Recruit/Unit Create dialog's listbox and 144x144px on the unit preview panel (the panel that shows the unit's detailed stats, located on left side on recruit/create dialog and on both sides of the attack dialog). [[ImagePathFunctions#Crop_Function|~CROP]] function can be useful here. Scaling might not be a good idea because it will be internally scaled as mentioned above. You can see Loyalists Paladin or the Fire Dragon/Skeletal Dragon units as an example.&lt;br /&gt;
* '''level''': the amount of upkeep the unit costs.  After this unit fights, its opponent gains ''level'' experience. See also kill_experience ([[GameConfigWML]]), and leadership ([[AbilitiesWML]]).&lt;br /&gt;
* '''upkeep''': the amount of upkeep the unit costs if it differs from its level.&lt;br /&gt;
* '''movement''': the number of move points that this unit receives each turn.&lt;br /&gt;
* '''movement_type''': See [[UnitsWML#.5Bmovetype.5D|movetype]]. Note that the tags '''[movement_costs]''', '''[vision_costs]''', '''[defense]''', and '''[resistance]''' can be used to modify this movetype.&lt;br /&gt;
* '''name''': (translatable) displayed in the Status Table for units of this type.&lt;br /&gt;
* '''num_traits''': the number of traits that units of this type should receive when they are recruited, overriding the value set in the [race] tag.&lt;br /&gt;
* '''profile''': the portrait image to use for this unit type. You can also set a portrait for an individual unit instead of the whole unit type (see [[SingleUnitWML]]). The engine first looks for the image in the transparent subdirectory and if found that image is used. If not found it will use the image as-is. If the image width or height is below 300 the engine will scale the image with a factor between 1/2 and 1. For images which should only be shown on the right side in the dialog append ~RIGHT() to the image.&lt;br /&gt;
** If &amp;quot;unit_image&amp;quot; is given instead of a filename, uses the unit's base image as the portrait (in the same manner that unit types without portraits do by default).&lt;br /&gt;
** If &amp;quot;none&amp;quot; is given instead of a filename, no image will be displayed.&lt;br /&gt;
* '''small_profile''': the image to use when a smaller portrait is needed than the one used for messages (e.g., in the help system). When this attribute is missing, the value of the '''profile''' attribute is used instead. When present, the heuristic for finding a transparent portrait is disabled for the '''profile''' attribute, so the correct '''profile''' should be set too. If '''profile''' is not present, '''small_profile''' is ignored. Note that image modifiers are allowed; they might be useful for cropping and rescaling a portrait:&lt;br /&gt;
 small_profile=&amp;quot;portraits/elves/transparent/marksman+female.png~CROP(0,20,380,380)~SCALE(205,205)&amp;quot;&lt;br /&gt;
 profile=&amp;quot;portraits/elves/transparent/marksman+female.png&amp;quot;&lt;br /&gt;
* '''race''': See {{tag|UnitsWML|race}}.  Also used in standard unit filter (see [[FilterWML]]). Mainline Wesnoth features following values:  bats, drake, dwarf, elf, falcon, goblin, gryphon, human, dunefolk, lizard, mechanical, merman, monster, naga, ogre, orc, troll, undead, wolf, wose. They are defined in /data/core/units.cfg.&lt;br /&gt;
* '''undead_variation''': When a unit of this type is killed by a weapon with the plague special, this variation is applied to the new plague unit that is created, whatever its type. For example, if the plague special creates Walking Corpses and undead_variation is set to &amp;quot;troll&amp;quot;, you'll get a troll Walking Corpse. Defaults to the undead_variation set in this unit type's race.&lt;br /&gt;
* '''usage''': the way that the AI should recruit this unit, as determined by the scenario designer. (See ''recruitment_pattern'', [[AiWML]]).  The following are conventions on usage:&lt;br /&gt;
** ''scout'': Fast, mobile unit meant for exploration and village grabbing.&lt;br /&gt;
** ''fighter'': Melee fighter, melee attack substantially more powerful than ranged.&lt;br /&gt;
** ''archer'': Ranged fighter, ranged attack substantially more powerful than melee.&lt;br /&gt;
** ''mixed fighter'': Melee and ranged fighter, melee and ranged attacks roughly equal.&lt;br /&gt;
** ''healer'': Specialty 'heals' or 'cures'.&lt;br /&gt;
:Note that this field primarily affects recruitment.  It also has a small effect on unit movement (the AI tries to keep scouts away from enemies, to some extent).  It does not affect the AI's behavior in combat; that is always computed from attack power and hitpoints. Non-standard usages may be used as well.&lt;br /&gt;
* '''vision''': the number of vision points to calculate the unit's sight range. Defaults to ''movement'' if not present.&lt;br /&gt;
* '''jamming''': the number of jamming points. Defaults to ''0'' if not present. See [[UnitsWML#.5Bmovetype.5D|[jamming_costs]]]&lt;br /&gt;
* '''zoc''': if &amp;quot;yes&amp;quot; the unit will have a zone of control regardless of level.  If present but set to anything other than &amp;quot;yes,&amp;quot; the unit will have no zone of control.  If the tag is omitted, zone of control is dictated by unit level (level 0 = no zoc, level 1+ = has zoc).&lt;br /&gt;
* '''die_sound''': sets the sound, which is used when the unit dies.&lt;br /&gt;
* '''healed_sound''': sets the sound used when the unit is healed in any way (default: heal.wav).&lt;br /&gt;
* '''hp_bar_scaling''': Overrides the attribute in ([[GameConfigWML]]).&lt;br /&gt;
* '''xp_bar_scaling''': Overrides the attribute in ([[GameConfigWML]]).&lt;br /&gt;
* '''bar_offset_x''', '''bar_offset_y''': The offset of the hp and xp bars from the normal bar position of 72x72 unit sprite.&lt;br /&gt;
&lt;br /&gt;
== After max level advancement (AMLA) ==&lt;br /&gt;
* '''[advancement]''': describes what happens to a unit when it reaches the XP required for advancement.  It is considered as an advancement in the same way as advancement described by '''advances_to'''; however, if the player chooses this advancement, the unit will have one or more effects applied to it instead of advancing.&lt;br /&gt;
** '''id''': unique identifier for this advancement; ''Required'' if there are multiple advancement options, or if ''strict_amla=no''.&lt;br /&gt;
** '''always_display''': if set to true displays the AMLA option even if it is the only available one.&lt;br /&gt;
** '''description''': a description displayed as the option for this advancement if there is another advancement option that the player must choose from; otherwise, the advancement is chosen automatically and this key is irrelevant.&lt;br /&gt;
** '''image''': an image to display next to the description in the advancement menu.&lt;br /&gt;
** '''max_times''': default 1.  The maximum times the unit can be awarded this advancement. Pass -1 for &amp;quot;unlimited&amp;quot;.&lt;br /&gt;
** '''strict_amla''':  (yes|no) default=no. Disable the AMLA if the unit can advance to another unit.&lt;br /&gt;
** '''major_amla''': (yes|no) default=no. Sets whether the unit's XP bar is blue(=yes) or purple(=no). In case of more [advancement] tags, if there is one with major_amla=yes, the XP bar will be blue.&lt;br /&gt;
** '''require_amla''': An optional list of AMLA ''id'' keys that act as prerequisites for this advancement to become available.  Order is not important, and an AMLA id can be repeated any number of times to indicate that another advancement must be chosen several times before this advancement option will become available.&lt;br /&gt;
*** example: &amp;lt;tt&amp;gt;require_amla=tough,tough,incr_damage&amp;lt;/tt&amp;gt; assumes there exist other [advancement] options called ''id=tough'' and ''id=incr_damage''.  Once ''tough'' is chosen twice and ''incr_damage'' is chosen once, then the current [advancement] will become available.&lt;br /&gt;
*** ''require_amla=tough,incr_damage,tough'' is an equivalent way of expressing this.&lt;br /&gt;
** '''exclude_amla''': {{DevFeature1.13|2}} An optional list of AMLA ''id'' keys that represent AMLAs that are mutually exclusive to this one. Order is not important, and an AMLA id can be repeated. If the unit already has any of the AMLAs that appear once in this list, then this AMLA will not be made available. If an AMLA id appears multiple times in the list, then this AMLA will be made available only if the other AMLA has been chosen less than the number of times it appears in the list. Of course, for this to really make two AMLAs mutually exclusive, you need to add ''exclude_amla'' to both AMLA defintions.&lt;br /&gt;
** '''[effect]''': A modification applied to the unit whenever this advancement is chosen.  See [[EffectWML]]&lt;br /&gt;
** '''[filter]''': A  [[StandardUnitFilter]],  the advancement will only be available when the unit passes this filter during the time the advancement dialog is shown.&lt;br /&gt;
&lt;br /&gt;
== Attacks ==&lt;br /&gt;
* '''[attack]''': one of the unit's attacks.&lt;br /&gt;
** '''description''': a translatable text for name of the attack, to be displayed to the user.&lt;br /&gt;
** '''name''': the name of the attack. Used as a default description, if ''description'' is not present, and to determine the default icon, if ''icon'' is not present (see below).  Non-translatable.  Used for the ''has_weapon'' key and animation filters; see [[StandardUnitFilter]] and [[AnimationWML]]&lt;br /&gt;
** '''type''': the damage type of the attack.  Used in determining resistance to this attack (see {{tag|UnitsWML|movetype|resistance}}). Usually this is one of ''blade'', ''pierce'', ''impact'', ''fire'', ''cold'', or ''arcane'', but it can be set to anything (as long as it contains only letters, numbers, and underscores). When using a custom type, you will need to set its user-visible name using [[LanguageWML]]. {{DevFeature1.15|0}} When showing the icon for a custom damage type in the sidebar, the game will look for a file called icons/profiles/''type''.png under your addon's images folder. For example, the icon for a damage type called ''electric'' would be at images/icons/profiles/electric.png.&lt;br /&gt;
** '''[specials]''': contains the specials of the attack. See [[AbilitiesWML#The_.5Bspecials.5D_tag|AbilitiesWML]].&lt;br /&gt;
** '''icon''': the image to use as an icon for the attack in the attack choice menu, as a path relative to the images directory. Defaults to the attack's name in the attacks directory (Ex. if ''name=sword'' then default is ''icon=attacks/sword.png''). &lt;br /&gt;
** '''range''': the range of the attack.  Used to determine the enemy's retaliation, which will be of the same type. The range can be anything (as long as it contains only letters, numbers, and underscores), but the standard values are ''melee'' and ''ranged''. Units can only retaliate against attacks for which they have a corresponding attack of the same range. When using a custom range, you will need to set its user-visible name using [[LanguageWML]]. {{DevFeature1.15|0}} When showing the icon for a custom range in the sidebar the game will look for a file called icons/profiles/''range''_attack.png under your addon's images folder. For example, the icon for a range called ''very_long'' would be at images/icons/profiles/very_long_attack.png.&lt;br /&gt;
** '''max_range''': maximum distance (in number of hexes) to which this attack works. Default is 1.&lt;br /&gt;
*** This currently lacks UI and AI support.&lt;br /&gt;
** '''min_range''': minimum distance (in number of hexes) to which this attack works. Default is 1.&lt;br /&gt;
*** This currently lacks UI and AI support.&lt;br /&gt;
** '''damage''': the damage of this attack&lt;br /&gt;
** '''number''': the number of strikes per attack this weapon has&lt;br /&gt;
** '''accuracy''': a number added to the chance to hit whenever using this weapon offensively (i.e. during a strike with this attack, regardless of who initiated the combat); negative values work too&lt;br /&gt;
** '''parry''': a number deducted from the enemy chance to hit whenever using this weapon defensively (i.e. during the enemy's strike, regardless of who initiated the combat); negative values work too&lt;br /&gt;
** '''movement_used''': determines how many movement points using this attack expends. By default all movement is used up, set this to 0 to make attacking with this attack expend no movement.&lt;br /&gt;
** '''attacks_used''': {{DevFeature1.17|12}} determines how many attacks this attack expends (default 1). This number is deducted from the unit's &amp;lt;tt&amp;gt;attacks_left&amp;lt;/tt&amp;gt; when they use this attack.&lt;br /&gt;
** '''attack_weight''': multiplier for total damage that the AI should use to choose which attack to use when attacking (and offer to player as default). Setting it to 0 disables the attack on attack. Until {{DevFeature1.19|2}} positive attack_weight was ignored.&lt;br /&gt;
** '''defense_weight''': used to determine which attack is used for retaliation. This affects gameplay, as the player is not allowed to determine his unit's retaliation weapon. Setting it to 0 disable the attacks on defense.&lt;br /&gt;
** '''alignment''': {{DevFeature1.19|5}} one of lawful/neutral/chaotic/liminal (See TimeWML). Default is unit alignment.&lt;br /&gt;
&lt;br /&gt;
== Other tags ==&lt;br /&gt;
* {{anchor|base_unit|'''[base_unit]'''}}: Contains one attribute, '''id''', which must be the ID of a unit type.  If specified, the UnitTypeWML for that unit is copied into this one, as if by [[InternalActionsWML#.5Bset_variables.5D|[set_variables]mode=merge]]. Additionally, the unit will be marked as variation of the base unit in its own help page, but not in the help page of the base unit.&lt;br /&gt;
&lt;br /&gt;
* '''[abilities]''': Defines the abilities of a unit. See [[AbilitiesWML]]&lt;br /&gt;
&lt;br /&gt;
* '''[event]''': Any [event] written inside the [unit_type] tag will get included into any scenario where a unit of this type appears in. Note that such events get included when a unit of this type first appears in the scenario, not automatically when the scenario begins (meaning that ''name=prestart'' events, for example, would usually never trigger). See [[EventWML]] and [[WML_Abilities|WML Abilities]]. {{DevFeature1.19|4}} Abilities support [event].&lt;br /&gt;
&lt;br /&gt;
* {{anchor|variation|'''[variation]'''}}: Defines a variation of a unit. Variations are invoked with an [effect] tag or the variation= attribute in [[SingleUnitWML]]. They are currently used for graphical variations (giving character sprites new weapons) but theoretically you could do anything with it.&lt;br /&gt;
** '''variation_id''': Mandatory. The value of '''variation=''' used in SingleUnitWML to choose this variant.&lt;br /&gt;
** '''variation_name''': Translatable. The name of the variation, which is displayed in the help and in debug mode. Not setting this looks bad unless combined with '''hide_help'''=yes.&lt;br /&gt;
** '''inherit''': if ''yes'', inherits all the properties of the base unit, as if by [[InternalActionsWML#.5Bset_variables.5D|[set_variables]mode=merge]]. Defaults to no.&lt;br /&gt;
*** The '''id''' key is always inherited, regardless of the value of '''inherit'''.&lt;br /&gt;
** All keys and tags of '''[unit_type]''', except ''[advancefrom]'', ''[base_unit]'', ''[female]'', ''[male]'', and ''[variation]''.&lt;br /&gt;
&lt;br /&gt;
* '''[male]''', '''[female]''': These can specify a variation based on gender for a unit. If these are provided, they will automatically apply based upon the gender of a unit.&lt;br /&gt;
** '''inherit''': if ''yes'', inherits all the properties of the base unit, as if by [[InternalActionsWML#.5Bset_variables.5D|[set_variables]mode=merge]]. Defaults to yes.&lt;br /&gt;
*** The '''id''' key is always inherited, regardless of the value of '''inherit'''.&lt;br /&gt;
** All '''[unit_type]''' tags and keys, excluding ''[advancefrom]'', ''[base_unit]'', ''[female]'', and ''[male]''.&lt;br /&gt;
* '''[trait]''': Adds an additional trait to the pool. See [[UnitsWML]] for the syntax.&lt;br /&gt;
* '''[special_note]''' {{DevFeature1.15|2}} see [[UnitTypeWML#Special_Notes|below]].&lt;br /&gt;
&lt;br /&gt;
== Special Notes ==&lt;br /&gt;
&lt;br /&gt;
Use of the '''[special_note]''' tags and attributes results in a bulleted list of special notes in the unit type's help page and in the sidebar tooltip for the unit type's name. Prior to 1.15.2, the old format for special notes was simply text included in the '''[unit_type]description''' attribute.&lt;br /&gt;
&lt;br /&gt;
Note that the sidebar tooltip shows the notes for the current unit, but opening the help-browser by right-clicking on a unit shows the notes for generic units of that type. These can be different if the unit has '''[modifications]'''.&lt;br /&gt;
&lt;br /&gt;
Text given in the following attributes will be collected and shown as the special notes for units and unit types:&lt;br /&gt;
&lt;br /&gt;
* {{DevFeature1.15|2}} [unit_type][special_note]note=&lt;br /&gt;
* {{DevFeature1.15|2}} [unit][special_note]note= (these are used ''instead of'' any defined in the [unit_type])&lt;br /&gt;
* {{DevFeature1.15|14}} [movetype][special_note]note=&lt;br /&gt;
* {{DevFeature1.15|14}} [''ability tag name'']special_note=&lt;br /&gt;
* {{DevFeature1.15|14}} [attack][specials][''special tag name'']special_note=&lt;br /&gt;
* {{DevFeature1.15|14}} [language]special_note_damage_type_''TYPE''=&lt;br /&gt;
    &lt;br /&gt;
It's no longer necessary to put these notes in each unit_type's .cfg file, and the macros for doing so are now deprecated.&lt;br /&gt;
&lt;br /&gt;
== Removed keys ==&lt;br /&gt;
&lt;br /&gt;
These don't work any more, the documentation is left here as an aid to porting old code.&lt;br /&gt;
&lt;br /&gt;
* {{anchor|advancefrom|'''[advancefrom]'''}}: {{DevFeature1.15|4}} replaced by [[ModificationWML|[modify_unit_type]]]. Defines the previous unit type on the advancement tree. Allows a campaign-specific unit to be spliced into an already existing advancement tree.  It should generally be used only inside a campaign ifdef, to prevent changes to other campaigns. Since all multiplayer content shares MULTIPLAYER define, using advancefrom changes unit type even if the addon is not actively used. For that reason multiplayer advancefrom may only be used with unit types defined in the same addon - then everyone who has the unit has it with same advancements.  This tag makes changes to the ''advances_to'' and ''experience'' keys of a base unit to make it advance into this unit.  It takes these keys:&lt;br /&gt;
** ''unit'': the id of the base unit from which this unit advances.  This adds the unit into the list of units which ''unit'' can advance into.&lt;br /&gt;
** ''experience'': (optional) If present the experience needed to advance is set to this value. If there are more than one [advancefrom] tags referencing the same base unit within the same preprocessor scope (e.g. a campaign #ifdef) with experience= keys, the lowest value of these is chosen.  Note: this will also lower the experience required to advance to other units which the base unit can advance into.&lt;br /&gt;
: If the previous unit type makes use of '''[male]''' and/or '''[female]''' tags, then the current (new) unit type is expected to also. That is, the subtypes defined by those tags will only receive this advancement if the new type has a corresponding tag.&lt;br /&gt;
{{DevFeature1.15|4}} '''[advancefrom]''' was effectively removed in 1.15.4. The intention was to deprecate it, but  the compatibility code that was meant to support it in 1.16 was untested and nonfunctional.&lt;br /&gt;
&lt;br /&gt;
== Deprecating units ==&lt;br /&gt;
&lt;br /&gt;
A macro is provided for deprecating a unit, which uses the built-in deprecation system but hard-codes the level to 3 (meaning &amp;quot;for removal&amp;quot;). The syntax is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=wml&amp;gt;{DEPRECATED_UNIT old_id new_id version}&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can also set the new_id to an empty string if there is no replacement.&lt;br /&gt;
&lt;br /&gt;
== See Also ==&lt;br /&gt;
&lt;br /&gt;
* [[AnimationWML]]&lt;br /&gt;
* [[ReferenceWML]]&lt;br /&gt;
* [[TerrainWML]]&lt;br /&gt;
&lt;br /&gt;
[[Category: WML Reference]]&lt;/div&gt;</summary>
		<author><name>Soliton</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.wesnoth.org/index.php?title=UsefulLinks&amp;diff=74484</id>
		<title>UsefulLinks</title>
		<link rel="alternate" type="text/html" href="https://wiki.wesnoth.org/index.php?title=UsefulLinks&amp;diff=74484"/>
		<updated>2025-08-07T09:21:00Z</updated>

		<summary type="html">&lt;p&gt;Soliton: /* Developers */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
!colspan=2 style='text-align:left'|&lt;br /&gt;
=== Battle for Wesnoth ===&lt;br /&gt;
|-&lt;br /&gt;
|Home Page || https://www.wesnoth.org/&lt;br /&gt;
|-&lt;br /&gt;
|GitHub Project Page || https://github.com/wesnoth/&lt;br /&gt;
|-&lt;br /&gt;
|SPI project page || https://www.spi-inc.org/projects/wesnoth/&lt;br /&gt;
|-&lt;br /&gt;
|Changelog || https://changelog.wesnoth.org/ [http://stable-changelog.wesnoth.org stable]&lt;br /&gt;
|-&lt;br /&gt;
|This wiki || [[StartingPoints|https://wiki.wesnoth.org/]]&lt;br /&gt;
|-&lt;br /&gt;
|The manual || https://manual.wesnoth.org/&lt;br /&gt;
|-&lt;br /&gt;
|Translation statistics || https://gettext.wesnoth.org/&lt;br /&gt;
|-&lt;br /&gt;
|Add-on server web interface || https://addons.wesnoth.org/ [http://stable-addons.wesnoth.org stable] [http://dev-addons.wesnoth.org dev]&lt;br /&gt;
|-&lt;br /&gt;
|Code and Content Copyright || https://wiki.wesnoth.org/Wesnoth:Copyrights&lt;br /&gt;
|-&lt;br /&gt;
|Multiplayer server statistics || https://wesnothd.wesnoth.org/&lt;br /&gt;
|-&lt;br /&gt;
|Multiplayer statistics || https://replays.wesnoth.org/dashboard/&lt;br /&gt;
|-&lt;br /&gt;
|Multiplayer replays || https://replays.wesnoth.org&lt;br /&gt;
|-&lt;br /&gt;
|Unit advancement tree || https://units.wesnoth.org/&lt;br /&gt;
|-&lt;br /&gt;
|SteamDB || https://steamdb.info/app/599390/&lt;br /&gt;
|-&lt;br /&gt;
|Forum for users and developers || https://forums.wesnoth.org/ [https://forums.wesnoth.org/search.php?search_id=newposts new posts]&lt;br /&gt;
|-&lt;br /&gt;
|List of Frequently Proposed Ideas || https://forums.wesnoth.org/viewtopic.php?f=12&amp;amp;t=34904&lt;br /&gt;
|-&lt;br /&gt;
|IRC channel (Libera.Chat) || ircs://irc.libera.chat/#wesnoth&lt;br /&gt;
|-&lt;br /&gt;
|Discord server || https://discord.gg/battleforwesnoth&lt;br /&gt;
|-&lt;br /&gt;
|IRC logs || https://wesnoth.org/irclogs/&lt;br /&gt;
|-&lt;br /&gt;
|Mastodon Account || https://fosstodon.org/@wesnoth&lt;br /&gt;
|-&lt;br /&gt;
|Project statistics || https://openhub.net/p/wesnoth&lt;br /&gt;
|-&lt;br /&gt;
!colspan=2 style='text-align:left'|&lt;br /&gt;
&lt;br /&gt;
=== Developers ===&lt;br /&gt;
|-&lt;br /&gt;
|Git web interface || https://github.com/wesnoth/wesnoth ([https://git-scm.com/ git] [https://git-scm.com/documentation doc])&lt;br /&gt;
|-&lt;br /&gt;
|Jenkins CI || https://jenkins.wesnoth.org:8443/&lt;br /&gt;
|-&lt;br /&gt;
| Github CI || https://github.com/wesnoth/wesnoth/actions&lt;br /&gt;
|-&lt;br /&gt;
|Code documentation || https://devdocs.wesnoth.org/&lt;br /&gt;
|-&lt;br /&gt;
|GUI(2) documentation || https://wiki.wesnoth.org/GUIToolkit&lt;br /&gt;
|-&lt;br /&gt;
|Lua documentation || https://wiki.wesnoth.org/LuaAPI&lt;br /&gt;
|-&lt;br /&gt;
|WML documentation || https://wiki.wesnoth.org/WML&lt;br /&gt;
|-&lt;br /&gt;
|WFL documentation || https://wiki.wesnoth.org/WFL&lt;br /&gt;
|-&lt;br /&gt;
|Mailing lists || [https://groups.io/g/wesnoth-packagers wesnoth-packagers] - [https://groups.io/g/wesnoth-translations wesnoth-translations] ([https://listengine.tuxfamily.org/wesnoth.org/ old] - [https://mailman.wesnoth.org/ oldold])&lt;br /&gt;
|-&lt;br /&gt;
|Bug/Feature tracker || https://bugs.wesnoth.org/&lt;br /&gt;
|-&lt;br /&gt;
|Patch tracker || https://patches.wesnoth.org/&lt;br /&gt;
|-&lt;br /&gt;
|wesnoth.org server stats || https://collectd.wesnoth.org&lt;br /&gt;
|-&lt;br /&gt;
|IRC channel (Libera.Chat) || ircs://irc.libera.chat/wesnoth-dev&lt;br /&gt;
|-&lt;br /&gt;
!colspan=2 style='text-align:left'|&lt;br /&gt;
&lt;br /&gt;
=== Other Links ===&lt;br /&gt;
|-&lt;br /&gt;
|1vs1 Wesnoth ladder || https://wesnoth.gamingladder.info/&lt;br /&gt;
|-&lt;br /&gt;
|Wesnoth matches with commentary || http://www.youtube.com/user/NekisBrutalWesnoth&lt;br /&gt;
|-&lt;br /&gt;
|Wesnoth campaign with commentary in german || https://www.youtube.com/playlist?list=PLc3DmuDuA2imW1vg9xXMNjGHm8VaXvEaz&lt;br /&gt;
|-&lt;br /&gt;
|WSNPP || [[WSNPP|http://wiki.wesnoth.org/WSNPP]]&lt;br /&gt;
|-&lt;br /&gt;
|Run Wesnoth online (Windows) || http://spoon.net/the-battle-for-wesnoth&lt;br /&gt;
|-&lt;br /&gt;
!colspan=2 style='text-align:left'|&lt;br /&gt;
=== Multilingual Players' Sites ===&lt;br /&gt;
|-&lt;br /&gt;
|Community in China || http://wesnoth.cn/&lt;br /&gt;
|-&lt;br /&gt;
|Polish Community || https://www.wesnoth.com.pl/forum/index.php&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
[[Category:Wesnoth Wiki]]&lt;/div&gt;</summary>
		<author><name>Soliton</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.wesnoth.org/index.php?title=UsefulLinks&amp;diff=74482</id>
		<title>UsefulLinks</title>
		<link rel="alternate" type="text/html" href="https://wiki.wesnoth.org/index.php?title=UsefulLinks&amp;diff=74482"/>
		<updated>2025-08-07T09:09:32Z</updated>

		<summary type="html">&lt;p&gt;Soliton: /* Developers */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
!colspan=2 style='text-align:left'|&lt;br /&gt;
=== Battle for Wesnoth ===&lt;br /&gt;
|-&lt;br /&gt;
|Home Page || https://www.wesnoth.org/&lt;br /&gt;
|-&lt;br /&gt;
|GitHub Project Page || https://github.com/wesnoth/&lt;br /&gt;
|-&lt;br /&gt;
|SPI project page || https://www.spi-inc.org/projects/wesnoth/&lt;br /&gt;
|-&lt;br /&gt;
|Changelog || https://changelog.wesnoth.org/ [http://stable-changelog.wesnoth.org stable]&lt;br /&gt;
|-&lt;br /&gt;
|This wiki || [[StartingPoints|https://wiki.wesnoth.org/]]&lt;br /&gt;
|-&lt;br /&gt;
|The manual || https://manual.wesnoth.org/&lt;br /&gt;
|-&lt;br /&gt;
|Translation statistics || https://gettext.wesnoth.org/&lt;br /&gt;
|-&lt;br /&gt;
|Add-on server web interface || https://addons.wesnoth.org/ [http://stable-addons.wesnoth.org stable] [http://dev-addons.wesnoth.org dev]&lt;br /&gt;
|-&lt;br /&gt;
|Code and Content Copyright || https://wiki.wesnoth.org/Wesnoth:Copyrights&lt;br /&gt;
|-&lt;br /&gt;
|Multiplayer server statistics || https://wesnothd.wesnoth.org/&lt;br /&gt;
|-&lt;br /&gt;
|Multiplayer statistics || https://replays.wesnoth.org/dashboard/&lt;br /&gt;
|-&lt;br /&gt;
|Multiplayer replays || https://replays.wesnoth.org&lt;br /&gt;
|-&lt;br /&gt;
|Unit advancement tree || https://units.wesnoth.org/&lt;br /&gt;
|-&lt;br /&gt;
|SteamDB || https://steamdb.info/app/599390/&lt;br /&gt;
|-&lt;br /&gt;
|Forum for users and developers || https://forums.wesnoth.org/ [https://forums.wesnoth.org/search.php?search_id=newposts new posts]&lt;br /&gt;
|-&lt;br /&gt;
|List of Frequently Proposed Ideas || https://forums.wesnoth.org/viewtopic.php?f=12&amp;amp;t=34904&lt;br /&gt;
|-&lt;br /&gt;
|IRC channel (Libera.Chat) || ircs://irc.libera.chat/#wesnoth&lt;br /&gt;
|-&lt;br /&gt;
|Discord server || https://discord.gg/battleforwesnoth&lt;br /&gt;
|-&lt;br /&gt;
|IRC logs || https://wesnoth.org/irclogs/&lt;br /&gt;
|-&lt;br /&gt;
|Mastodon Account || https://fosstodon.org/@wesnoth&lt;br /&gt;
|-&lt;br /&gt;
|Project statistics || https://openhub.net/p/wesnoth&lt;br /&gt;
|-&lt;br /&gt;
!colspan=2 style='text-align:left'|&lt;br /&gt;
&lt;br /&gt;
=== Developers ===&lt;br /&gt;
|-&lt;br /&gt;
|Git web interface || https://github.com/wesnoth/wesnoth ([https://git-scm.com/ git] [https://git-scm.com/documentation doc])&lt;br /&gt;
|-&lt;br /&gt;
|Jenkins CI || https://jenkins.wesnoth.org:8443/&lt;br /&gt;
|-&lt;br /&gt;
|Code documentation || https://devdocs.wesnoth.org/&lt;br /&gt;
|-&lt;br /&gt;
|GUI(2) documentation || https://wiki.wesnoth.org/GUIToolkit&lt;br /&gt;
|-&lt;br /&gt;
|Lua documentation || https://wiki.wesnoth.org/LuaAPI&lt;br /&gt;
|-&lt;br /&gt;
|WML documentation || https://wiki.wesnoth.org/WML&lt;br /&gt;
|-&lt;br /&gt;
|WFL documentation || https://wiki.wesnoth.org/WFL&lt;br /&gt;
|-&lt;br /&gt;
|Mailing lists || [https://groups.io/g/wesnoth-packagers wesnoth-packagers] - [https://groups.io/g/wesnoth-translations wesnoth-translations] ([https://listengine.tuxfamily.org/wesnoth.org/ old] - [https://mailman.wesnoth.org/ oldold])&lt;br /&gt;
|-&lt;br /&gt;
|Bug/Feature tracker || https://bugs.wesnoth.org/&lt;br /&gt;
|-&lt;br /&gt;
|Patch tracker || https://patches.wesnoth.org/&lt;br /&gt;
|-&lt;br /&gt;
|wesnoth.org server stats || https://collectd.wesnoth.org&lt;br /&gt;
|-&lt;br /&gt;
|IRC channel (Libera.Chat) || ircs://irc.libera.chat/wesnoth-dev&lt;br /&gt;
|-&lt;br /&gt;
!colspan=2 style='text-align:left'|&lt;br /&gt;
&lt;br /&gt;
=== Other Links ===&lt;br /&gt;
|-&lt;br /&gt;
|1vs1 Wesnoth ladder || https://wesnoth.gamingladder.info/&lt;br /&gt;
|-&lt;br /&gt;
|Wesnoth matches with commentary || http://www.youtube.com/user/NekisBrutalWesnoth&lt;br /&gt;
|-&lt;br /&gt;
|Wesnoth campaign with commentary in german || https://www.youtube.com/playlist?list=PLc3DmuDuA2imW1vg9xXMNjGHm8VaXvEaz&lt;br /&gt;
|-&lt;br /&gt;
|WSNPP || [[WSNPP|http://wiki.wesnoth.org/WSNPP]]&lt;br /&gt;
|-&lt;br /&gt;
|Run Wesnoth online (Windows) || http://spoon.net/the-battle-for-wesnoth&lt;br /&gt;
|-&lt;br /&gt;
!colspan=2 style='text-align:left'|&lt;br /&gt;
=== Multilingual Players' Sites ===&lt;br /&gt;
|-&lt;br /&gt;
|Community in China || http://wesnoth.cn/&lt;br /&gt;
|-&lt;br /&gt;
|Polish Community || https://www.wesnoth.com.pl/forum/index.php&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
[[Category:Wesnoth Wiki]]&lt;/div&gt;</summary>
		<author><name>Soliton</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.wesnoth.org/index.php?title=UsefulLinks&amp;diff=74481</id>
		<title>UsefulLinks</title>
		<link rel="alternate" type="text/html" href="https://wiki.wesnoth.org/index.php?title=UsefulLinks&amp;diff=74481"/>
		<updated>2025-08-07T09:08:36Z</updated>

		<summary type="html">&lt;p&gt;Soliton: /* Developers */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
!colspan=2 style='text-align:left'|&lt;br /&gt;
=== Battle for Wesnoth ===&lt;br /&gt;
|-&lt;br /&gt;
|Home Page || https://www.wesnoth.org/&lt;br /&gt;
|-&lt;br /&gt;
|GitHub Project Page || https://github.com/wesnoth/&lt;br /&gt;
|-&lt;br /&gt;
|SPI project page || https://www.spi-inc.org/projects/wesnoth/&lt;br /&gt;
|-&lt;br /&gt;
|Changelog || https://changelog.wesnoth.org/ [http://stable-changelog.wesnoth.org stable]&lt;br /&gt;
|-&lt;br /&gt;
|This wiki || [[StartingPoints|https://wiki.wesnoth.org/]]&lt;br /&gt;
|-&lt;br /&gt;
|The manual || https://manual.wesnoth.org/&lt;br /&gt;
|-&lt;br /&gt;
|Translation statistics || https://gettext.wesnoth.org/&lt;br /&gt;
|-&lt;br /&gt;
|Add-on server web interface || https://addons.wesnoth.org/ [http://stable-addons.wesnoth.org stable] [http://dev-addons.wesnoth.org dev]&lt;br /&gt;
|-&lt;br /&gt;
|Code and Content Copyright || https://wiki.wesnoth.org/Wesnoth:Copyrights&lt;br /&gt;
|-&lt;br /&gt;
|Multiplayer server statistics || https://wesnothd.wesnoth.org/&lt;br /&gt;
|-&lt;br /&gt;
|Multiplayer statistics || https://replays.wesnoth.org/dashboard/&lt;br /&gt;
|-&lt;br /&gt;
|Multiplayer replays || https://replays.wesnoth.org&lt;br /&gt;
|-&lt;br /&gt;
|Unit advancement tree || https://units.wesnoth.org/&lt;br /&gt;
|-&lt;br /&gt;
|SteamDB || https://steamdb.info/app/599390/&lt;br /&gt;
|-&lt;br /&gt;
|Forum for users and developers || https://forums.wesnoth.org/ [https://forums.wesnoth.org/search.php?search_id=newposts new posts]&lt;br /&gt;
|-&lt;br /&gt;
|List of Frequently Proposed Ideas || https://forums.wesnoth.org/viewtopic.php?f=12&amp;amp;t=34904&lt;br /&gt;
|-&lt;br /&gt;
|IRC channel (Libera.Chat) || ircs://irc.libera.chat/#wesnoth&lt;br /&gt;
|-&lt;br /&gt;
|Discord server || https://discord.gg/battleforwesnoth&lt;br /&gt;
|-&lt;br /&gt;
|IRC logs || https://wesnoth.org/irclogs/&lt;br /&gt;
|-&lt;br /&gt;
|Mastodon Account || https://fosstodon.org/@wesnoth&lt;br /&gt;
|-&lt;br /&gt;
|Project statistics || https://openhub.net/p/wesnoth&lt;br /&gt;
|-&lt;br /&gt;
!colspan=2 style='text-align:left'|&lt;br /&gt;
&lt;br /&gt;
=== Developers ===&lt;br /&gt;
|-&lt;br /&gt;
|Git web interface || https://github.com/wesnoth/wesnoth ([https://git-scm.com/ git] [https://git-scm.com/documentation doc])&lt;br /&gt;
|-&lt;br /&gt;
|Code documentation || https://devdocs.wesnoth.org/&lt;br /&gt;
|-&lt;br /&gt;
|GUI(2) documentation || https://wiki.wesnoth.org/GUIToolkit&lt;br /&gt;
|-&lt;br /&gt;
|Lua documentation || https://wiki.wesnoth.org/LuaAPI&lt;br /&gt;
|-&lt;br /&gt;
|WML documentation || https://wiki.wesnoth.org/WML&lt;br /&gt;
|-&lt;br /&gt;
|WFL documentation || https://wiki.wesnoth.org/WFL&lt;br /&gt;
|-&lt;br /&gt;
|Mailing lists || [https://groups.io/g/wesnoth-packagers wesnoth-packagers] - [https://groups.io/g/wesnoth-translations wesnoth-translations] ([https://listengine.tuxfamily.org/wesnoth.org/ old] - [https://mailman.wesnoth.org/ oldold])&lt;br /&gt;
|-&lt;br /&gt;
|Bug/Feature tracker || https://bugs.wesnoth.org/&lt;br /&gt;
|-&lt;br /&gt;
|Patch tracker || https://patches.wesnoth.org/&lt;br /&gt;
|-&lt;br /&gt;
|wesnoth.org server stats || https://collectd.wesnoth.org&lt;br /&gt;
|-&lt;br /&gt;
|IRC channel (Libera.Chat) || ircs://irc.libera.chat/wesnoth-dev&lt;br /&gt;
|-&lt;br /&gt;
!colspan=2 style='text-align:left'|&lt;br /&gt;
&lt;br /&gt;
=== Other Links ===&lt;br /&gt;
|-&lt;br /&gt;
|1vs1 Wesnoth ladder || https://wesnoth.gamingladder.info/&lt;br /&gt;
|-&lt;br /&gt;
|Wesnoth matches with commentary || http://www.youtube.com/user/NekisBrutalWesnoth&lt;br /&gt;
|-&lt;br /&gt;
|Wesnoth campaign with commentary in german || https://www.youtube.com/playlist?list=PLc3DmuDuA2imW1vg9xXMNjGHm8VaXvEaz&lt;br /&gt;
|-&lt;br /&gt;
|WSNPP || [[WSNPP|http://wiki.wesnoth.org/WSNPP]]&lt;br /&gt;
|-&lt;br /&gt;
|Run Wesnoth online (Windows) || http://spoon.net/the-battle-for-wesnoth&lt;br /&gt;
|-&lt;br /&gt;
!colspan=2 style='text-align:left'|&lt;br /&gt;
=== Multilingual Players' Sites ===&lt;br /&gt;
|-&lt;br /&gt;
|Community in China || http://wesnoth.cn/&lt;br /&gt;
|-&lt;br /&gt;
|Polish Community || https://www.wesnoth.com.pl/forum/index.php&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
[[Category:Wesnoth Wiki]]&lt;/div&gt;</summary>
		<author><name>Soliton</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.wesnoth.org/index.php?title=UsefulLinks&amp;diff=74480</id>
		<title>UsefulLinks</title>
		<link rel="alternate" type="text/html" href="https://wiki.wesnoth.org/index.php?title=UsefulLinks&amp;diff=74480"/>
		<updated>2025-08-07T09:07:28Z</updated>

		<summary type="html">&lt;p&gt;Soliton: /* Developers */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
!colspan=2 style='text-align:left'|&lt;br /&gt;
=== Battle for Wesnoth ===&lt;br /&gt;
|-&lt;br /&gt;
|Home Page || https://www.wesnoth.org/&lt;br /&gt;
|-&lt;br /&gt;
|GitHub Project Page || https://github.com/wesnoth/&lt;br /&gt;
|-&lt;br /&gt;
|SPI project page || https://www.spi-inc.org/projects/wesnoth/&lt;br /&gt;
|-&lt;br /&gt;
|Changelog || https://changelog.wesnoth.org/ [http://stable-changelog.wesnoth.org stable]&lt;br /&gt;
|-&lt;br /&gt;
|This wiki || [[StartingPoints|https://wiki.wesnoth.org/]]&lt;br /&gt;
|-&lt;br /&gt;
|The manual || https://manual.wesnoth.org/&lt;br /&gt;
|-&lt;br /&gt;
|Translation statistics || https://gettext.wesnoth.org/&lt;br /&gt;
|-&lt;br /&gt;
|Add-on server web interface || https://addons.wesnoth.org/ [http://stable-addons.wesnoth.org stable] [http://dev-addons.wesnoth.org dev]&lt;br /&gt;
|-&lt;br /&gt;
|Code and Content Copyright || https://wiki.wesnoth.org/Wesnoth:Copyrights&lt;br /&gt;
|-&lt;br /&gt;
|Multiplayer server statistics || https://wesnothd.wesnoth.org/&lt;br /&gt;
|-&lt;br /&gt;
|Multiplayer statistics || https://replays.wesnoth.org/dashboard/&lt;br /&gt;
|-&lt;br /&gt;
|Multiplayer replays || https://replays.wesnoth.org&lt;br /&gt;
|-&lt;br /&gt;
|Unit advancement tree || https://units.wesnoth.org/&lt;br /&gt;
|-&lt;br /&gt;
|SteamDB || https://steamdb.info/app/599390/&lt;br /&gt;
|-&lt;br /&gt;
|Forum for users and developers || https://forums.wesnoth.org/ [https://forums.wesnoth.org/search.php?search_id=newposts new posts]&lt;br /&gt;
|-&lt;br /&gt;
|List of Frequently Proposed Ideas || https://forums.wesnoth.org/viewtopic.php?f=12&amp;amp;t=34904&lt;br /&gt;
|-&lt;br /&gt;
|IRC channel (Libera.Chat) || ircs://irc.libera.chat/#wesnoth&lt;br /&gt;
|-&lt;br /&gt;
|Discord server || https://discord.gg/battleforwesnoth&lt;br /&gt;
|-&lt;br /&gt;
|IRC logs || https://wesnoth.org/irclogs/&lt;br /&gt;
|-&lt;br /&gt;
|Mastodon Account || https://fosstodon.org/@wesnoth&lt;br /&gt;
|-&lt;br /&gt;
|Project statistics || https://openhub.net/p/wesnoth&lt;br /&gt;
|-&lt;br /&gt;
!colspan=2 style='text-align:left'|&lt;br /&gt;
&lt;br /&gt;
=== Developers ===&lt;br /&gt;
|-|Git web interface || https://github.com/wesnoth/wesnoth ([https://git-scm.com/ git] [https://git-scm.com/documentation doc])&lt;br /&gt;
|-&lt;br /&gt;
|Code documentation || https://devdocs.wesnoth.org/&lt;br /&gt;
|-&lt;br /&gt;
|GUI(2) documentation || https://wiki.wesnoth.org/GUIToolkit&lt;br /&gt;
|-&lt;br /&gt;
|Lua documentation || https://wiki.wesnoth.org/LuaAPI&lt;br /&gt;
|-&lt;br /&gt;
|WML documentation || https://wiki.wesnoth.org/WML&lt;br /&gt;
|-&lt;br /&gt;
|WFL documentation || https://wiki.wesnoth.org/WFL&lt;br /&gt;
|-&lt;br /&gt;
|Mailing lists || [https://groups.io/g/wesnoth-packagers wesnoth-packagers] - [https://groups.io/g/wesnoth-translations wesnoth-translations] ([https://listengine.tuxfamily.org/wesnoth.org/ old] - [https://mailman.wesnoth.org/ oldold])&lt;br /&gt;
|-&lt;br /&gt;
|Bug/Feature tracker || https://bugs.wesnoth.org/&lt;br /&gt;
|-&lt;br /&gt;
|Patch tracker || https://patches.wesnoth.org/&lt;br /&gt;
|-&lt;br /&gt;
|wesnoth.org server stats || https://collectd.wesnoth.org&lt;br /&gt;
|-&lt;br /&gt;
|IRC channel (Libera.Chat) || ircs://irc.libera.chat/wesnoth-dev&lt;br /&gt;
|-&lt;br /&gt;
!colspan=2 style='text-align:left'|&lt;br /&gt;
&lt;br /&gt;
=== Other Links ===&lt;br /&gt;
|-&lt;br /&gt;
|1vs1 Wesnoth ladder || https://wesnoth.gamingladder.info/&lt;br /&gt;
|-&lt;br /&gt;
|Wesnoth matches with commentary || http://www.youtube.com/user/NekisBrutalWesnoth&lt;br /&gt;
|-&lt;br /&gt;
|Wesnoth campaign with commentary in german || https://www.youtube.com/playlist?list=PLc3DmuDuA2imW1vg9xXMNjGHm8VaXvEaz&lt;br /&gt;
|-&lt;br /&gt;
|WSNPP || [[WSNPP|http://wiki.wesnoth.org/WSNPP]]&lt;br /&gt;
|-&lt;br /&gt;
|Run Wesnoth online (Windows) || http://spoon.net/the-battle-for-wesnoth&lt;br /&gt;
|-&lt;br /&gt;
!colspan=2 style='text-align:left'|&lt;br /&gt;
=== Multilingual Players' Sites ===&lt;br /&gt;
|-&lt;br /&gt;
|Community in China || http://wesnoth.cn/&lt;br /&gt;
|-&lt;br /&gt;
|Polish Community || https://www.wesnoth.com.pl/forum/index.php&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
[[Category:Wesnoth Wiki]]&lt;/div&gt;</summary>
		<author><name>Soliton</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.wesnoth.org/index.php?title=DebugMode&amp;diff=74461</id>
		<title>DebugMode</title>
		<link rel="alternate" type="text/html" href="https://wiki.wesnoth.org/index.php?title=DebugMode&amp;diff=74461"/>
		<updated>2025-07-30T16:19:42Z</updated>

		<summary type="html">&lt;p&gt;Soliton: /* Debug Mode */ debug mode is not disabled in network games since a while&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Debug Mode ==&lt;br /&gt;
&lt;br /&gt;
Running the game with commandline option ''--debug'' or ''-d''&lt;br /&gt;
enables '''debug mode''' within the game.&lt;br /&gt;
&lt;br /&gt;
Debug mode displays additional information.  It also enables&lt;br /&gt;
context menu options to create units anywhere on the map, changing unit sides, and some additional [[CommandMode]] commands.  If you create units in debug mode, you can then use the :unit command to set the unit's attributes (see [[CommandMode]]).&lt;br /&gt;
&lt;br /&gt;
Debug mode can also be enabled within the game using :debug (see [[CommandMode]]), and on Mac versions of the game, by holding down the Option key when starting Wesnoth.&lt;br /&gt;
&lt;br /&gt;
== Building the game with extra debugging ==&lt;br /&gt;
&lt;br /&gt;
The game can be built to support debugging, enabling a few code snippets for the benefit of external debuggers like ''gdb'', and disabling compiler optimizations.&lt;br /&gt;
&lt;br /&gt;
It is a good idea to run a debug build of the game if you do development, since it can be necessary to diagnose serious problems.&lt;br /&gt;
&lt;br /&gt;
'''scons:'''&lt;br /&gt;
&lt;br /&gt;
 scons build=debug [...]&lt;br /&gt;
&lt;br /&gt;
'''cmake:'''&lt;br /&gt;
&lt;br /&gt;
 cmake -DCMAKE_BUILD_TYPE=Debug [...] &amp;lt;path to top source dir&amp;gt;&lt;br /&gt;
 make&lt;br /&gt;
&lt;br /&gt;
An unstripped debug build on linux is over 400 MB, compared to around 16 MB stripped. You probably don't want to strip a debugging build, though, since the extra symbols are required by debug tools.&lt;br /&gt;
&lt;br /&gt;
== See Also ==&lt;br /&gt;
&lt;br /&gt;
* [[CommandMode]]&lt;br /&gt;
* [[DebuggingWesnoth]]&lt;br /&gt;
* [[DeveloperResources]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Building and Installing]]&lt;br /&gt;
[[Category:Development]]&lt;/div&gt;</summary>
		<author><name>Soliton</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.wesnoth.org/index.php?title=AbilitiesWML&amp;diff=74460</id>
		<title>AbilitiesWML</title>
		<link rel="alternate" type="text/html" href="https://wiki.wesnoth.org/index.php?title=AbilitiesWML&amp;diff=74460"/>
		<updated>2025-07-29T15:53:47Z</updated>

		<summary type="html">&lt;p&gt;Soliton: /* The [specials] tag */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{WML Tags}}&lt;br /&gt;
==  Abilities and their effects ==&lt;br /&gt;
&lt;br /&gt;
There are two types of abilities: ones that apply to units (called ''abilities'') and ones that only apply when using a particular attack (called ''specials'' or ''weapon specials'').  A unit may have multiple abilities and an attack can have multiple specials.&lt;br /&gt;
&lt;br /&gt;
Each ability or special defines an effect based on one to three units. Most abilities apply to a single unit, and '''[filter_self]''' can be used to determine when the ability is active. Weapon specials apply to two units, which can be filtered either as &amp;quot;attacker&amp;quot; and &amp;quot;defender&amp;quot; (with the obvious meaning) or as &amp;quot;self&amp;quot; and &amp;quot;other&amp;quot; – the unit that possesses the special, and that unit's opponent. When filtering on the &amp;quot;other&amp;quot; unit, you use '''[filter_opponent]'''.&lt;br /&gt;
&lt;br /&gt;
Leadership-style abilities are a more complex case, as they involve three units. Like a weapon special, there is an attacker and defender, but there is also a third unit that could be referred to as the &amp;quot;teacher&amp;quot;. The &amp;quot;teacher&amp;quot; is the unit that possesses the ability, so it is referred to as &amp;quot;self&amp;quot; in the ability. A leadership ability works by temporarily granting a weapon special to either the attacker or the defender. The unit that benefits from this is referred to as the &amp;quot;student&amp;quot;, while the unit that does not benefit is simply the &amp;quot;other&amp;quot; unit. When filtering on the &amp;quot;other&amp;quot; unit, you use '''[filter_opponent]''', while the student can be filtered with '''[filter_student]'''.&lt;br /&gt;
&lt;br /&gt;
== The ''[abilities]'' tag ==&lt;br /&gt;
&lt;br /&gt;
The following tags are used to describe an ability in WML:&lt;br /&gt;
&lt;br /&gt;
* '''[heals]''': modifies the hitpoints of a unit at the beginning of the healer's turn&lt;br /&gt;
* '''[regenerate]''': modifies the hitpoints of a unit at the beginning of the unit's turn&lt;br /&gt;
* '''[resistance]''': modifies the resistance of a unit to damage&lt;br /&gt;
* '''[leadership]''': modifies the damage of a unit&lt;br /&gt;
* '''[skirmisher]''': negates enemy zones of control&lt;br /&gt;
* '''[illuminates]''': modifies the time of day adjacent to the affected units&lt;br /&gt;
* '''[teleport]''': allows the unit to teleport&lt;br /&gt;
* '''[hides]''': renders the unit invisible to enemies&lt;br /&gt;
* {{DevFeature1.15|0}} All [[#The_.5Bspecials.5D_tag|weapon specials]] except for '''[plague]''', '''[heal_on_hit]''', and '''[swarm]''' can be placed in the '''[abilities]''' tag. These [[#Extra_tags_and_keys_used_by_weapon_specials_as_abilities|&amp;quot;weapon specials as abilities&amp;quot;]] will give the weapon special to all attacks the unit has.&lt;br /&gt;
* Any other tag is valid (for example '''[dummy]'''), but will result in an ability that does nothing but report it's there. '''Note:''' a dummy ability must have an id for the name and description to display.&lt;br /&gt;
* {{DevFeature1.15|3}} All the engine [[#The_.5Bspecials.5D_tag|weapon specials]] can be placed in the [abilities] tag now.&lt;br /&gt;
&lt;br /&gt;
=== Available formula variables in Abilities and Weapon Specials  ===&lt;br /&gt;
&lt;br /&gt;
{{DevFeature1.15|?}} When using formulas in abilities and weapon specials, the following formula variables are available:&lt;br /&gt;
* '''self''': (unit) the unit that has the ability&lt;br /&gt;
* '''student''': (unit) for leadership-like abilities this is the unit that is adjacent to the unit that has the ability; if affect_self=yes, this is also unit who has ability.&lt;br /&gt;
* '''attacker''': (unit) for attack-related abilities and weapon specials, this is the attacking unit during the attack.&lt;br /&gt;
* '''defender''': (unit) for attack-related abilities and weapon specials, this is the defending unit during the attack.&lt;br /&gt;
* '''other''': (unit) the unit whose stats get modified from the ability. For abilities without 'apply_to=opponent' this is always the same as 'student'.&lt;br /&gt;
&lt;br /&gt;
=== Common keys and tags for every ability ===&lt;br /&gt;
&lt;br /&gt;
{{DevFeature1.13|?}} All keys inside any ability that expects a numeric value will also accept formulas using &lt;br /&gt;
[[Wesnoth Formula Language]]. In order to use a formula in these keys, you must enclose it in parentheses. However, do '''not''' precede those parentheses with a dollar sign like &amp;lt;code&amp;gt;$(...)&amp;lt;/code&amp;gt;, since that will erase the &amp;lt;tt&amp;gt;self&amp;lt;/tt&amp;gt; variable.&lt;br /&gt;
&lt;br /&gt;
* '''name''': the (translatable) name of the ability. If omitted, the ability will be a hidden ability.&lt;br /&gt;
* '''female_name''': the (translatable) name of the ability when possessed by a female unit. Defaults to ''name'' if not specified.&lt;br /&gt;
* '''name_inactive''': the (translatable) name of the ability when inactive. Defaults to ''name'' if not specified; if the ability is supposed to be not displayed when inactive, you must explicitly set ''name_inactive'' to an empty string (nothing after the equals sign).&lt;br /&gt;
* '''female_name_inactive''': the (translatable) name of the ability when inactive and possessed by a female unit. Defaults to ''name_inactive'' if not specified. You should thus set ''female_name'' as well!&lt;br /&gt;
* '''description''': the (translatable) description of the ability.&lt;br /&gt;
* '''description_inactive''': the (translatable) description of the ability when inactive. Defaults to ''description'' if not specified.&lt;br /&gt;
* '''special_note''' {{DevFeature1.15|14}} Translatable string, which will be displayed in the unit’s help. See also [[UnitTypeWML#Special_Notes]].&lt;br /&gt;
* '''affect_self''': if equal to 'yes' (default), the ability will affect the unit that has it.&lt;br /&gt;
* '''affect_allies''': if equal to 'yes', the ability will affect units from the same and allied sides in the specified adjacent hexes. If set to 'no' it will not affect own or allied sides. If not set (default) it will affect units on the same side but not from allied sides.&lt;br /&gt;
* '''affect_enemies''': if equal to 'yes' (default is 'no'), the ability will affect enemies in the specified adjacent hexes.&lt;br /&gt;
* '''cumulative''': if set to 'yes', this ability will be cumulative with the base value for this ability. ''Beware of the bug with cumulative leadership in 1.16 https://github.com/wesnoth/wesnoth/issues/6466 , more info see below, in &amp;quot;Extra keys used by the ''leadership'' ability&amp;quot; section''. {{DevFeature1.17|5}}, bug fixed.&lt;br /&gt;
* '''id''': this ability will not be cumulative with other abilities using this id. Must be present if cumulative is anything other than 'yes'.&lt;br /&gt;
* '''halo_image''': {{DevFeature1.17|22}} if used, the halo specified showed on unit affected by ability.&lt;br /&gt;
* '''overlay_image''': {{DevFeature1.17|22}} if used, the overlay specified showed on unit affected by ability.&lt;br /&gt;
* '''halo_image_self''': {{DevFeature1.17|22}} if used, the halo specified showed on unit who has ability when active.&lt;br /&gt;
* '''overlay_image_self''': {{DevFeature1.17|22}} if used, the overlay specified showed on unit who has ability when active.&lt;br /&gt;
* '''[filter]''': [[StandardUnitFilter]] If the unit owning the ability does not match this filter, the ability will be inactive.&lt;br /&gt;
* {{anchor|affect_adjacent|'''[affect_adjacent]'''}}: an adjacent unit that does not match this filter will not receive its effects. There can be multiple [affect_adjacent] tags in a single ability; a unit needs to match any one of these to receive the effects. The side requirement of matching units is defined by the '''affect_allies''' and '''affect_enemies''' keys. If there are no [affect_adjacent] tags, then no adjacent units will receive the effects.&lt;br /&gt;
** '''adjacent''': a comma separated list of any combination of these directions: '''n''','''ne''','''se''','''s''','''sw''','''nw'''. (See [[StandardLocationFilter#Directions|notes]])&lt;br /&gt;
** '''[filter]''': a [[StandardUnitFilter]]. {{DevFeature1.13|2}} The variable $other_unit refers to the unit owning the ability.&lt;br /&gt;
** '''radius''': {{DevFeature1.19|13}} set to 1 by default, it determines the range within which units can be affected beyond immediately adjacent units, if the value is equal to 'full-map', the area is the entire map.&lt;br /&gt;
* '''[filter_self]''': if the owner of the ability does not match this filter, it will not receive the effects of the ability. [filter_self] takes a [[StandardUnitFilter]] as argument.&lt;br /&gt;
* '''[filter_adjacent]''': if an adjacent unit does not match this filter, the ability will not be active and no-one will receive its affects. Takes extra keys ''adjacent'', ''count'', ''is_enemy'', just like in a [[StandardUnitFilter]], with the one difference that, in the absence of a specified ''count'', all listed directions must match (so, with two directiones eg ''adjacent=n,s'', the default is ''count=2''). In fact, it's really a shorthand for a [filter_adjacent] nested within [filter]. The variables $this_unit and {{DevFeature1.13|2}} $other_unit both work as you'd expect. Multiple [filter_adjacent] can be provided, all of which must pass for the ability to activate.&lt;br /&gt;
* '''[filter_adjacent_location]''': like [filter_adjacent], but filters on locations instead of units. This is a shorthand for [filter][filter_location][filter_adjacent_location].&lt;br /&gt;
* {{anchor|filter_base_value|'''[filter_base_value]'''}}: filters on the value before any modifications; uses the keys '''equals''', '''not_equals''', etc. If several keys are used all have to match.&lt;br /&gt;
* '''[event]''': [[EventWML]]. {{DevFeature1.19|4}} An [event] to be included into any scenario where a unit with this ability appears in. Note that such events get included when a unit with this ability first appears in the scenario, not automatically when the scenario begins (meaning that ''name=prestart'' events, for example, would usually never trigger). See [[WML_Abilities|WML Abilities]]. Shortcut of [unit_type][event].&lt;br /&gt;
&lt;br /&gt;
=== Extra keys used by the ''[heals]'' ability ===&lt;br /&gt;
&lt;br /&gt;
* '''value''': the amount healed.&lt;br /&gt;
* '''poison''': can be one of ''slowed'' or ''cured''. ''slowed'' means poison will not take effect for adjacent units (it's not related to the weapon special &amp;quot;slows&amp;quot;).&lt;br /&gt;
&lt;br /&gt;
=== Extra keys used by the ''[regenerate]'' ability ===&lt;br /&gt;
&lt;br /&gt;
* '''value''': the amount healed.&lt;br /&gt;
* '''poison''': can be one of ''slowed'' or ''cured''.&lt;br /&gt;
&lt;br /&gt;
=== Extra keys and tags used by the ''[resistance]'' ability ===&lt;br /&gt;
&lt;br /&gt;
* '''value''': set resistance to this value.&lt;br /&gt;
* '''max_value''': maximum resistance value. Default: 0%. {{DevFeature1.17|24}} Default: no limit.&lt;br /&gt;
* '''min_value''': {{DevFeature1.19|0}} minimum resistance value. Default: no limit.&lt;br /&gt;
* '''add''': adds to resistance. Note the interaction with '''sub''' in [[#Common_calculations]].&lt;br /&gt;
* '''sub''': subtracts from resistance.&lt;br /&gt;
* '''multiply''': multiplies resistance value. &lt;br /&gt;
* '''divide''': divides resistance value.&lt;br /&gt;
* '''apply_to''': a list of damage types; if left out, the ability applies to all types.&lt;br /&gt;
* '''active_on''': one of 'defense' or 'offense'; if left out, the ability is active on both.&lt;br /&gt;
These keys affect the actual resistance (e.g. -20%), not the damage modifier normally used in [resistance] (e.g. 120).&lt;br /&gt;
* '''[filter_weapon]''': {{DevFeature1.15|0}} If present, the resistance ability only takes effect when the owner of the ability uses a matching weapon.&lt;br /&gt;
* '''[filter_second_weapon]''': {{DevFeature1.15|0}} If present, the resistance ability only takes effect when the opponent uses a matching weapon.&lt;br /&gt;
&lt;br /&gt;
=== Extra keys used by the ''[leadership]'' ability ===&lt;br /&gt;
&lt;br /&gt;
* '''value''': the percentage bonus to damage.&lt;br /&gt;
* '''add''': the cumulative percentage bonus to damage. Note the interaction with '''sub''' in [[#Common_calculations]].&lt;br /&gt;
* '''sub''': the cumulative percentage bonus subtracted to damage.&lt;br /&gt;
* '''multiply''': multiplies resistance value. &lt;br /&gt;
* '''divide''': divides resistance value.&lt;br /&gt;
''Note:'' cumulative leadership with '''cumulative=yes''' and '''value=''' doesn't work in 1.16 (but fixed in 1.17.12 and later). To work around use '''add=''' or '''sub=''' key (it doesn't require cumulative) (https://github.com/wesnoth/wesnoth/issues/6466 ). If you want each instance of a ''[leadership]'' with the same id to be added you will be able to reuse '''cumulative=yes''' in 1.17.12 and later, otherwise, if you want to add the value of another ''[leadership]'' only once even with the same id in several copies, use '''add'''.&lt;br /&gt;
* '''[filter_weapon]''': {{DevFeature1.15|0}} If present, the leadership ability only takes effect when the owner of the ability uses a matching weapon.&lt;br /&gt;
* '''[filter_second_weapon]''': {{DevFeature1.15|0}} If present, the leadership ability only takes effect when the opponent uses a matching weapon.&lt;br /&gt;
&lt;br /&gt;
=== Extra keys used by the ''[illuminates]'' ability ===&lt;br /&gt;
&lt;br /&gt;
Because this ability changes the terrain instead of units on it, affect_self, affect_allies, affect_enemies and [filter_adjacent] have no effect.&lt;br /&gt;
* '''value''': the percentage bonus to lawful units. Units with '''alignment=lawful''' do +''value'' % damage when under the influence of a unit with this ability. Units with '''alignment=chaotic''' do -''value'' % damage. Units with '''alignment=neutral''' are unaffected by this ability. Units with '''alignment=liminal''' do -(abs(''value'')) % damage. ''value'' can be a negative number; this is useful if you want to give Chaotic units an advantage instead of Lawful ones. &lt;br /&gt;
* '''add''': the cumulative percentage bonus to damage. Note the interaction with '''sub''' in [[#Common_calculations]].&lt;br /&gt;
* '''sub''': the cumulative percentage bonus subtracted to damage.&lt;br /&gt;
* '''multiply''': multiplies resistance value. &lt;br /&gt;
* '''divide''': divides resistance value.&lt;br /&gt;
* '''max_value''': the maximum percentage bonus given. Cannot be less than 0. Defaults to 0 if not present.&lt;br /&gt;
* '''min_value''': the minimum percentage bonus given. Cannot be greater than 0. Defaults to 0 if not present.&lt;br /&gt;
&lt;br /&gt;
=== Extra keys used by the ''[hides]'' ability ===&lt;br /&gt;
&lt;br /&gt;
* '''alert''': the displayed text when the unit is discovered. Default &amp;quot;Ambushed!&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
=== Extra tags used by the ''[teleport]'' ability ===&lt;br /&gt;
&lt;br /&gt;
* '''[tunnel]''' - a [[DirectActionsWML#.5Btunnel.5D|tunnel tag]] (without the remove key) defining the tunneling source and target hexes, and maybe other conditions. (It automatically applies only to the unit with the ability.)  You may use $teleport_unit inside the [tunnel][source] and [tunnel][target] tag for filtering purposes.&lt;br /&gt;
&lt;br /&gt;
=== Extra tags and keys used by weapon specials as abilities ===&lt;br /&gt;
&lt;br /&gt;
* {{anchor|filter_student|'''[filter_student]'''}}: {{DevFeature1.15|0}} If present, only the unit matching this filter, either the possessor of the ability if affect_self=yes, or an adjacent unit matching '''[filter_adjacent]''' will be affected. '''Replaces''' '''[filter_self]''' of normal weapon specials.&lt;br /&gt;
* '''overwrite_specials''': {{DevFeature1.15|13}} If present, allows a special abilities weapon with a numerical value to impose its value and ignore values of abilities or specials of the same type. If '''overwrite_specials=one_side''', the specials and abilities used by the opponent of the unit affected by the ability with this key and applied to it will not be affected. If '''overwrite_specials=both_sides''', all non-key-carrying abilities and all specials of the same type affecting the recipient unit will be affected, even if used by the opponent (used in the macro FORCE_CHANCE_TO_HIT).&lt;br /&gt;
* {{anchor|overwrite|'''[overwrite]'''}}: {{DevFeature1.17|22}} Part of '''overwrite_specials'''. Allows more flexibility in determining which specials should take priority over other specials of the same type.&lt;br /&gt;
** '''priority''': A numeric value to use when determining which special should be used if multiple specials of the same type have the '''overwrite_specials''' attribute. Default is 0.&lt;br /&gt;
** {{anchor|filter_specials|'''[experimental_filter_specials]'''}}: [[StandardAbilityFilter]] Further attributes to filter specials by to determine if it should take priority over other specials. Accepts the same attributes as [experimental_filter_ability].&lt;br /&gt;
* Other keys and tags appropriate to the specific weapon special.&lt;br /&gt;
&lt;br /&gt;
=== Macros for common abilities ===&lt;br /&gt;
&lt;br /&gt;
[https://www.wesnoth.org/macro-reference.html#file:abilities.cfg macro reference]&lt;br /&gt;
* ABILITY_AMBUSH&lt;br /&gt;
* ABILITY_CURES&lt;br /&gt;
* ABILITY_HEALS&lt;br /&gt;
* ABILITY_ILLUMINATES&lt;br /&gt;
* ABILITY_LEADERSHIP_LEVEL_1 to ABILITY_LEADERSHIP_LEVEL_5&lt;br /&gt;
* {{DevFeature1.13|2}} ABILITY_LEADERSHIP (replaces the above leadership macros, which are now deprecated)&lt;br /&gt;
* ABILITY_NIGHTSTALK&lt;br /&gt;
* ABILITY_REGENERATES&lt;br /&gt;
* ABILITY_SKIRMISHER&lt;br /&gt;
* ABILITY_STEADFAST&lt;br /&gt;
* ABILITY_SUBMERGE&lt;br /&gt;
* ABILITY_TELEPORT&lt;br /&gt;
&lt;br /&gt;
== The ''[specials]'' tag ==&lt;br /&gt;
&lt;br /&gt;
The '''[specials]''' tag goes inside the '''[attack]''' tag. It can contain the following tags:&lt;br /&gt;
&lt;br /&gt;
* '''[attacks]''': modifies the number of attacks of a weapon, in using '''value''', '''add''', '''sub''', '''multiply''' or '''divide''' attributes&lt;br /&gt;
* '''[berserk]''': pushes the attack for more than one combat round, using '''value''' attribute, '''value''' is 1 by default&lt;br /&gt;
* '''[chance_to_hit]''': modifies the chance to hit of a weapon, using same standard numerical attributes as '''[attacks]'''&lt;br /&gt;
* '''[damage]''': modifies the damage of a weapon, using same attributes as '''[attacks]''' and '''[chance_to_hit]'''&lt;br /&gt;
* '''[damage_type]''' {{DevFeature1.17|23}}: changes the damage type of a weapon&lt;br /&gt;
* '''[defense]''' {{DevFeature1.19|15}}: modifies the chances of being hit by the opponent's weapon, this value can be modified by the parry attribute, the accuracy attribute of the opponent's weapon, or by their special weapon '''[chance_to_hit]'''. Be careful, the more you increase the value, the less chance the opponent has of hitting you. Using same standard numerical attributes as '''[attacks]'''&lt;br /&gt;
* '''[disable]''': disables the weapon&lt;br /&gt;
* '''[drains]''': heals the attacker '''value''' percentage of the damage dealt, using same attributes as '''[attacks]''' and '''[chance_to_hit]''', '''value''' is 50 by default&lt;br /&gt;
* '''[firststrike]''': forces the weapon to always strike first&lt;br /&gt;
* '''[heal_on_hit]''': heals the attacker when an attack connects, using same attributes as '''[attacks]''' and '''[chance_to_hit]''', '''value''' is 0 by default&lt;br /&gt;
* '''[petrifies]''': turns the target to stone&lt;br /&gt;
* '''[plague]''': when used to kill an enemy, a friendly unit takes its place&lt;br /&gt;
* '''[poison]''': poisons the target&lt;br /&gt;
* '''[slow]''': slows the target&lt;br /&gt;
* '''[swarm]''': number of strikes decreases as the unit loses hitpoints&lt;br /&gt;
Any other tag is valid, but will result in a special that does nothing but report it is there.&lt;br /&gt;
&lt;br /&gt;
=== Common keys and tags for every weapon special ===&lt;br /&gt;
&lt;br /&gt;
{{DevFeature1.13|?}} All keys inside any weapon special that expects a numeric value will also accept formulas using [[Wesnoth Formula Language]]. In order to use a formula in these keys, you must enclose it in parentheses.&lt;br /&gt;
&lt;br /&gt;
* '''name''': the (translatable) name of the special. If omitted, the special will be hidden from the player.&lt;br /&gt;
* '''name_inactive''': the (translatable) name of the special when inactive. Defaults to ''name'' if not specified; if the special is supposed to be not displayed when inactive, you must explicitly set ''name_inactive'' to an empty string (nothing after the equals sign).&lt;br /&gt;
* '''description''': the (translatable) description of the special.&lt;br /&gt;
* '''description_inactive''': the (translatable) description of the special when inactive. Defaults to ''description'' if not specified.&lt;br /&gt;
* '''special_note''' {{DevFeature1.15|14}} Translatable string, which will be displayed in the unit’s help. See also [[UnitTypeWML#Special_Notes]].&lt;br /&gt;
* '''id''': this ability will not be cumulative with other specials using this id.&lt;br /&gt;
* '''active_on''': one of '''defense''' or '''offense'''; if left out, the special is active on both.&lt;br /&gt;
* '''apply_to''': one of '''self''','''opponent''','''attacker''','''defender''','''both''' (default: ''self''). Determines who the effects of this special are applied to.&lt;br /&gt;
* '''[filter_adjacent]''': if an adjacent unit does not match this filter, the special will not be active and no-one will receive its effects. Takes extra keys ''adjacent'', ''count'', ''is_enemy'', just like in a [[StandardUnitFilter]]. In fact, it's really a shorthand for a [filter_adjacent] nested within [filter_self], with the one difference that, in the absence of a specified ''count'', all listed directions must match (so, with two directiones eg ''adjacent=n,s'', the default is ''count=2''). The variables $this_unit and {{DevFeature1.13|2}} $other_unit both work as you'd expect. Multiple [filter_adjacent] can be provided, all of which must pass for the ability to activate. &lt;br /&gt;
* '''[filter_adjacent_location]''': like [filter_adjacent], but filters on locations instead of units. This is a shorthand for [filter_self][filter_location][filter_adjacent_location].&lt;br /&gt;
* {{anchor|filter_self|'''[filter_self]'''}}: the special will only be active if the owner matches this [[StandardUnitFilter]] (SUF).&lt;br /&gt;
** '''[filter_weapon]''': a [[FilterWML#Filtering_Weapons|standard weapon filter]], including special=.&lt;br /&gt;
** '''$other_unit''': {{DevFeature1.13|2}} The special variable $other_unit refers to the opponent.&lt;br /&gt;
* {{anchor|filter_opponent|'''[filter_opponent]'''}}: the special will only be active if the opponent matches this SUF.&lt;br /&gt;
** '''[filter_weapon]''': a [[FilterWML#Filtering_Weapons|standard weapon filter]], including special=.&lt;br /&gt;
** '''$other_unit''': {{DevFeature1.13|2}} The special variable $other_unit refers to the unit that owns the weapon.&lt;br /&gt;
* {{anchor|filter_attacker|'''[filter_attacker]'''}}: the special will only be active if the attacker matches this SUF.&lt;br /&gt;
** '''[filter_weapon]''': a [[FilterWML#Filtering_Weapons|standard weapon filter]], including special=.&lt;br /&gt;
** '''$other_unit''': {{DevFeature1.13|2}} The special variable $other_unit refers to the defender.&lt;br /&gt;
* {{anchor|filter_defender|'''[filter_defender]'''}} the special will only be active if the defender matches this SUF.&lt;br /&gt;
** '''[filter_weapon]''': a [[FilterWML#Filtering_Weapons|standard weapon filter]], including special=.&lt;br /&gt;
** '''$other_unit''': {{DevFeature1.13|2}} The special variable $other_unit refers to the attacker.&lt;br /&gt;
* '''overwrite_specials''': if equal to 'one_side', then only this unit's specials are evaluated. If equal to 'both_sides', then both this unit's specials and any of the opponent's weapon specials that affect this unit are evaluated. If a special with this attribute is active, it will take precedence over any other specials of the same type that do not have this attribute. Don't applied to boolean weapon special like [poison] ,[slow], [firststrike] or [petrifies].&lt;br /&gt;
* '''[overwrite]''': {{DevFeature1.17|22}} Allows more flexibility in determining which specials should take priority over other specials of the same type.&lt;br /&gt;
** '''priority''': A numeric value to use when determining which special should be used if multiple specials of the same type have the '''overwrite_specials''' attribute. Default is 0.&lt;br /&gt;
** '''[experimental_filter_specials]''': [[StandardAbilityFilter]] Further attributes to filter specials by to determine if it should take priority over other specials. Accepts the same attributes as [experimental_filter_ability], {{DevFeature1.19|5}} [experimental_filter_specials] deprecated, use [filter_specials] instead.&lt;br /&gt;
* '''[event]''': [[EventWML]]. {{DevFeature1.19|4}} An [event] to be included into any scenario where a unit with this weapon special appears in. Note that such events get included when a unit with this weapon special first appears in the scenario, not automatically when the scenario begins (meaning that ''name=prestart'' events, for example, would usually never trigger). See [[WML_Abilities|WML Abilities]]. Shortcut of [unit_type][event].&lt;br /&gt;
&lt;br /&gt;
=== Common keys and tags for specials with a value ===&lt;br /&gt;
&lt;br /&gt;
The '''[damage]''', '''[attacks]''', and '''[chance_to_hit]''' specials take values that specify how those specials modify their respective base values. The '''[drains]''' special takes a value specifying the percentage of damage drained (default 50) and '''[heal_on_hit]''' takes the amount to heal (default 0; negative values will harm the attacker, but not kill). &lt;br /&gt;
&lt;br /&gt;
* '''value''': the value to be used. &lt;br /&gt;
* '''add''': the number to add to the base value. Note the interaction with '''sub''' in [[#Common_calculations]].&lt;br /&gt;
* '''sub''': the number to subtract from the base value.&lt;br /&gt;
* '''multiply''': this multiplies the base value.&lt;br /&gt;
* '''divide''': this divides the base value.&lt;br /&gt;
* '''cumulative''': if set to 'yes', this special will be cumulative with the base value.&lt;br /&gt;
* '''backstab''': if set to 'yes', this special will only apply to the attacker, and only when there is an enemy on the target's opposite side (i.e. when the standard backstab special applies). {{DevFeature1.13|2}} This is now deprecated. The same functionality can be achieved with a [filter_adjacent] in [filter_opponent]; see the implementation of the default backstab special for details.&lt;br /&gt;
* '''[filter_base_value]''': filters on the value before any modifications; uses the keys '''equals''', '''not_equals''', '''less_than''', '''greater_than''', '''less_than_equal_to''', '''greater_than_equal_to'''.&lt;br /&gt;
&lt;br /&gt;
==== Common calculations ====&lt;br /&gt;
&lt;br /&gt;
Several abilities and weapon specials take the keys '''add''', '''sub''', '''multiply''' and '''divide'''.&lt;br /&gt;
&lt;br /&gt;
{{DevFeature1.19|4}} '''add''' and '''sub''' work independently.&lt;br /&gt;
&lt;br /&gt;
Prior to 1.19.4:&lt;br /&gt;
&lt;br /&gt;
* If '''add''' and '''sub''' are used in the same ability, the '''add''' is ignored&lt;br /&gt;
* If '''add''' and '''sub''' are used in separate abilities with the same id, or with the default id that's used when no id is specified, then the order in which the abilities are encountered controls the calculation, which may change depending on units' positions on the map.&lt;br /&gt;
&lt;br /&gt;
=== Extra keys used by the ''[damage_type]'' special ===&lt;br /&gt;
&lt;br /&gt;
{{DevFeature1.17|23}}&lt;br /&gt;
&lt;br /&gt;
* '''replacement_type''': replaces the attack type with the specified type when [damage_type] is active.&lt;br /&gt;
* '''alternative_type''': add a second type of attack to the existing type, it is always the one of the two which will do the most damage to the opponent which will be used.&lt;br /&gt;
&lt;br /&gt;
'''Note:''' In 1.18, alternative_type may be stronger than expected, as the damage calculations sometimes ignore [resistance] abilities. This is a known bug, which occurs deterministically and will be left unfixed in 1.18.x to prevent Out Of Sync errors.&lt;br /&gt;
&lt;br /&gt;
'''Note:''' If a [damage_type] special includes a [filter_weapon]type=, that filter is tested against the base type of the weapon, ignoring all [damage_type] specials.&lt;br /&gt;
&lt;br /&gt;
=== Extra keys used by the ''[berserk]'' special ===&lt;br /&gt;
&lt;br /&gt;
* '''value''': the maximum number of combat rounds (default 1).&lt;br /&gt;
* '''cumulative''': if set to 'yes', this special will be cumulative with other active berserk specials (on the current combatant, not with an opponent's berserk).&lt;br /&gt;
&lt;br /&gt;
=== Extra keys used by the ''[plague]'' special ===&lt;br /&gt;
&lt;br /&gt;
* '''type''': the unit type to be spawned on kill. When not specified, the default is the unit type of the unit doing the plaguing.&lt;br /&gt;
&lt;br /&gt;
=== Extra keys used by the ''[swarm]'' special ===&lt;br /&gt;
&lt;br /&gt;
* '''swarm_attacks_max''': the maximum number of attacks for the swarm. Defaults to the base number of attacks modified by any applicable [attacks] specials. If this is specified, then the base number of attacks is ignored.&lt;br /&gt;
* '''swarm_attacks_min''': the minimum number of attacks for the swarm. Defaults to zero. This can be set higher than swarm_attacks_max to cause a unit to gain attacks as health decreases.&lt;br /&gt;
The ratio of the unit's current to maximum hit points will be used to scale the number of attacks between these two values.&lt;br /&gt;
&lt;br /&gt;
Prior to version 1.11, a [swarm] special will cause [attacks] specials to be ignored. In 1.11 and later, [attacks] specials are applied before [swarm].&lt;br /&gt;
&lt;br /&gt;
=== Macros for common weapon specials ===&lt;br /&gt;
&lt;br /&gt;
[https://www.wesnoth.org/macro-reference.html#file:weapon_specials.cfg macro reference]&lt;br /&gt;
* WEAPON_SPECIAL_BACKSTAB&lt;br /&gt;
* WEAPON_SPECIAL_BERSERK&lt;br /&gt;
* WEAPON_SPECIAL_CHARGE&lt;br /&gt;
* WEAPON_SPECIAL_DRAIN&lt;br /&gt;
* WEAPON_SPECIAL_FIRSTSTRIKE&lt;br /&gt;
* WEAPON_SPECIAL_MAGICAL&lt;br /&gt;
* WEAPON_SPECIAL_MARKSMAN&lt;br /&gt;
* WEAPON_SPECIAL_PLAGUE&lt;br /&gt;
* WEAPON_SPECIAL_PLAGUE_TYPE TYPE&lt;br /&gt;
* WEAPON_SPECIAL_POISON&lt;br /&gt;
* WEAPON_SPECIAL_SLOW&lt;br /&gt;
* WEAPON_SPECIAL_STONE&lt;br /&gt;
* WEAPON_SPECIAL_SWARM&lt;br /&gt;
&lt;br /&gt;
== See Also ==&lt;br /&gt;
&lt;br /&gt;
* [[UnitTypeWML]]&lt;br /&gt;
* [[SingleUnitWML]]&lt;br /&gt;
* [[ReferenceWML]]&lt;br /&gt;
&lt;br /&gt;
[[Category:WML Reference]]&lt;/div&gt;</summary>
		<author><name>Soliton</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.wesnoth.org/index.php?title=UsefulLinks&amp;diff=74459</id>
		<title>UsefulLinks</title>
		<link rel="alternate" type="text/html" href="https://wiki.wesnoth.org/index.php?title=UsefulLinks&amp;diff=74459"/>
		<updated>2025-07-28T09:49:36Z</updated>

		<summary type="html">&lt;p&gt;Soliton: /* Developers */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
!colspan=2 style='text-align:left'|&lt;br /&gt;
=== Battle for Wesnoth ===&lt;br /&gt;
|-&lt;br /&gt;
|Home Page || https://www.wesnoth.org/&lt;br /&gt;
|-&lt;br /&gt;
|GitHub Project Page || https://github.com/wesnoth/&lt;br /&gt;
|-&lt;br /&gt;
|SPI project page || https://www.spi-inc.org/projects/wesnoth/&lt;br /&gt;
|-&lt;br /&gt;
|Changelog || https://changelog.wesnoth.org/ [http://stable-changelog.wesnoth.org stable]&lt;br /&gt;
|-&lt;br /&gt;
|This wiki || [[StartingPoints|https://wiki.wesnoth.org/]]&lt;br /&gt;
|-&lt;br /&gt;
|The manual || https://manual.wesnoth.org/&lt;br /&gt;
|-&lt;br /&gt;
|Translation statistics || https://gettext.wesnoth.org/&lt;br /&gt;
|-&lt;br /&gt;
|Add-on server web interface || https://addons.wesnoth.org/ [http://stable-addons.wesnoth.org stable] [http://dev-addons.wesnoth.org dev]&lt;br /&gt;
|-&lt;br /&gt;
|Code and Content Copyright || https://wiki.wesnoth.org/Wesnoth:Copyrights&lt;br /&gt;
|-&lt;br /&gt;
|Multiplayer server statistics || https://wesnothd.wesnoth.org/&lt;br /&gt;
|-&lt;br /&gt;
|Multiplayer statistics || https://replays.wesnoth.org/dashboard/&lt;br /&gt;
|-&lt;br /&gt;
|Multiplayer replays || https://replays.wesnoth.org&lt;br /&gt;
|-&lt;br /&gt;
|Unit advancement tree || https://units.wesnoth.org/&lt;br /&gt;
|-&lt;br /&gt;
|SteamDB || https://steamdb.info/app/599390/&lt;br /&gt;
|-&lt;br /&gt;
|Forum for users and developers || https://forums.wesnoth.org/ [https://forums.wesnoth.org/search.php?search_id=newposts new posts]&lt;br /&gt;
|-&lt;br /&gt;
|List of Frequently Proposed Ideas || https://forums.wesnoth.org/viewtopic.php?f=12&amp;amp;t=34904&lt;br /&gt;
|-&lt;br /&gt;
|IRC channel (Libera.Chat) || ircs://irc.libera.chat/#wesnoth&lt;br /&gt;
|-&lt;br /&gt;
|Discord server || https://discord.gg/battleforwesnoth&lt;br /&gt;
|-&lt;br /&gt;
|IRC logs || https://wesnoth.org/irclogs/&lt;br /&gt;
|-&lt;br /&gt;
|Mastodon Account || https://fosstodon.org/@wesnoth&lt;br /&gt;
|-&lt;br /&gt;
|Project statistics || https://openhub.net/p/wesnoth&lt;br /&gt;
|-&lt;br /&gt;
!colspan=2 style='text-align:left'|&lt;br /&gt;
&lt;br /&gt;
=== Developers ===&lt;br /&gt;
|-|Git web interface || https://github.com/wesnoth/wesnoth&lt;br /&gt;
|-&lt;br /&gt;
|Git homepage || https://git-scm.com/&lt;br /&gt;
|-&lt;br /&gt;
|Git documentation || https://git-scm.com/documentation&lt;br /&gt;
|-&lt;br /&gt;
|Code documentation || https://devdocs.wesnoth.org/&lt;br /&gt;
|-&lt;br /&gt;
|GUI(2) documentation || https://wiki.wesnoth.org/GUIToolkit&lt;br /&gt;
|-&lt;br /&gt;
|Lua documentation || https://wiki.wesnoth.org/LuaAPI&lt;br /&gt;
|-&lt;br /&gt;
|WML documentation || https://wiki.wesnoth.org/WML&lt;br /&gt;
|-&lt;br /&gt;
|WFL documentation || https://wiki.wesnoth.org/WFL&lt;br /&gt;
|-&lt;br /&gt;
|Mailing lists || [https://groups.io/g/wesnoth-packagers wesnoth-packagers] - [https://groups.io/g/wesnoth-translations wesnoth-translations] ([https://listengine.tuxfamily.org/wesnoth.org/ old] - [https://mailman.wesnoth.org/ oldold])&lt;br /&gt;
|-&lt;br /&gt;
|Bug/Feature tracker || https://bugs.wesnoth.org/&lt;br /&gt;
|-&lt;br /&gt;
|Patch tracker || https://patches.wesnoth.org/&lt;br /&gt;
|-&lt;br /&gt;
|wesnoth.org server stats || https://collectd.wesnoth.org&lt;br /&gt;
|-&lt;br /&gt;
|IRC channel (Libera.Chat) || ircs://irc.libera.chat/wesnoth-dev&lt;br /&gt;
|-&lt;br /&gt;
!colspan=2 style='text-align:left'|&lt;br /&gt;
&lt;br /&gt;
=== Other Links ===&lt;br /&gt;
|-&lt;br /&gt;
|1vs1 Wesnoth ladder || https://wesnoth.gamingladder.info/&lt;br /&gt;
|-&lt;br /&gt;
|Wesnoth matches with commentary || http://www.youtube.com/user/NekisBrutalWesnoth&lt;br /&gt;
|-&lt;br /&gt;
|Wesnoth campaign with commentary in german || https://www.youtube.com/playlist?list=PLc3DmuDuA2imW1vg9xXMNjGHm8VaXvEaz&lt;br /&gt;
|-&lt;br /&gt;
|WSNPP || [[WSNPP|http://wiki.wesnoth.org/WSNPP]]&lt;br /&gt;
|-&lt;br /&gt;
|Run Wesnoth online (Windows) || http://spoon.net/the-battle-for-wesnoth&lt;br /&gt;
|-&lt;br /&gt;
!colspan=2 style='text-align:left'|&lt;br /&gt;
=== Multilingual Players' Sites ===&lt;br /&gt;
|-&lt;br /&gt;
|Community in China || http://wesnoth.cn/&lt;br /&gt;
|-&lt;br /&gt;
|Polish Community || https://www.wesnoth.com.pl/forum/index.php&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
[[Category:Wesnoth Wiki]]&lt;/div&gt;</summary>
		<author><name>Soliton</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.wesnoth.org/index.php?title=UsefulLinks&amp;diff=74458</id>
		<title>UsefulLinks</title>
		<link rel="alternate" type="text/html" href="https://wiki.wesnoth.org/index.php?title=UsefulLinks&amp;diff=74458"/>
		<updated>2025-07-28T09:45:01Z</updated>

		<summary type="html">&lt;p&gt;Soliton: /* Developers */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
!colspan=2 style='text-align:left'|&lt;br /&gt;
=== Battle for Wesnoth ===&lt;br /&gt;
|-&lt;br /&gt;
|Home Page || https://www.wesnoth.org/&lt;br /&gt;
|-&lt;br /&gt;
|GitHub Project Page || https://github.com/wesnoth/&lt;br /&gt;
|-&lt;br /&gt;
|SPI project page || https://www.spi-inc.org/projects/wesnoth/&lt;br /&gt;
|-&lt;br /&gt;
|Changelog || https://changelog.wesnoth.org/ [http://stable-changelog.wesnoth.org stable]&lt;br /&gt;
|-&lt;br /&gt;
|This wiki || [[StartingPoints|https://wiki.wesnoth.org/]]&lt;br /&gt;
|-&lt;br /&gt;
|The manual || https://manual.wesnoth.org/&lt;br /&gt;
|-&lt;br /&gt;
|Translation statistics || https://gettext.wesnoth.org/&lt;br /&gt;
|-&lt;br /&gt;
|Add-on server web interface || https://addons.wesnoth.org/ [http://stable-addons.wesnoth.org stable] [http://dev-addons.wesnoth.org dev]&lt;br /&gt;
|-&lt;br /&gt;
|Code and Content Copyright || https://wiki.wesnoth.org/Wesnoth:Copyrights&lt;br /&gt;
|-&lt;br /&gt;
|Multiplayer server statistics || https://wesnothd.wesnoth.org/&lt;br /&gt;
|-&lt;br /&gt;
|Multiplayer statistics || https://replays.wesnoth.org/dashboard/&lt;br /&gt;
|-&lt;br /&gt;
|Multiplayer replays || https://replays.wesnoth.org&lt;br /&gt;
|-&lt;br /&gt;
|Unit advancement tree || https://units.wesnoth.org/&lt;br /&gt;
|-&lt;br /&gt;
|SteamDB || https://steamdb.info/app/599390/&lt;br /&gt;
|-&lt;br /&gt;
|Forum for users and developers || https://forums.wesnoth.org/ [https://forums.wesnoth.org/search.php?search_id=newposts new posts]&lt;br /&gt;
|-&lt;br /&gt;
|List of Frequently Proposed Ideas || https://forums.wesnoth.org/viewtopic.php?f=12&amp;amp;t=34904&lt;br /&gt;
|-&lt;br /&gt;
|IRC channel (Libera.Chat) || ircs://irc.libera.chat/#wesnoth&lt;br /&gt;
|-&lt;br /&gt;
|Discord server || https://discord.gg/battleforwesnoth&lt;br /&gt;
|-&lt;br /&gt;
|IRC logs || https://wesnoth.org/irclogs/&lt;br /&gt;
|-&lt;br /&gt;
|Mastodon Account || https://fosstodon.org/@wesnoth&lt;br /&gt;
|-&lt;br /&gt;
|Project statistics || https://openhub.net/p/wesnoth&lt;br /&gt;
|-&lt;br /&gt;
!colspan=2 style='text-align:left'|&lt;br /&gt;
&lt;br /&gt;
=== Developers ===&lt;br /&gt;
|-|Git web interface || https://github.com/wesnoth/wesnoth&lt;br /&gt;
|-&lt;br /&gt;
|Git homepage || https://git-scm.com/&lt;br /&gt;
|-&lt;br /&gt;
|Git documentation || https://git-scm.com/documentation&lt;br /&gt;
|-&lt;br /&gt;
|Code documentation || https://devdocs.wesnoth.org/&lt;br /&gt;
|-&lt;br /&gt;
|GUI(2) documentation || https://wiki.wesnoth.org/GUIToolkit&lt;br /&gt;
|-&lt;br /&gt;
|Lua documentation || https://wiki.wesnoth.org/LuaAPI&lt;br /&gt;
|-&lt;br /&gt;
|WML documentation || https://wiki.wesnoth.org/WML&lt;br /&gt;
|-&lt;br /&gt;
|WFL documentation || https://wiki.wesnoth.org/WFL&lt;br /&gt;
|-&lt;br /&gt;
|Mailing lists || https://groups.io/g/wesnoth-packagers&amp;lt;br&amp;gt;&lt;br /&gt;
https://groups.io/g/wesnoth-translations&amp;lt;br&amp;gt;&lt;br /&gt;
old: https://listengine.tuxfamily.org/wesnoth.org/&amp;lt;br&amp;gt;&lt;br /&gt;
oldold: https://mailman.wesnoth.org/&lt;br /&gt;
|-&lt;br /&gt;
|Bug/Feature tracker || https://bugs.wesnoth.org/&lt;br /&gt;
|-&lt;br /&gt;
|Patch tracker || https://patches.wesnoth.org/&lt;br /&gt;
|-&lt;br /&gt;
|wesnoth.org server stats || https://collectd.wesnoth.org&lt;br /&gt;
|-&lt;br /&gt;
|IRC channel (Libera.Chat) || ircs://irc.libera.chat/wesnoth-dev&lt;br /&gt;
|-&lt;br /&gt;
!colspan=2 style='text-align:left'|&lt;br /&gt;
&lt;br /&gt;
=== Other Links ===&lt;br /&gt;
|-&lt;br /&gt;
|1vs1 Wesnoth ladder || https://wesnoth.gamingladder.info/&lt;br /&gt;
|-&lt;br /&gt;
|Wesnoth matches with commentary || http://www.youtube.com/user/NekisBrutalWesnoth&lt;br /&gt;
|-&lt;br /&gt;
|Wesnoth campaign with commentary in german || https://www.youtube.com/playlist?list=PLc3DmuDuA2imW1vg9xXMNjGHm8VaXvEaz&lt;br /&gt;
|-&lt;br /&gt;
|WSNPP || [[WSNPP|http://wiki.wesnoth.org/WSNPP]]&lt;br /&gt;
|-&lt;br /&gt;
|Run Wesnoth online (Windows) || http://spoon.net/the-battle-for-wesnoth&lt;br /&gt;
|-&lt;br /&gt;
!colspan=2 style='text-align:left'|&lt;br /&gt;
=== Multilingual Players' Sites ===&lt;br /&gt;
|-&lt;br /&gt;
|Community in China || http://wesnoth.cn/&lt;br /&gt;
|-&lt;br /&gt;
|Polish Community || https://www.wesnoth.com.pl/forum/index.php&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
[[Category:Wesnoth Wiki]]&lt;/div&gt;</summary>
		<author><name>Soliton</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.wesnoth.org/index.php?title=UsefulLinks&amp;diff=74457</id>
		<title>UsefulLinks</title>
		<link rel="alternate" type="text/html" href="https://wiki.wesnoth.org/index.php?title=UsefulLinks&amp;diff=74457"/>
		<updated>2025-07-28T09:42:31Z</updated>

		<summary type="html">&lt;p&gt;Soliton: /* Developers */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
!colspan=2 style='text-align:left'|&lt;br /&gt;
=== Battle for Wesnoth ===&lt;br /&gt;
|-&lt;br /&gt;
|Home Page || https://www.wesnoth.org/&lt;br /&gt;
|-&lt;br /&gt;
|GitHub Project Page || https://github.com/wesnoth/&lt;br /&gt;
|-&lt;br /&gt;
|SPI project page || https://www.spi-inc.org/projects/wesnoth/&lt;br /&gt;
|-&lt;br /&gt;
|Changelog || https://changelog.wesnoth.org/ [http://stable-changelog.wesnoth.org stable]&lt;br /&gt;
|-&lt;br /&gt;
|This wiki || [[StartingPoints|https://wiki.wesnoth.org/]]&lt;br /&gt;
|-&lt;br /&gt;
|The manual || https://manual.wesnoth.org/&lt;br /&gt;
|-&lt;br /&gt;
|Translation statistics || https://gettext.wesnoth.org/&lt;br /&gt;
|-&lt;br /&gt;
|Add-on server web interface || https://addons.wesnoth.org/ [http://stable-addons.wesnoth.org stable] [http://dev-addons.wesnoth.org dev]&lt;br /&gt;
|-&lt;br /&gt;
|Code and Content Copyright || https://wiki.wesnoth.org/Wesnoth:Copyrights&lt;br /&gt;
|-&lt;br /&gt;
|Multiplayer server statistics || https://wesnothd.wesnoth.org/&lt;br /&gt;
|-&lt;br /&gt;
|Multiplayer statistics || https://replays.wesnoth.org/dashboard/&lt;br /&gt;
|-&lt;br /&gt;
|Multiplayer replays || https://replays.wesnoth.org&lt;br /&gt;
|-&lt;br /&gt;
|Unit advancement tree || https://units.wesnoth.org/&lt;br /&gt;
|-&lt;br /&gt;
|SteamDB || https://steamdb.info/app/599390/&lt;br /&gt;
|-&lt;br /&gt;
|Forum for users and developers || https://forums.wesnoth.org/ [https://forums.wesnoth.org/search.php?search_id=newposts new posts]&lt;br /&gt;
|-&lt;br /&gt;
|List of Frequently Proposed Ideas || https://forums.wesnoth.org/viewtopic.php?f=12&amp;amp;t=34904&lt;br /&gt;
|-&lt;br /&gt;
|IRC channel (Libera.Chat) || ircs://irc.libera.chat/#wesnoth&lt;br /&gt;
|-&lt;br /&gt;
|Discord server || https://discord.gg/battleforwesnoth&lt;br /&gt;
|-&lt;br /&gt;
|IRC logs || https://wesnoth.org/irclogs/&lt;br /&gt;
|-&lt;br /&gt;
|Mastodon Account || https://fosstodon.org/@wesnoth&lt;br /&gt;
|-&lt;br /&gt;
|Project statistics || https://openhub.net/p/wesnoth&lt;br /&gt;
|-&lt;br /&gt;
!colspan=2 style='text-align:left'|&lt;br /&gt;
&lt;br /&gt;
=== Developers ===&lt;br /&gt;
|-|Git web interface || https://github.com/wesnoth/wesnoth&lt;br /&gt;
|-&lt;br /&gt;
|Git homepage || https://git-scm.com/&lt;br /&gt;
|-&lt;br /&gt;
|Git documentation || https://git-scm.com/documentation&lt;br /&gt;
|-&lt;br /&gt;
|Code documentation || https://devdocs.wesnoth.org/&lt;br /&gt;
|-&lt;br /&gt;
|GUI(2) documentation || https://wiki.wesnoth.org/GUIToolkit&lt;br /&gt;
|-&lt;br /&gt;
|Lua documentation || https://wiki.wesnoth.org/LuaAPI&lt;br /&gt;
|-&lt;br /&gt;
|WML documentation || https://wiki.wesnoth.org/WML&lt;br /&gt;
|-&lt;br /&gt;
|WFL documentation || https://wiki.wesnoth.org/WFL&lt;br /&gt;
|-&lt;br /&gt;
|Mailing lists || https://groups.io/g/wesnoth-packagers - https://groups.io/g/wesnoth-translations &amp;lt;br&amp;gt;&lt;br /&gt;
(old: https://listengine.tuxfamily.org/wesnoth.org/ - oldold: https://mailman.wesnoth.org/)&lt;br /&gt;
|-&lt;br /&gt;
|Bug/Feature tracker || https://bugs.wesnoth.org/&lt;br /&gt;
|-&lt;br /&gt;
|Patch tracker || https://patches.wesnoth.org/&lt;br /&gt;
|-&lt;br /&gt;
|wesnoth.org server stats || https://collectd.wesnoth.org&lt;br /&gt;
|-&lt;br /&gt;
|IRC channel (Libera.Chat) || ircs://irc.libera.chat/wesnoth-dev&lt;br /&gt;
|-&lt;br /&gt;
!colspan=2 style='text-align:left'|&lt;br /&gt;
&lt;br /&gt;
=== Other Links ===&lt;br /&gt;
|-&lt;br /&gt;
|1vs1 Wesnoth ladder || https://wesnoth.gamingladder.info/&lt;br /&gt;
|-&lt;br /&gt;
|Wesnoth matches with commentary || http://www.youtube.com/user/NekisBrutalWesnoth&lt;br /&gt;
|-&lt;br /&gt;
|Wesnoth campaign with commentary in german || https://www.youtube.com/playlist?list=PLc3DmuDuA2imW1vg9xXMNjGHm8VaXvEaz&lt;br /&gt;
|-&lt;br /&gt;
|WSNPP || [[WSNPP|http://wiki.wesnoth.org/WSNPP]]&lt;br /&gt;
|-&lt;br /&gt;
|Run Wesnoth online (Windows) || http://spoon.net/the-battle-for-wesnoth&lt;br /&gt;
|-&lt;br /&gt;
!colspan=2 style='text-align:left'|&lt;br /&gt;
=== Multilingual Players' Sites ===&lt;br /&gt;
|-&lt;br /&gt;
|Community in China || http://wesnoth.cn/&lt;br /&gt;
|-&lt;br /&gt;
|Polish Community || https://www.wesnoth.com.pl/forum/index.php&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
[[Category:Wesnoth Wiki]]&lt;/div&gt;</summary>
		<author><name>Soliton</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.wesnoth.org/index.php?title=LuaAPI/wesnoth/interface&amp;diff=74423</id>
		<title>LuaAPI/wesnoth/interface</title>
		<link rel="alternate" type="text/html" href="https://wiki.wesnoth.org/index.php?title=LuaAPI/wesnoth/interface&amp;diff=74423"/>
		<updated>2025-07-03T16:13:29Z</updated>

		<summary type="html">&lt;p&gt;Soliton: /* wesnoth.interface.float_label */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;div class=&amp;quot;tright&amp;quot;&amp;gt; __TOC__ &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{DevFeature1.15|0}}&lt;br /&gt;
&lt;br /&gt;
The entire interface module is only available in the game. It is not available to plugins or map generators.&lt;br /&gt;
&lt;br /&gt;
== Interface functions ==&lt;br /&gt;
&lt;br /&gt;
=== wesnoth.interface.delay ===&lt;br /&gt;
&lt;br /&gt;
* {{LuaGameOnly}} '''wesnoth.interface.delay'''(''milliseconds'')&lt;br /&gt;
&lt;br /&gt;
Delays the engine for a period of time, specified in milliseconds.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=lua&amp;gt;&lt;br /&gt;
wesnoth.interface.delay(500)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== wesnoth.interface.deselect_hex ===&lt;br /&gt;
&lt;br /&gt;
* {{LuaGameOnly}} '''wesnoth.interface.deselect_hex'''()&lt;br /&gt;
&lt;br /&gt;
Reverses any highlight_hex call, leaving all locations unhighlighted. Takes no arguments.&lt;br /&gt;
&lt;br /&gt;
=== wesnoth.interface.highlight_hex ===&lt;br /&gt;
&lt;br /&gt;
* {{LuaGameOnly}} '''wesnoth.interface.highlight_hex'''(''x'', ''y'')&lt;br /&gt;
&lt;br /&gt;
Draws an outline around the specified hex.&lt;br /&gt;
&lt;br /&gt;
=== wesnoth.interface.select_unit ===&lt;br /&gt;
&lt;br /&gt;
* {{LuaGameOnly}} '''wesnoth.interface.select_unit'''(''x'', ''y'', [''show_movement'', [''fire_events'']])&lt;br /&gt;
* {{LuaGameOnly}} '''wesnoth.units.select'''(''unit'', [''show_movement'', [''fire_events'']])&lt;br /&gt;
* {{LuaGameOnly}} ''unit'':'''select'''([''show_movement'', [''fire_events'']])&lt;br /&gt;
&lt;br /&gt;
Selects the given unit in the game map as if the player had clicked on it.&lt;br /&gt;
Argument 3: boolean, whether to show the movement range of any unit on that location (def: true)&lt;br /&gt;
Argument 4: boolean, whether to fire any select events (def: false).&lt;br /&gt;
&lt;br /&gt;
This function is available under two different names, but the possible arguments are the same in both cases. In other words, '''wesnoth.units.select''' can be called with a location instead of a unit, and '''wesnoth.interface.select_unit''' can be called with a unit instead of a location.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=lua&amp;gt;&lt;br /&gt;
wesnoth.interface.select_unit(14, 6, true, true)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If called without arguments, this function deselects the current unit from the map as long as the mouse cursor is not on its hex. It will continue to be displayed on the UI sidebar in any case.&lt;br /&gt;
&lt;br /&gt;
=== wesnoth.interface.float_label ===&lt;br /&gt;
&lt;br /&gt;
* {{LuaGameOnly}} '''wesnoth.interface.float_label'''(''x'', ''y'', ''text'')&lt;br /&gt;
&lt;br /&gt;
Adds a floating label above a map tile. The text will float upwards at 100 pixels per second.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=lua&amp;gt;&lt;br /&gt;
wesnoth.interface.float_label(unit.x, unit.y, &amp;quot;&amp;lt;span color='#ff0000'&amp;gt;Ouch&amp;lt;/span&amp;gt;&amp;quot;)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== wesnoth.interface.get_displayed_unit ===&lt;br /&gt;
&lt;br /&gt;
* {{LuaGameOnly}} '''wesnoth.interface.get_displayed_unit'''() → ''unit''&lt;br /&gt;
* {{LuaGameOnly}} '''wesnoth.units.get_hovered'''() → ''unit''&lt;br /&gt;
&lt;br /&gt;
Returns a proxy to the unit currently displayed in the side pane of the user interface, if any.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=lua&amp;gt;&lt;br /&gt;
local name = tostring(wesnoth.interface.get_displayed_unit().name)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== wesnoth.interface.get_hovered_hex ===&lt;br /&gt;
&lt;br /&gt;
* {{LuaGameOnly}} '''wesnoth.interface.get_hovered_hex'''() → ''x'', ''y''&lt;br /&gt;
&lt;br /&gt;
Returns the two coordinates of the currently hovered tile, that is, where the mouse cursor is located. This is mostly useful for defining command-mode helpers.&lt;br /&gt;
&lt;br /&gt;
=== wesnoth.interface.get_selected_hex ===&lt;br /&gt;
&lt;br /&gt;
* {{LuaGameOnly}} '''wesnoth.interface.get_selected_hex'''() → ''x'', ''y''&lt;br /&gt;
&lt;br /&gt;
Returns the two coordinates of the currently selected (highlighted) tile. This is mostly useful for defining command-mode helpers.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=lua&amp;gt;&lt;br /&gt;
function chg_unit(attr, val)&lt;br /&gt;
   local x, y = wesnoth.interface.get_selected_hex()&lt;br /&gt;
   if not x then wesnoth.message(&amp;quot;Error&amp;quot;, &amp;quot;No unit selected.&amp;quot;); return end&lt;br /&gt;
   wesnoth.units.modify({ x = x, y = y }, { [attr] = val })&lt;br /&gt;
end&lt;br /&gt;
-- Function chg_unit can be used in command mode to modify unit attributes on the fly:&lt;br /&gt;
--   :lua chg_unit(&amp;quot;status.poisoned&amp;quot;, true)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== wesnoth.interface.get_viewing_side ===&lt;br /&gt;
&lt;br /&gt;
* {{LuaGameOnly}} '''wesnoth.interface.get_viewing_side'''() &amp;amp;rarr; ''side'', ''full_vision''&lt;br /&gt;
&lt;br /&gt;
Returns the viewing side of the current client in a multiplayer game.&lt;br /&gt;
&lt;br /&gt;
For a player participating in the game, this will always be the side that they control, or, if they control multiple sides, the one they most recently had control over. However, for an observer client, this will return the currently-active side instead.&lt;br /&gt;
&lt;br /&gt;
The second return value indicates whether the current client has full vision. This can only happen in replays or for observers.&lt;br /&gt;
&lt;br /&gt;
For obvious reasons, use of this function can easily cause out-of-sync errors. Use with care.&lt;br /&gt;
&lt;br /&gt;
=== wesnoth.interface.lock===&lt;br /&gt;
&lt;br /&gt;
* {{LuaGameOnly}} '''wesnoth.interface.lock'''(''lock'')&lt;br /&gt;
&lt;br /&gt;
Locks or unlocks gamemap view scrolling for human players. If true is passed as the first parameter, the view is locked; pass false to unlock.&lt;br /&gt;
&lt;br /&gt;
Human players cannot scroll the gamemap view as long as it is locked, but Lua or WML actions such as wesnoth.scroll_to_hex still can; the locked/unlocked state is preserved when saving the current game. This feature is generally intended to be used in cutscenes to prevent the player scrolling away from scripted actions.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=lua&amp;gt;&lt;br /&gt;
wesnoth.interface.lock_view(true)&lt;br /&gt;
wesnoth.interface.scroll_to_hex(12, 14, false, true)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== wesnoth.interface.is_locked ===&lt;br /&gt;
&lt;br /&gt;
* {{LuaGameOnly}} '''wesnoth.interface.is_locked'''() → ''locked?''&lt;br /&gt;
&lt;br /&gt;
Returns a boolean indicating whether gamemap view scrolling is currently locked.&lt;br /&gt;
&lt;br /&gt;
=== wesnoth.interface.scroll_to_hex ===&lt;br /&gt;
&lt;br /&gt;
* {{LuaGameOnly}} '''wesnoth.interface.scroll_to_hex'''(''x'', ''y'', [''only_if_visible'', [''instant'', [''only_if_needed'']]])&lt;br /&gt;
* {{LuaGameOnly}} '''wesnoth.units.scroll_to'''(''unit'', [''only_if_visible'', [''instant'', [''only_if_needed'']]])&lt;br /&gt;
* {{LuaGameOnly}} ''unit'':'''scroll_to'''([''only_if_visible'', [''instant'', [''only_if_needed'']]])&lt;br /&gt;
&lt;br /&gt;
Scrolls the map to the given location. If true is passed as the third parameter, scrolling is disabled if the tile is hidden under the fog. If true is passed as the fourth parameter, the view instantly warps to the location regardless of the scroll speed setting in Preferences. If true is passed as the fifth parameter, no scrolling occurs if the target location is already visible onscreen. It is also possible to pass a unit instead of a pair of tile coordinates (regardless of which module the function is called from).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=lua&amp;gt;&lt;br /&gt;
local u = wesnoth.units.get &amp;quot;hero&amp;quot;&lt;br /&gt;
u:scroll_to()&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== wesnoth.interface.scroll ===&lt;br /&gt;
&lt;br /&gt;
* {{LuaGameOnly}} '''wesnoth.interface.scroll'''(''dx'', ''dy'')&lt;br /&gt;
&lt;br /&gt;
Scrolls the map by the given amount, which may be either positive or negative.&lt;br /&gt;
&lt;br /&gt;
=== wesnoth.interface.zoom ===&lt;br /&gt;
&lt;br /&gt;
* {{LuaGameOnly}} '''wesnoth.interface.zoom'''(''factor'', [''relative'']) → ''new_zoom''&lt;br /&gt;
&lt;br /&gt;
Changes the zoom level of the map. If relative is false, which is the default, it simply sets the zoom level. If relative is true, it zooms relative to the current zoom level. So, for example, if the zoom level is currently 0.5, then&lt;br /&gt;
&amp;lt;syntaxhighlight lang=lua inline&amp;gt;wesnoth.zoom(2)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
sets it to 2, while&lt;br /&gt;
&amp;lt;syntaxhighlight lang=lua inline&amp;gt;wesnoth.zoom(2, true)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
sets it to 1 (2 * 0.5).&lt;br /&gt;
&lt;br /&gt;
This function also returns the resulting zoom level. Because of this, you can call&lt;br /&gt;
&amp;lt;syntaxhighlight lang=lua inline&amp;gt;wesnoth.zoom(1, true)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
to simply get the current zoom level.&lt;br /&gt;
&lt;br /&gt;
Note that this function cannot zoom to a level that the user would not be able to reach from the UI. Attempting to do so will simply select the nearest allowed zoom level.&lt;br /&gt;
&lt;br /&gt;
=== wesnoth.interface.skip_messages ===&lt;br /&gt;
&lt;br /&gt;
* {{LuaGameOnly}} '''wesnoth.interface.skip_messages'''([''skip?''])&lt;br /&gt;
&lt;br /&gt;
Sets the skip messages flag. By default it sets it to true, but you can also pass false to unset the flag.&lt;br /&gt;
&lt;br /&gt;
=== wesnoth.interface.is_skipping_messages ===&lt;br /&gt;
&lt;br /&gt;
* {{LuaGameOnly}} '''wesnoth.interface.is_skipping_messages'''()&lt;br /&gt;
&lt;br /&gt;
Returns true if messages are currently being skipped, for example because the player has chosen to skip replay, or has pressed escape to dismiss a message.&lt;br /&gt;
&lt;br /&gt;
=== wesnoth.interface.add_chat_message ===&lt;br /&gt;
&lt;br /&gt;
* {{LuaGameOnly}} '''wesnoth.interface.add_chat_message'''([''speaker'',] ''message'')&lt;br /&gt;
&lt;br /&gt;
Displays a string in the onscreen chat. The chat line speaker is &amp;quot;Lua&amp;quot; by default, but it can be changed by passing a string before the message.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=lua&amp;gt;&lt;br /&gt;
wesnoth.interface.add_chat_message &amp;quot;Hello World!&amp;quot; -- will result in &amp;quot;&amp;lt;Lua&amp;gt; Hello World!&amp;quot;&lt;br /&gt;
wesnoth.interface.add_chat_message(&amp;quot;Big Brother&amp;quot;, &amp;quot;I'm watching you.&amp;quot;) -- will result in &amp;quot;&amp;lt;Big Brother&amp;gt; I'm watching you.&amp;quot;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
See also [[LuaAPI/wml#wml.error|wml.error]] for displaying error messages.&lt;br /&gt;
&lt;br /&gt;
=== wesnoth.interface.clear_chat_messages ===&lt;br /&gt;
&lt;br /&gt;
* {{LuaGameOnly}} '''wesnoth.interface.clear_chat_messages'''()&lt;br /&gt;
&lt;br /&gt;
Removes all messages from the onscreen chat, including error messages.&lt;br /&gt;
&lt;br /&gt;
=== wesnoth.interface.add_item_image ===&lt;br /&gt;
&lt;br /&gt;
* {{LuaGameOnly}} '''wesnoth.interface.add_item_image'''(''location'', ''filename'')&lt;br /&gt;
&lt;br /&gt;
Places an image at a given location and registers it as a WML ''[item]'' would do, so that it can be restored after save/load. Note that the location must be passed as separate x and y coordinates, as in the example.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=lua&amp;gt;&lt;br /&gt;
wesnoth.interface.add_item_image(17, 42, &amp;quot;items/orcish-flag.png&amp;quot;)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== wesnoth.interface.add_item_halo ===&lt;br /&gt;
&lt;br /&gt;
* {{LuaGameOnly}} '''wesnoth.interface.add_item_halo'''(''location'', ''filename'')&lt;br /&gt;
&lt;br /&gt;
Behaves the same as [[#wesnoth.interface.add_item_image]] but for halos.&lt;br /&gt;
&lt;br /&gt;
=== wesnoth.interface.remove_item ===&lt;br /&gt;
&lt;br /&gt;
* {{LuaGameOnly}} '''wesnoth.interface.remove_item'''(''location'', [''filename''])&lt;br /&gt;
&lt;br /&gt;
Removes an overlay set by [[#wesnoth.interface.add_item_image]] or [[#wesnoth.interface.add_item_halo]]. If no filename is provided, all the overlays on a given tile are removed. Note that the location must be passed as separate x and y coordinates, as in the example.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=lua&amp;gt;&lt;br /&gt;
wesnoth.interface.remove_item(17, 42, &amp;quot;items/orcish-flag.png&amp;quot;)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== wesnoth.interface.get_items ===&lt;br /&gt;
&lt;br /&gt;
* {{LuaGameOnly}} '''wesnoth.interface.get_items'''(''location'') &amp;amp;rarr; ''array of item tables''&lt;br /&gt;
&lt;br /&gt;
Get all items placed on the specified location. Note that the location must be passed as separate x and y coordinates.&lt;br /&gt;
&lt;br /&gt;
=== wesnoth.interface.add_hex_overlay ===&lt;br /&gt;
&lt;br /&gt;
* {{LuaGameOnly}} '''wesnoth.interface.add_hex_overlay'''(''location'', ''item_wml'')&lt;br /&gt;
&lt;br /&gt;
Places a hex overlay (either an image or a halo) on the given location. The overlay is described by a table supporting the same fields as [[InterfaceActionsWML|[item]]]. This is a lower-level version of the item functions above. Note that the overlay is not kept over save/load cycles.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=lua&amp;gt;&lt;br /&gt;
wesnoth.interface.add_hex_overlay(17, 42, { image = &amp;quot;items/orcish-flag.png&amp;quot; })&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== wesnoth.interface.remove_hex_overlay ===&lt;br /&gt;
&lt;br /&gt;
* {{LuaGameOnly}} '''wesnoth.interface.remove_hex_overlay'''(''location'', [''filename''])&lt;br /&gt;
&lt;br /&gt;
Removes all the overlays at the given location, including any added by '''wesnoth.interface.add_item_halo''' or '''wesnoth.interface.add_item_image''' (however, such a removal will not be kept over save/load cycles). If a filename is passed as a third argument, only this overlay (either image or halo) is removed.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=lua&amp;gt;&lt;br /&gt;
wesnoth.interface.remove_hex_overlay(17, 42, &amp;quot;items/orcish-flag.png&amp;quot;)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== wesnoth.interface.end_turn ===&lt;br /&gt;
&lt;br /&gt;
* {{LuaGameOnly}} '''wesnoth.interface.end_turn'''([''next_side''])&lt;br /&gt;
&lt;br /&gt;
Immediately ends the current side's turn. By default, the next sequential side will gain control, but if you pass an argument that side gains control instead.&lt;br /&gt;
&lt;br /&gt;
The ''next_side'' can either be a valid side number, or a valid side number plus the total number of sides in the scenario. In the latter case, this function also increases the turn counter by 1.&lt;br /&gt;
&lt;br /&gt;
Using this, it's entirely possible to pass control around without ever increasing the turn counter.&lt;br /&gt;
&lt;br /&gt;
=== wesnoth.interface.allow_end_turn ===&lt;br /&gt;
&lt;br /&gt;
* {{LuaGameOnly}} '''wesnoth.interface.allow_end_turn'''(''allow'')&lt;br /&gt;
* {{LuaGameOnly}} '''wesnoth.interface.allow_end_turn'''(''reason'')&lt;br /&gt;
&lt;br /&gt;
Enables or disables ending the turn in the UI. You can optionally pass a translatable string to show to the player if they attempt to do so anyway. It will be shown to the player without any additional framing, so it should normally be phrased similar to &amp;quot;You cannot end your turn because...&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
To allow the player to end their turn again, just pass '''true'''. If you pass '''false''', a default message will be shown.&lt;br /&gt;
&lt;br /&gt;
=== wesnoth.interface.color_adjust ===&lt;br /&gt;
&lt;br /&gt;
* {{LuaGameOnly}} '''wesnoth.interface.color_adjust'''(''red'', ''green'', ''blue'')&lt;br /&gt;
&lt;br /&gt;
Adjust the screen tint. (0,0,0) is no tint, and possible values range from -255 to 255.&lt;br /&gt;
&lt;br /&gt;
=== wesnoth.interface.add_overlay_text ===&lt;br /&gt;
&lt;br /&gt;
{{DevFeature1.17|3}}&lt;br /&gt;
&lt;br /&gt;
* {{LuaGameOnly}} '''wesnoth.interface.add_overlay_text'''(''text'' [, ''options'']) &amp;amp;rarr; ''text handle''&lt;br /&gt;
&lt;br /&gt;
Adds a text overlay to the screen that does not move with the map. [[Pango formatting]] is supported. The ''options'' table supports the following keys:&lt;br /&gt;
&lt;br /&gt;
* ''size'' - The font size.&lt;br /&gt;
* ''max_width'' - Sets the maximum width the text can occupy on the screen, either in screen units (pixels) or as a percentage (a string ending in &amp;lt;tt&amp;gt;%&amp;lt;/tt&amp;gt;). If the text is too long to fit in that width, it will automatically be word-wrapped. Defaults to 100%.&lt;br /&gt;
* ''color'' - The text color, either as a six-digit hex string (no leading &amp;lt;tt&amp;gt;#&amp;lt;/tt&amp;gt;) or an array of three integers (red, green, and blue).&lt;br /&gt;
* ''bgcolor'' - If present, a background in this color is placed behind the text to enhance readability. This works like the background behind chat messages, but can be any colour. It is formatted the same as ''color''. If omitted, the background is fully transparent (ie, there is no background).&lt;br /&gt;
* ''bgalpha'' - If a background colour is specified, this sets its transparency. The default is fully opaque.&lt;br /&gt;
* ''duration'' - How long the text should be displayed, in milliseconds, or the string &amp;lt;syntaxhighlight lang=lua inline&amp;gt;'unlimited'&amp;lt;/syntaxhighlight&amp;gt; for an infinite duration. Defaults to two seconds.&lt;br /&gt;
* ''fade_time'' - When the label is removed, either explicitly or because its duration expired, this is the time it takes to fade out, in milliseconds. A value of 0 means the label disappears instantly. Defaults to 100.&lt;br /&gt;
* ''halign'' - Where to anchor the text horizontally on the screen. Must be one of &amp;lt;syntaxhighlight lang=lua inline&amp;gt;'left', 'center', 'right'&amp;lt;/syntaxhighlight&amp;gt;.&lt;br /&gt;
* ''valign'' - Where to anchor the text vertically on the screen. Must be one of &amp;lt;syntaxhighlight lang=lua inline&amp;gt;'top', 'center', 'bottom'&amp;lt;/syntaxhighlight&amp;gt;.&lt;br /&gt;
* ''location'' - The screen offset where the text should be placed, relative to the specified anchor. Defaults to (0,0).&lt;br /&gt;
&lt;br /&gt;
The text handle returned from this function supports the following method calls:&lt;br /&gt;
&lt;br /&gt;
* ''handle'':'''move'''(''x'', ''y'')&lt;br /&gt;
&lt;br /&gt;
Moves the text to a new location on the screen. The provided ''x'' and ''y'' are offsets from its current location.&lt;br /&gt;
&lt;br /&gt;
* ''handle'':'''remove'''([''fade_time''])&lt;br /&gt;
&lt;br /&gt;
Remove the text from the screen, optionally overriding the fade-out time.&lt;br /&gt;
&lt;br /&gt;
* ''handle'':'''replace'''(''text'', ''options'') &amp;amp;rarr; ''handle''&lt;br /&gt;
&lt;br /&gt;
Replaces the text with new text. Options are the same as in ''add_overlay_text'', and the returned handle is the same one.&lt;br /&gt;
&lt;br /&gt;
=== wesnoth.interface.handle_user_interact ===&lt;br /&gt;
&lt;br /&gt;
{{DevFeature1.17|6}}&lt;br /&gt;
&lt;br /&gt;
* {{LuaGameOnly}} '''wesnoth.interface.handle_user_interact'''()&lt;br /&gt;
&lt;br /&gt;
Handle user interaction with the game interface. This can be inserted into Lua code that takes a long time to execute in order to prevent the user interface from freezing.&lt;br /&gt;
&lt;br /&gt;
== wesnoth.interface.game_display ==&lt;br /&gt;
&lt;br /&gt;
* {{LuaGameOnly}} '''wesnoth.interface.game_display'''.''theme_item'' &amp;amp;harr; '''function'''() &amp;amp;rarr; ''wml table of theme elements''&lt;br /&gt;
&lt;br /&gt;
This is an associative table linking item names to functions that describe the content of the in-game user interface. These functions are called with no arguments whenever the user interface is refreshed, and must return a WML table containing '''[element]''' children. Each subtag shall contain either a '''text''' or an '''image''' field that is displayed to the user. It can also contain a '''tooltip''' field that is displayed to the user when moused over, and a '''help''' field that points to the help section that is displayed when the user clicks on the theme item.&lt;br /&gt;
&lt;br /&gt;
Note that the '''wesnoth.interface.game_display''' cannot be iterated using '''pairs''' or '''next''' to retrieve the items from the current theme. However, built-in items ''can'' be recovered as long as their name is known. The example below shows how to modify the ''unit_status'' item to display a custom status:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=lua&amp;gt;&lt;br /&gt;
local old_unit_status = wesnoth.interface.game_display.unit_status&lt;br /&gt;
function wesnoth.interface.game_display.unit_status()&lt;br /&gt;
    local _ = wesnoth.textdomain &amp;quot;mydomain&amp;quot;&lt;br /&gt;
    local u = wesnoth.interface.get_displayed_unit()&lt;br /&gt;
    if not u then return {} end&lt;br /&gt;
    local s = old_unit_status()&lt;br /&gt;
    if u.status.entangled then&lt;br /&gt;
        table.insert(s, wml.tag.element {&lt;br /&gt;
            image = &amp;quot;entangled.png&amp;quot;,&lt;br /&gt;
            tooltip = _&amp;quot;entangled: This unit is entangled. It cannot move but it can still attack.&amp;quot;&lt;br /&gt;
        })&lt;br /&gt;
    end&lt;br /&gt;
    return s&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The things that would need to be to modified in the above code are:&lt;br /&gt;
&lt;br /&gt;
* the domain of your addon (&amp;quot;mydomain&amp;quot;), assuming that you are using translations. Otherwise just remove the underscore in the tooltip line.&lt;br /&gt;
* the name of the status (u.status.entangled). Note that if the attribute happens to be inside [variables], so be it: u.variables.whatever.&lt;br /&gt;
* the path to the image (&amp;quot;entangled.png&amp;quot;).&lt;br /&gt;
* the tooltip of the status (&amp;quot;entangled: This unit ...&amp;quot;).&lt;br /&gt;
&lt;br /&gt;
The following is a list of valid entries in '''wesnoth.interface.game_display''' which will have an effect in the game, together with sample output and a brief description of their use.&lt;br /&gt;
&lt;br /&gt;
=== unit_name ===&lt;br /&gt;
&lt;br /&gt;
Shows the name of the unit the mouse is hovering over.&lt;br /&gt;
&lt;br /&gt;
=== unit_type ===&lt;br /&gt;
&lt;br /&gt;
Shows the type of the unit the mouse is hovering over.&lt;br /&gt;
&lt;br /&gt;
=== unit_race ===&lt;br /&gt;
&lt;br /&gt;
Shows the race of the unit the mouse is hovering over.&lt;br /&gt;
&lt;br /&gt;
=== unit_side ===&lt;br /&gt;
&lt;br /&gt;
Shows the side number and team color of the unit the mouse is hovering over.&lt;br /&gt;
&lt;br /&gt;
=== unit_level ===&lt;br /&gt;
&lt;br /&gt;
Shows the level of the unit the mouse is hovering over.&lt;br /&gt;
&lt;br /&gt;
=== unit_amla ===&lt;br /&gt;
&lt;br /&gt;
Similar to unit_advancement_options but shows AMLAs only.&lt;br /&gt;
&lt;br /&gt;
=== unit_traits ===&lt;br /&gt;
&lt;br /&gt;
Shows the list of trait names for the unit the mouse is hovering over.&lt;br /&gt;
&lt;br /&gt;
=== unit_status ===&lt;br /&gt;
&lt;br /&gt;
Shows the status icons for statuses afflicting the unit the mouse is hovering over.&lt;br /&gt;
&lt;br /&gt;
=== unit_alignment ===&lt;br /&gt;
&lt;br /&gt;
Shows the alignment of the unit the mouse is hovering over.&lt;br /&gt;
&lt;br /&gt;
=== unit_abilities ===&lt;br /&gt;
&lt;br /&gt;
Shows the ability names of the unit the mouse is hovering over.&lt;br /&gt;
&lt;br /&gt;
=== unit_hp ===&lt;br /&gt;
&lt;br /&gt;
Shows the current and maximum hit points of the unit the mouse is hovering over.&lt;br /&gt;
&lt;br /&gt;
=== unit_xp ===&lt;br /&gt;
&lt;br /&gt;
Shows the current and target experience points of the unit the mouse is hovering over.&lt;br /&gt;
&lt;br /&gt;
=== unit_advancement_options ===&lt;br /&gt;
&lt;br /&gt;
Shows the options the unit the mouse is hovering over has for advancement, including both level ups and AMLAs. This item is not used in the default theme.&lt;br /&gt;
&lt;br /&gt;
=== unit_defense ===&lt;br /&gt;
&lt;br /&gt;
Shows the defense of the unit the mouse is hovering over.&lt;br /&gt;
&lt;br /&gt;
=== unit_vision ===&lt;br /&gt;
&lt;br /&gt;
Shows the current and maximum vision points of the unit the mouse is hovering over.&lt;br /&gt;
&lt;br /&gt;
=== unit_moves ===&lt;br /&gt;
&lt;br /&gt;
Shows the current and maximum movement points of the unit the mouse is hovering over.&lt;br /&gt;
&lt;br /&gt;
=== unit_weapons ===&lt;br /&gt;
&lt;br /&gt;
Shows the available weapons of the unit the mouse is hovering over. The default generator expresses each weapon line (basic details, specials, etc) as a separate &amp;lt;code&amp;gt;element&amp;lt;/code&amp;gt;. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=wml&amp;gt;&lt;br /&gt;
[element]&lt;br /&gt;
  image=&amp;quot;melee.png&amp;quot;&lt;br /&gt;
  tooltip=&amp;quot;...stuff...&amp;quot;&lt;br /&gt;
[/element]&lt;br /&gt;
[element]&lt;br /&gt;
  image=&amp;quot;arcane.png&amp;quot;&lt;br /&gt;
  tooltip=&amp;quot;...stuff...&amp;quot;&lt;br /&gt;
[/element]&lt;br /&gt;
[element]&lt;br /&gt;
  text=&amp;quot;6×3 holy sword&amp;quot;&lt;br /&gt;
  tooltip=&amp;quot;...stuff...&amp;quot;&lt;br /&gt;
[/element]&lt;br /&gt;
[element]&lt;br /&gt;
  # This is empty if the range and type icons both exist.&lt;br /&gt;
  text=&amp;quot;melee-arcane&amp;quot;&lt;br /&gt;
  tooltip=&amp;quot;...stuff...&amp;quot;&lt;br /&gt;
[/element]&lt;br /&gt;
# If the weapon has accuracy or parry...&lt;br /&gt;
[element]&lt;br /&gt;
  text=&amp;quot;+20%/-10%&amp;quot;&lt;br /&gt;
  tooltip=&amp;quot;Accuracy: +20%&lt;br /&gt;
Parry: -10%&lt;br /&gt;
&amp;quot;&lt;br /&gt;
[/element]&lt;br /&gt;
# If the weapon has special abilities...&lt;br /&gt;
[element]&lt;br /&gt;
  text=&amp;quot;magical&amp;quot;&lt;br /&gt;
  tooltip=&amp;quot;...stuff...&amp;quot;&lt;br /&gt;
[/element]&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== unit_image ===&lt;br /&gt;
&lt;br /&gt;
Shows the sprite of the unit the mouse is hovering over.&lt;br /&gt;
&lt;br /&gt;
=== unit_profile ===&lt;br /&gt;
&lt;br /&gt;
Shows the portrait of the unit the mouse is hovering over.&lt;br /&gt;
&lt;br /&gt;
=== selected_unit ===&lt;br /&gt;
&lt;br /&gt;
Nearly every item beginning with '''unit_''' has a corresponding item beginning with '''selected_unit_''', which describes the currently-selected unit (if any) rather than the unit the mouse is hovering over. These items are not used in the default theme.&lt;br /&gt;
&lt;br /&gt;
There is no '''selected_unit_amla''' however.&lt;br /&gt;
&lt;br /&gt;
=== highlighted_unit_weapons ===&lt;br /&gt;
&lt;br /&gt;
This is almost the same as '''selected_unit_weapons''' but with slightly different logic of choosing which unit to show.&lt;br /&gt;
&lt;br /&gt;
=== tod_stats and selected_tod_stats ===&lt;br /&gt;
&lt;br /&gt;
Shows the time of day stats for the hex the mouse is hovering over or the hex the selected unit is on. The time of day stats shows the counter of your position in the schedule as well as the entire cycle.&lt;br /&gt;
&lt;br /&gt;
=== time_of_day and selected_time_of_day ===&lt;br /&gt;
&lt;br /&gt;
Shows the time of day image for the hex the mouse is hovering over or the hex the selected unit is on.&lt;br /&gt;
&lt;br /&gt;
=== unit_box ===&lt;br /&gt;
&lt;br /&gt;
This is an experimental item that combines a unit display and the time of day.&lt;br /&gt;
&lt;br /&gt;
=== turn ===&lt;br /&gt;
&lt;br /&gt;
Shows the current turn count.&lt;br /&gt;
&lt;br /&gt;
=== gold ===&lt;br /&gt;
&lt;br /&gt;
Shows the amount of gold for the active side.&lt;br /&gt;
&lt;br /&gt;
=== villages ===&lt;br /&gt;
&lt;br /&gt;
Shows the number of villages owned by the active side.&lt;br /&gt;
&lt;br /&gt;
=== num_units ===&lt;br /&gt;
&lt;br /&gt;
Shows the number of units owned by the active side.&lt;br /&gt;
&lt;br /&gt;
=== upkeep ===&lt;br /&gt;
&lt;br /&gt;
Shows the upkeep and expenses for the active side.&lt;br /&gt;
&lt;br /&gt;
=== income ===&lt;br /&gt;
&lt;br /&gt;
Shows the income for the active side&lt;br /&gt;
&lt;br /&gt;
=== terrain_info ===&lt;br /&gt;
&lt;br /&gt;
Shows the icons of the terrain on hex the mouse is hovering over.&lt;br /&gt;
&lt;br /&gt;
=== terrain &amp;lt;!--and selected_terrain--&amp;gt; ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- selected_terrain commented out here because at time of last edit it was commented out in the source code --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Shows the name of the terrain on the hex the mouse is hovering over&amp;lt;!-- or the hex the selected unit is on--&amp;gt;. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=wml&amp;gt;&lt;br /&gt;
[element]&lt;br /&gt;
  text=&amp;quot;Grassland (Flat)&amp;quot;&lt;br /&gt;
[/element]&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== position ===&lt;br /&gt;
&lt;br /&gt;
Shows the map coordinates of the hex the mouse is hovering over.&lt;br /&gt;
&lt;br /&gt;
=== zoom_level ===&lt;br /&gt;
&lt;br /&gt;
Shows the zoom level as a percentage. This item is not used in the default theme.&lt;br /&gt;
&lt;br /&gt;
=== side_playing ===&lt;br /&gt;
&lt;br /&gt;
Shows the active side's flag.&lt;br /&gt;
&lt;br /&gt;
=== observers ===&lt;br /&gt;
&lt;br /&gt;
When there is no observer, it returns an empty table. When there are observers, it returns:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=wml&amp;gt;&lt;br /&gt;
[element]&lt;br /&gt;
  tooltip=&amp;quot;Observers&lt;br /&gt;
&amp;lt;observer1&amp;gt;&lt;br /&gt;
&amp;lt;observer2&amp;gt;&lt;br /&gt;
&amp;quot;&lt;br /&gt;
  image=&amp;quot;misc/eye.png&amp;quot;&lt;br /&gt;
[/element]&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== report_clock ===&lt;br /&gt;
&lt;br /&gt;
This returns the current time in HH:MM format according to the user's preferences, for example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=wml&amp;gt;&lt;br /&gt;
[element]&lt;br /&gt;
  text=&amp;quot;22:32&amp;quot;&lt;br /&gt;
[/element]&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== report_countdown ===&lt;br /&gt;
&lt;br /&gt;
This returns the current chess-timer countdown in MM:SS format for the player's turn, for example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=wml&amp;gt;&lt;br /&gt;
[element]&lt;br /&gt;
  text=&amp;quot;12:43&amp;quot;&lt;br /&gt;
[/element]&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Depending on the time limit, the text may also be colored using [[Pango formatting|Pango markup]].&lt;br /&gt;
&lt;br /&gt;
If there is no time limit set then it forwards to [[#wesnoth.interface.game_display.report_clock|report_clock]].&lt;br /&gt;
&lt;br /&gt;
[[Category:Lua Reference]]&lt;/div&gt;</summary>
		<author><name>Soliton</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.wesnoth.org/index.php?title=InterfaceActionsWML&amp;diff=74420</id>
		<title>InterfaceActionsWML</title>
		<link rel="alternate" type="text/html" href="https://wiki.wesnoth.org/index.php?title=InterfaceActionsWML&amp;diff=74420"/>
		<updated>2025-07-02T12:10:08Z</updated>

		<summary type="html">&lt;p&gt;Soliton: /* [item] */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{WML Tags}}&lt;br /&gt;
== Interface actions ==&lt;br /&gt;
&lt;br /&gt;
Part of [[ActionWML]], interface actions are actions that do not have a direct effect on gameplay;&lt;br /&gt;
instead, they show something to the player.  The main interface tags&lt;br /&gt;
are '''[message]''' and '''[objectives]''', but several other tags affect&lt;br /&gt;
the interface also.&lt;br /&gt;
&lt;br /&gt;
== [inspect] ==&lt;br /&gt;
This user interface instantly displays the gamestate inspector dialog at the current scenario state (the same one that can be brought up with [[CommandMode|the ''':inspect''' command]]), which can be used to inspect the values of WML variables, AI configuration, recall lists, and more.&lt;br /&gt;
&lt;br /&gt;
* '''name''': optional attribute to specify the name of this gamestate inspector dialog. It is just a label to help differentiate between different invocations of gamestate inspector dialog.&lt;br /&gt;
&lt;br /&gt;
== [message] ==&lt;br /&gt;
The most commonly used interface action is [message], which displays a message to the user in a dialog box. It can also be used to take input from the user.&lt;br /&gt;
&lt;br /&gt;
The following key/tags are accepted for [message]:&lt;br /&gt;
* [[StandardUnitFilter]]: The unit whose profile and name are displayed. Do not use a [filter] tag. If no unit matching this filter is found, the message is not displayed (The unit has probably been killed).&amp;lt;br&amp;gt;[message] elements should be constructed so that it is either guaranteed that a certain unit is alive, or so that dialog flows smoothly even if the message isn't displayed.&lt;br /&gt;
&lt;br /&gt;
* '''speaker''': an alternative to standard unit filter. You may specify as the value of the speaker attribute a unit id or any of the following special values:&lt;br /&gt;
** '''narrator''': the dialog box is displayed without a caption for the unit speaking or a unit image&lt;br /&gt;
** '''unit''': the primary unit for the event is speaking&lt;br /&gt;
** '''second_unit''': the secondary unit for the event is speaking&lt;br /&gt;
&lt;br /&gt;
* '''message''': (translatable) the text to display to the right of the image. ''message'' is sometimes multiple lines; if it is, be sure to use quotes(''' ' ''' or ''' &amp;quot; ''')&lt;br /&gt;
* '''male_message''', '''female_message''': {{DevFeature1.13|2}} (translatable) Used instead of ''message'' if the unit's gender matches. Never used if there is no unit (ie ''speaker=narrator''). {{DevFeature1.13|6}} This matches the primary unit, not the secondary unit.&lt;br /&gt;
* '''wait_description''': {{DevFeature1.13|2}} the description of this message displayed when other players in a mp game wait for one player doing input in a [message] (with [option]s or [text_input]).&lt;br /&gt;
* '''[show_if]''': if present then this message will only be displayed if the conditional statement in this tag is passed (see [[ConditionalActionsWML#Condition_Tags|ConditionalActionsWML]])&lt;br /&gt;
* '''side_for''': (default: all sides) comma-separated list of sides for who message is shown. This will &amp;lt;b&amp;gt;not&amp;lt;/b&amp;gt; work with messages that take user input ([option]/[text_input]), which can only ever be shown to the current player. {{DevFeature1.13|0}} side_for= is now also accepted for messages with user input, it specifies on which side the message is shown (defaults to the currently playing side). For messages with input it does not accept a comma seperated list only a single number.&lt;br /&gt;
* '''image''': (default: profile image of speaker) the image to display to the left of the message text. Append ~RIGHT() if you want the image to appear on the right side. &lt;br /&gt;
** {{DevFeature1.13|0}} &amp;lt;b&amp;gt;none:&amp;lt;/b&amp;gt; display no image&lt;br /&gt;
* '''mirror''': {{DevFeature1.13|5}} whether to mirror the image specified by the '''image''' attribute.&lt;br /&gt;
* '''second_image''': {{DevFeature1.13|6}} same as the '''image''' attribute, but the image is displayed on the right of the message text. {{DevFeature1.17|7}} not working anymore, but there is plan to fix it eventually https://github.com/wesnoth/wesnoth/issues/8770&lt;br /&gt;
* '''second_mirror''': {{DevFeature1.13|6}} same as '''mirror''', but for the '''second_image''' attribute.&lt;br /&gt;
* '''image_pos''': {{DevFeature1.13|5}} whether to show the image on the left or right; supercedes the use of ~RIGHT() described above&lt;br /&gt;
* '''caption''': (default: name of speaker) the caption to display beside the image. Name to be displayed. Note: use a translation mark to avoid wmllint errors.&lt;br /&gt;
* '''scroll''': Boolean specifying whether the game view should scroll to the speaking unit. Defaults to ''yes''.&lt;br /&gt;
* '''highlight''': {{DevFeature1.13|5}} Boolean specifying whether to highlight the speaker. Defaults to ''yes''.&lt;br /&gt;
* '''sound''': a sound effect (wav file) to play as the message is displayed. This can be a comma-separated list, from which one will be randomly chosen.&lt;br /&gt;
* '''voice''', '''male_voice''', '''female_voice''': {{DevFeature1.13|?}} a sound to be played as the message is displayed. This can also be a comma-separated list, from which one will be randomly chosen. This is intended for voiceovers for the message. The gendered forms are applied the same as for '''message'''. They are never used when the speaker is the narrator - only '''voice''' is used in that case.&lt;br /&gt;
* {{anchor|message-option|'''[option]'''}}: No '''[option]''' elements have to be used. If '''[option]''' elements are present, then each option will be displayed in a menu for the user to select one option. ''Note: Messages with options will not be shown at all in prestart events''&lt;br /&gt;
** '''message''': (translatable) the text displayed for the option. {{DevFeature1.15|1}} This is now a synonym for '''description='''.&lt;br /&gt;
** '''image''', '''label''', '''description''', '''default''': See [[DescriptionWML#WML_Format|DescriptionWML]].&lt;br /&gt;
** '''value''': {{DevFeature1.13|?}} Gives the option a value to be stored in a variable.&lt;br /&gt;
** '''[show_if]''': if present then this option will only be displayed if the conditional statement in this tag is passed (see [[ConditionalActionsWML#Condition_Tags|ConditionalActionsWML]])&lt;br /&gt;
** '''[command]''': an element containing actions which are executed if the option is selected.&lt;br /&gt;
* '''variable''': {{DevFeature1.13|?}} If present, either the index or the value of the chosen option will be stored in the specified variable. Option indexing starts from 1. If option has '''[show_if]''' condition evaluated as false, then it is hidden and excluded from the indexing.&lt;br /&gt;
* {{anchor|message-text_input|'''[text_input]'''}}: there can be only one [text_input] tag. this adds a text input field to the message. ''Note: Messages with text_input will not be shown at all in prestart events''&lt;br /&gt;
** '''variable''': the variable that the user's input will be written to&lt;br /&gt;
** '''label''': a text label to the left of the input field&lt;br /&gt;
** '''max_length''': the maximum number of characters that may be typed into the field&lt;br /&gt;
** '''text''': text that is written into the field in the beginning&lt;br /&gt;
* Check [[EventWML#Multiplayer_safety]] to find out in which events you can safely use '''[option]''' and '''[text_input]''' without causing OOS.&lt;br /&gt;
&lt;br /&gt;
=== Formatting ===&lt;br /&gt;
'''[message]''' and other tags such as unit names (user_description), objectives, and floating text can make use of [https://docs.gtk.org/Pango/pango_markup.html#pango-markup Pango markup formatting codes].&lt;br /&gt;
&lt;br /&gt;
Prefer to use single quotes (') instead of double quotes (&amp;quot;) within the formatting string, as double quotes would need to be escaped in WML (&amp;quot;&amp;quot;). Escaping markup can be done with [https://github.com/wesnoth/wesnoth/blob/9daa10a9f27c5a95520e871417bbd72aa52aa688/src/font/pango/escape.hpp#L38-L42 HTML entities].&lt;br /&gt;
&lt;br /&gt;
For example, if you wanted to write &amp;quot;You are victorious!&amp;quot; in large, italic, gold letters, you might write it this way:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&amp;lt;span color='#BCB088' size='large' font-style='italic'&amp;gt;You are victorious!&amp;lt;/span&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
These are the codes taken from the Pango markup formatting guide:&lt;br /&gt;
&lt;br /&gt;
*'''font''', '''font_desc''': A font description string, such as &amp;quot;Sans Italic 12&amp;quot;.&lt;br /&gt;
*'''font_family''', '''face''': A font family name.&lt;br /&gt;
*'''font_size''', '''size''': Font size in 1024ths of a point, or one of the absolute sizes 'xx-small', 'x-small', 'small', 'medium', 'large', 'x-large', 'xx-large', or one of the relative sizes 'smaller' or 'larger'.&lt;br /&gt;
*'''font_style''', '''style''': One of 'normal', 'oblique', 'italic'.&lt;br /&gt;
*'''font_weight''', '''weight''': One of 'ultralight', 'light', 'normal', 'bold', 'ultrabold', 'heavy', or a numeric weight.&lt;br /&gt;
*'''font_variant''', '''variant''': One of 'normal' or 'smallcaps'.&lt;br /&gt;
*'''font_stretch''', '''stretch''': One of 'ultracondensed', 'extracondensed', 'condensed', 'semicondensed', 'normal', 'semiexpanded', 'expanded', 'extraexpanded', 'ultraexpanded'.&lt;br /&gt;
*'''foreground''', '''fgcolor''', '''color''': An RGB color specification such as '#00FF00' or a color name such as 'red'. The full list of color names may be found in Pango's [https://github.com/GNOME/pango/blob/main/tools/rgb.txt rgb.txt] file.&lt;br /&gt;
*'''background, bgcolor''': An RGB color specification such as '#00FF00' or a color name such as 'red'.&lt;br /&gt;
*'''underline''': One of 'none', 'single', 'double', 'low', 'error'.&lt;br /&gt;
*'''underline_color''': The color of underlines; an RGB color specification such as '#00FF00' or a color name such as 'red'.&lt;br /&gt;
*'''rise''': Vertical displacement, in 10000ths of an em. Can be negative for subscript, positive for superscript.&lt;br /&gt;
*'''strikethrough''': 'true' or 'false' whether to strike through the text.&lt;br /&gt;
*'''strikethrough_color''': The color of strikethrough lines; an RGB color specification such as '#00FF00' or a color name such as 'red'&lt;br /&gt;
*'''fallback''': 'true' or 'false' whether to enable fallback. If disabled, then characters will only be used from the closest matching font on the system. No fallback will be done to other fonts on the system that might contain the characters in the text. Fallback is enabled by default. Most applications should not disable fallback.&lt;br /&gt;
*'''letter_spacing''': Inter-letter spacing in 1024ths of a point.&lt;br /&gt;
*'''gravity''': One of 'south', 'east', 'north', 'west', 'auto'.&lt;br /&gt;
*'''gravity_hint''': One of 'natural', 'strong', 'line'.&lt;br /&gt;
&lt;br /&gt;
The following pango attributes are also available directly as attributes of the '''[message]''' tag:&lt;br /&gt;
{{DevFeature1.13|4}}&lt;br /&gt;
&lt;br /&gt;
*'''font'''&lt;br /&gt;
*'''font_family'''&lt;br /&gt;
*'''font_size'''&lt;br /&gt;
*'''font_style'''&lt;br /&gt;
*'''font_weight'''&lt;br /&gt;
*'''font_variant'''&lt;br /&gt;
*'''font_stretch'''&lt;br /&gt;
*'''color'''&lt;br /&gt;
*'''bgcolor'''&lt;br /&gt;
*'''underline'''&lt;br /&gt;
*'''underline_color'''&lt;br /&gt;
*'''rise'''&lt;br /&gt;
*'''strikethrough'''&lt;br /&gt;
*'''strikethrough_color'''&lt;br /&gt;
*'''fallback'''&lt;br /&gt;
*'''letter_spacing'''&lt;br /&gt;
*'''gravity'''&lt;br /&gt;
*'''gravity_hint'''&lt;br /&gt;
&lt;br /&gt;
== [objectives] ==&lt;br /&gt;
The other tag used for plot development is '''[objectives]'''.&lt;br /&gt;
The '''[objectives]''' tag overwrites any previously set objectives,&lt;br /&gt;
and displays text which should describe the objectives of the scenario.&lt;br /&gt;
Scenario objectives are displayed on the player's first turn after the tag is used,&lt;br /&gt;
or as part of the event if it triggers during that player's turn.&lt;br /&gt;
Objectives can also be accessed at any time in a scenario using the&lt;br /&gt;
&amp;quot;Scenario Objectives&amp;quot; game menu option, making this tag useful for&lt;br /&gt;
scenario-specific information that the player may need to refer to during play.&lt;br /&gt;
&lt;br /&gt;
Attributes of '''[objectives]''':&lt;br /&gt;
* '''side''': Default '0'. The side to set the objectives for. A value of 0 sets objectives for all sides. note: There are side-specific objectives and default objectives, which are used in case a side doesn't have specific ones. Specifying 0 sets the default ones.&lt;br /&gt;
* '''[[StandardSideFilter]]''' tags and keys: Sets the objectives of all matching sides to these passed specifications (the rest of this [objectives] tag). If no sides (such as when passing side=0) or all sides match, sets the default objectives, and the side specific ones for the matching sides otherwise.&lt;br /&gt;
* '''bullet''': Default '• '. Replaces the default bullet, with whatever is passed, for all objectives, gold carryover notes, and notes defined with [note].&lt;br /&gt;
* '''summary''': Displayed first in the objectives text, this should describe the basic objective for the overall scenario.  Can be omitted.&lt;br /&gt;
* '''note''': Displayed last in the objectives text, this is sometimes used for hints or additional information.  Can be omitted.&lt;br /&gt;
* '''victory_string''': Default ' _ &amp;quot;Victory:&amp;quot;', this text precedes the victory objectives. Can be set to &amp;quot;&amp;quot; too.&lt;br /&gt;
* '''defeat_string''': Default ' _ &amp;quot;Defeat:&amp;quot;', this text precedes the defeat objectives. Can be set to &amp;quot;&amp;quot; too.&lt;br /&gt;
* '''gold_carryover_string''': Default ' _ &amp;quot;Gold carryover:&amp;quot;', this text precedes the gold carryover information.&lt;br /&gt;
* '''notes_string''': Default ' _ &amp;quot;Notes:&amp;quot;', this text precedes the notes.&lt;br /&gt;
* '''silent''': Default: not present. If set to &amp;quot;yes&amp;quot;, the objectives are silently changed. Else, they will be shown to the user when appropriate.&lt;br /&gt;
* '''delayed_variable_substitution''': {{DevFeature1.13|8}} If set to yes, any variables or [insert_tag] are not substituted right away. Instead, they are substituted whenever the objectives are actually viewed.&lt;br /&gt;
&lt;br /&gt;
Tags of '''[objectives]''':&lt;br /&gt;
* {{anchor|objectives-objective|'''[objective]'''}}: describes a win or loss condition. Most scenarios have multiple win or loss conditions, so use a separate [objective] subtag for each line; this helps with translations.&lt;br /&gt;
** '''bullet''': Default '• ' or whatever is set in the parent [objectives] block. Replaces the default bullet, with whatever is provided, for the objective defined by the [objective] block.&lt;br /&gt;
** '''red''': Default '0' for winning objectives, '255' for losing objectives. Overrides the default red coloring of the entire objective, including the bullet.&lt;br /&gt;
** '''green''': Default '255' for winning objectives, '0' for losing objectives. Overrides the default green coloring of the entire objective, including the bullet.&lt;br /&gt;
** '''blue''': Default '0'. Overrides the default blue coloring of the entire objective, including the bullet.&lt;br /&gt;
** '''description''': text for the specific win or loss condition.&lt;br /&gt;
** '''caption''': a text which will be displayed above the ''description''. This can be used to display a subcategory of objectives below ''victory_string'' or ''defeat_string''.&lt;br /&gt;
** '''condition''': The color and placement of the text. Values are 'win'(colored green, placed after ''victory_string'') and 'lose'(colored red, placed after ''defeat_string'').&lt;br /&gt;
** '''show_turn_counter''': If set to yes, displays the number of turns remaining in the scenario. Default is no.&lt;br /&gt;
** '''[show_if]''': A condition that disables the objective if it doesn't hold. Conditional objectives are refreshed at '''[show_objectives]''' time only, or when manually opening the scenario objectives.&lt;br /&gt;
* {{anchor|objectives-gold_carryover|'''[gold_carryover]'''}}: describes how the gold carryover works in this scenario. This is intended to be a more convenient way of displaying carryover information than using the note= key in [objectives].&lt;br /&gt;
** '''bullet''': Default '• ' or whatever is set in the parent [objectives] block. Replaces the default bullet with whatever is provided.&lt;br /&gt;
** '''red''': Default '255'. Overrides the default red coloring of the entire objective, including the bullet.&lt;br /&gt;
** '''green''': Default '255'. Overrides the default green coloring of the entire objective, including the bullet.&lt;br /&gt;
** '''blue''': Default '192'. Overrides the default blue coloring of the entire objective, including the bullet.&lt;br /&gt;
** '''bonus''' (boolean): whether an early finish bonus is granted. If omitted, early finish bonus is not mentioned.&lt;br /&gt;
** '''carryover_percentage''': the amount of carryover gold. If omitted, the amount is not mentioned.&lt;br /&gt;
** '''[show_if]''': {{DevFeature1.13|11}} Gold carryover will not be shown if the specified condition isn't met. Conditional gold carryover is refreshed at '''[show_objectives]''' time only.&lt;br /&gt;
* {{anchor|objectives-note|'''[note]'''}}: describes a note, usually used for hints or additional information. This is an easier way of adding several notes than concatenating them together into a single string to use with the ''note='' key.&lt;br /&gt;
** '''bullet''': Default '• ' or whatever is set in the parent [objectives] block. Replaces the default bullet with whatever is provided for the note defined by the [note] block.&lt;br /&gt;
** '''red''': Default '255'. Overrides the default red coloring of the entire note, including the bullet.&lt;br /&gt;
** '''green''': Default '255'. Overrides the default green coloring of the entire note, including the bullet.&lt;br /&gt;
** '''blue''': Default '255'. Overrides the default blue coloring of the entire note, including the bullet.&lt;br /&gt;
** '''description''': the text of the note.&lt;br /&gt;
** '''[show_if]''': The note will not be shown if the specified condition isn't met. Conditional notes are refreshed at '''[show_objectives]''' time only.&lt;br /&gt;
&lt;br /&gt;
== [set_menu_item] ==&lt;br /&gt;
This tag is used to add a custom option in the right-click context menu which can then be used to trigger arbitrary WML commands. The menu items can be set and modified during any event, for example during &amp;quot;start&amp;quot; or &amp;quot;prestart&amp;quot; events. The user can also assign hotkeys to these WML commands unless specified otherwise. When the hotkey is pressed the event will be fired/filtered at the current mouse position.&lt;br /&gt;
&lt;br /&gt;
'''Note:''' Due to limitations in portable devices where there are no scroll bars for context menus, there is a hard-coded limit of 7 custom WML menu items. If you really need to have more than 7 menu items, try combining some of them in a submenu. {{DevFeature1.13|0}} This limitation is being removed in a [http://forums.wesnoth.org/viewtopic.php?p=572554#p572554 future version] of Wesnoth.&lt;br /&gt;
&lt;br /&gt;
* '''id''': the unique id for this menu item. If a menu item with this id already exists, it allows you to set specific changes to that item. All menus will be sorted lexicographically by the id string. The ordering is underscores, digits, and finally letters.&lt;br /&gt;
* '''description''': the in-game text that will appear for this item in the menu.&lt;br /&gt;
* '''image''': the image to display next to this item, defaults to &amp;quot;buttons/WML-custom.png&amp;quot;&lt;br /&gt;
* '''needs_select''': if ''yes'' (default ''no''), then the latest select event (see [[EventWML]]) that triggered before this menu item was chosen will be transmitted over the network before this menu item action will be. This only has any effect in networked multiplayer, and is intended to allow more elaborate menu item behaviour there without causing out of sync errors. If you don't know what this means, just leave it. {{DevFeature1.13|6}} ''needs_select=yes'' is deprecated, consider using manual variable syncing with [sync_variable].&lt;br /&gt;
* '''synced''' {{DevFeature1.13|1}}: if ''no'' (default ''yes'') the command handler will only be run on the client that invoked the menu item; this means that changing the gamestate in a command handler of a menu item with ''synced=no'' will cause OOS&lt;br /&gt;
* '''use_hotkey''': if ''no'' (default ''yes''), then the user cannot assign hotkeys to this menu item. If ''only'', the menu item is only accessible via hotkeys, not via right-click context; you can use this in combination with [default_hotkey] if you want custom hotkeys in your campaign/mp. &lt;br /&gt;
* '''[show_if]''': If present, the menu item will only be available if the conditional statement (see [[ConditionalActionsWML#Condition_Tags|ConditionalActionsWML]]) within evaluates to true. When this is evaluated, the WML variables ''$x1'' and ''$y1'' will point to the location on which the context menu was invoked, so it's possible to for example only enable the option on empty hexes or on a particular unit.&lt;br /&gt;
* '''[filter_location]''': contains a [[StandardLocationFilter]] similar to the one found inside Single Unit Filters. The menu item will only be available on matching locations.&lt;br /&gt;
* '''[default_hotkey]''': contains a hotkey WML to specify what hotkey to assign to this, '''if the user has no hotkey assigned to this yet'''. (Unlike the rest of a menu item definition, modifying this tag has no effect on the game; it is only effective when initially defining a menu item.) Hotkey WML matches the format in the preferences file and contains the following keys:&lt;br /&gt;
** '''key''': a string that contains the key to assign to this.&lt;br /&gt;
** '''alt''', '''shift''', '''cmd'''(apple only), '''ctrl''':  boolean values.&lt;br /&gt;
** '''repeat_on_hold''' {{DevFeature1.13|12}}: if ''yes'' (default ''no''), holding the hotkey will repeat the action continuously, unless it blocks input with something like '''[message]'''. Due to a bug, versions older than 1.13.12 always repeat the action, with no way to disable it.&lt;br /&gt;
* '''[command]''': contains the WML actions to be executed when the menu item is selected. Again, the WML variables ''$x1'' and ''$y1'' will point to the location on which the context menu was invoked on.&lt;br /&gt;
** '''delayed_variable_substitution ''' (boolean yes|no, default: yes): If no, forces a variable substitution run onto the wml included in this [command] block. Use this, if you want variables which are to substitute to get the values they have at execution time of the event where this set_menu_item appears. Other than that, they get the values they have at invocation time of the menu item.&lt;br /&gt;
&lt;br /&gt;
== [clear_menu_item] ==&lt;br /&gt;
&lt;br /&gt;
Removes a menu item from the scenario.&lt;br /&gt;
Normally menu items are, including all their defining wml, automatically carried over between scenarios. This tag prevents this. (The behavior is comparable to set_variable/clear_variable).&lt;br /&gt;
* '''id''': (string): id of the menu item to clear. Can be a comma-separated list.&lt;br /&gt;
&lt;br /&gt;
== Other interface tags ==&lt;br /&gt;
&lt;br /&gt;
The following tags are also action tags:&lt;br /&gt;
&lt;br /&gt;
=== [change_theme] ===&lt;br /&gt;
&lt;br /&gt;
{{DevFeature1.13|8}}&lt;br /&gt;
&lt;br /&gt;
Change the current interface theme.&lt;br /&gt;
&lt;br /&gt;
* '''theme''': The ID of the new theme. Use &amp;lt;code&amp;gt;theme=&amp;lt;/code&amp;gt; (empty key) to switch back to the theme that the player has selected in Preferences. On &amp;lt;b&amp;gt;1.14.2&amp;lt;/b&amp;gt; and later it is also possible to omit the key entirely to achieve the same effect (on previous versions this will crash the Lua engine).&lt;br /&gt;
&lt;br /&gt;
=== [item] ===&lt;br /&gt;
Makes a graphical item appear on a certain hex. Note this only places the graphics for an item. It does not make the item do anything. Use a moveto event to make moving onto the item do something. &amp;lt;tt&amp;gt;''('''Hint:''' There are a number of predefined items that are used in various campaigns that you can make use of. You can find [http://www.wesnoth.org/macro-reference.xhtml#file:items.cfg a list of them] if you look into the items.cfg file in the wesnoth install directory (under /data/core/macros).)''&amp;lt;/tt&amp;gt;&lt;br /&gt;
* '''x''', '''y''': the location to place the item. (only for [event][item]: full [[StandardLocationFilter|SLF]] support)&lt;br /&gt;
* '''image''': the image (in ''images/'' as .png) to place on the hex. This image is aligned with the top-left of the hex (which is 72 pixels wide and 72 pixels tall). It is drawn underneath units. ''('''Hint:''' If using an image smaller than 72x72, then it might be useful to [[ImagePathFunctions#Blit_Function|BLIT]] the image onto &amp;lt;tt&amp;gt;misc/blank-hex.png&amp;lt;/tt&amp;gt; (a blank 72x72 image).)''&lt;br /&gt;
* '''halo''': an image to place centered on the hex. It is drawn on top of units. Use this instead of ''image'' if the image is bigger than the hex or if you want to animate an image ([https://github.com/wesnoth/wesnoth/issues/1219 #1219]). ''Example (where the integer after the colon is the duration of each frame or square bracket expansion as per [[AnimationWML]] is used): halo=scenery/fire1.png:100,scenery/fire2.png:100,scenery/fire3.png:100,scenery/fire4.png:100,scenery/fire5.png:100,scenery/fire6.png:100,scenery/fire7.png:100,scenery/fire8.png:100'' or equivalently (requires Wesnoth 1.11.2+): ''halo=scenery/fire[1~8].png:100''&lt;br /&gt;
* '''name''' an id that can be used to remove the item.&lt;br /&gt;
* '''team_name''': name of the team for which the item is to be displayed (hidden for others). For multiple teams just put all the names in one string, for example separated by commas. {{DevFeature1.15|0}} In 1.14 the '''[side]team_name''' attribute was expected to be a substring of this '''team_name'''. In 1.15 both are expected to be comma-separated lists of names and the item is visible if the lists intersect. ([https://github.com/wesnoth/wesnoth/pull/3533 #3533])&lt;br /&gt;
* '''visible_in_fog''': whether the item should be visible through fog or not. Default yes.&lt;br /&gt;
* '''submerge''': float, between 0 and 1: specifies how much of the image should be submerged. Gets multiplied with [[TerrainWML|[terrain]]]&amp;lt;nowiki/&amp;gt;submerge. Default 0.&lt;br /&gt;
* '''z_order''': float: defines the order the items get drawn in. Default 0.&lt;br /&gt;
* '''redraw''': (boolean yes|no, default: yes): If no, disables implicit calls to [[InterfaceActionsWML#.5Bredraw.5D|[redraw]]] when placing the items.&lt;br /&gt;
* '''[filter_team]''': {{DevFeature1.15|0}} A [[StandardSideFilter]]. Set '''team_name''' to the union of all '''[side]team_name''' attributes of all sides that match the SSF. ([https://github.com/wesnoth/wesnoth/pull/3533 #3533])&lt;br /&gt;
* {{DevFeature1.15|0}} If both '''team_name''' and '''[filter_team]''' are set, '''team_name''' is ignored.&lt;br /&gt;
&lt;br /&gt;
=== [remove_item] ===&lt;br /&gt;
Removes any graphical items on a given hex.&lt;br /&gt;
* [[StandardLocationFilter]]: the hexes to remove items from&lt;br /&gt;
* '''image''': if specified, only removes the given item if one of its 'image', 'halo' or 'name' attributes is exactly this value. (for 'halo' and 'image' this in particular means that the image name must include any [[ImagePathFunctions|image path functions]] appended to the original image name.)&lt;br /&gt;
&lt;br /&gt;
=== [print] ===&lt;br /&gt;
Displays a message across the screen. The message will disappear after a certain time, or when another [print] tag is encountered.&lt;br /&gt;
* '''text''': (translatable) the text to display. Can be an empty string to remove a previous message without showing a new one.&lt;br /&gt;
* '''size''': (default=12) the pointsize of the font to use&lt;br /&gt;
* '''duration''': the length of time to display the text for.&lt;br /&gt;
** (Before 1.15.4) This is measured in the number of 'frames', and the default is 50. A frame in Wesnoth is usually displayed for around 30ms.&lt;br /&gt;
** {{DevFeature1.15|4}} This is measured in milliseconds. Don't use the default value, because it's a mere 50ms.&lt;br /&gt;
** {{DevFeature1.15|14}} The default is 5000 milliseconds.&lt;br /&gt;
** {{DevFeature1.15|14}} The string '''unlimited''' displays the text until it's removed by another [print] tag.&lt;br /&gt;
* '''color''': (default '''0,0,0''') three comma-separated values giving the red, green and blue values (0-255).&lt;br /&gt;
* '''red''', '''green''', '''blue''': deprecated, use color=0,0,0 instead.&lt;br /&gt;
&lt;br /&gt;
=== [move_unit_fake] ===&lt;br /&gt;
Moves an image of a unit along a certain path on the map. The path does not need to be a continuous list of adjacent hexes, so for example only the start and end points can be given, in which case the straightest line between those points will be calculated and used.&lt;br /&gt;
* '''type''': the type of the unit whose image to use&lt;br /&gt;
* '''x''': a comma-separated list of x locations to move along&lt;br /&gt;
* '''y''': a comma-separated list of y locations to move along (x and y values are matched pairs)&lt;br /&gt;
* '''side''': the side of the fake unit, used for team-coloring the fake unit&lt;br /&gt;
* '''gender''': the gender of the fake unit. Example: gender=female&lt;br /&gt;
* '''variation''': the variation of the fake unit. Example: variation=undead&lt;br /&gt;
* '''image_mods''': [[ImagePathFunctions|image path functions]] sequence to be applied on the fake unit.&lt;br /&gt;
* '''force_scroll''':  Whether to scroll the map or not even when [[#.5Block_view.5D|[lock_view]]] is in effect or ''Follow Unit Actions'' is disabled in ''Advanced Preferences''. Defaults to ''yes'' starting with version '''1.11.6'''; the attribute did not exist in previous versions and this action behaved as if ''no'' was passed instead.&lt;br /&gt;
&lt;br /&gt;
=== [move_units_fake] ===&lt;br /&gt;
moves multiple images of units along paths on the map. These units are moved in lockstep.&lt;br /&gt;
* '''force_scroll''': {{DevFeature1.15|0}} Has the same meaning as in [move_unit_fake] but a different default.&lt;br /&gt;
* '''[fake_unit]''': A fake unit to move&lt;br /&gt;
** '''type''': the type of unit whose image to use&lt;br /&gt;
** '''x''': a comma-separated list of x locations to move along&lt;br /&gt;
** '''y''': a comma-separated list of y locations to move along (x and y values are matched pairs)&lt;br /&gt;
** '''side''': the side of the fake unit, used for team-coloring the fake unit&lt;br /&gt;
** '''skip_steps''': the number of steps to skip before this unit starts moving&lt;br /&gt;
&lt;br /&gt;
=== [hide_unit] ===&lt;br /&gt;
Temporarily prevents the engine from displaying the given unit. The unit does not become invisible, as it would be with the '''[hides]''' ability; it is still the same plain unit, but without an image. Useful in conjunction with '''[move_unit_fake]''': to move a leader unit into position on-screen. Until 1.8 each '''[hide_unit]''' tag only hides one unit.&lt;br /&gt;
* [[StandardUnitFilter]]: All matching units will be hidden&lt;br /&gt;
&lt;br /&gt;
=== [unhide_unit] ===&lt;br /&gt;
Stops the currently hidden units from being hidden.&lt;br /&gt;
* [[StandardUnitFilter]]: Only the matching units will be unhidden&lt;br /&gt;
&lt;br /&gt;
=== [lock_view] ===&lt;br /&gt;
Locks gamemap view scrolling for human players, so they cannot scroll the gamemap view until it is unlocked. WML or Lua actions such as '''[scroll_to]''' will continue to work normally, as they ignore this restriction; the locked/unlocked state is preserved when saving the current game.&lt;br /&gt;
&lt;br /&gt;
This feature is generally intended to be used in cutscenes to prevent the player scrolling away from scripted actions.&lt;br /&gt;
&lt;br /&gt;
{{DevFeature1.13|8}} This now also blocks the player from zooming the gamemap view. WML or Lua zoom will continue to work normally.&lt;br /&gt;
&lt;br /&gt;
=== [unlock_view] ===&lt;br /&gt;
Unlocks gamemap view scrolling for human players.&lt;br /&gt;
&lt;br /&gt;
=== [scroll] ===&lt;br /&gt;
Scroll a certain number of pixels in a given direction. Useful for earthquake/shaking effects.&lt;br /&gt;
* '''x''', '''y''': the number of pixels to scroll along the x and y axis&lt;br /&gt;
* '''side''': the side or sides for which this should happen. By default, the [scroll] happens for everyone.&lt;br /&gt;
* '''[filter_side]''': a [[StandardSideFilter]] to select the sides for which this should happen. By default, the [scroll] happens for everyone.&lt;br /&gt;
&lt;br /&gt;
=== [scroll_to] ===&lt;br /&gt;
Scroll to a given hex&lt;br /&gt;
* [[StandardLocationFilter]], do not use a [filter_location] sub-tag. If more than one location matches the filter, only the first matching location will be used.&lt;br /&gt;
* '''check_fogged''': whether to scroll even to locations covered in fog or shroud. Possible values ''yes'' (don't scroll to fog) and ''no'' (scroll even to fog), with ''no'' as the default.&lt;br /&gt;
* '''immediate''': whether to instantly warp to the target hex regardless of the scroll speed setting in Preferences (defaults to ''no'').&lt;br /&gt;
* '''highlight''': {{DevFeature1.13|5}} Whether to highlight the hex being scrolled to (defaults to ''no'').&lt;br /&gt;
* '''side''': the side or sides for which this should happen. By default, the [scroll_to] happens for everyone.&lt;br /&gt;
* '''[filter_side]''': a [[StandardSideFilter]] to select the sides for which this should happen. By default, the [scroll_to] happens for everyone.&lt;br /&gt;
&lt;br /&gt;
=== [scroll_to_unit] ===&lt;br /&gt;
Scroll to a given unit&lt;br /&gt;
* [[StandardUnitFilter]]; do not use a [filter] subtag.&lt;br /&gt;
* '''check_fogged''': whether to scroll even to locations covered in fog or shroud. Possible values ''yes'' (don't scroll to fog) and ''no'' (scroll even to fog), with ''no'' as the default.&lt;br /&gt;
* '''immediate''': whether to instantly warp to the target hex regardless of the scroll speed setting in Preferences (defaults to ''no'').&lt;br /&gt;
* '''highlight''': {{DevFeature1.13|5}} Whether to highlight the hex the unit is on (defaults to ''no'').&lt;br /&gt;
* '''for_side''': the side or sides for which this should happen. By default, the [scroll_to_unit] happens for everyone.&lt;br /&gt;
* '''[for_side]''': a [[StandardSideFilter]] to select the sides for which this should happen. By default, the [scroll_to_unit] happens for everyone.&lt;br /&gt;
&lt;br /&gt;
=== [select_unit] ===&lt;br /&gt;
Selects a given unit.&lt;br /&gt;
* [[StandardUnitFilter]]: The first unit found will be selected.&lt;br /&gt;
* '''fire_event''': whether a ''select'' event should be triggered or not (def. ''no''). (Note that select events aren't multiplayer save.)&lt;br /&gt;
* '''highlight''': whether the unit's current hex should be highlighted (def. ''yes'').&lt;br /&gt;
&lt;br /&gt;
'''Note:''' fire_event does not appear to work in 1.14 or 1.16.&lt;br /&gt;
&lt;br /&gt;
=== [sound]===&lt;br /&gt;
Plays a sound&lt;br /&gt;
* '''name''': the filename of the sound to play (in ''sounds/'' as .wav or .ogg). This can be a comma-separated list, from which one sound will be chosen randomly.&lt;br /&gt;
* '''repeat''': repeats the sound for a specified additional number of times (default=0)&lt;br /&gt;
&lt;br /&gt;
=== [sound_source] ===&lt;br /&gt;
Creates a sound source. &amp;quot;Sound sources&amp;quot; is a general name for a mechanism which makes possible for map elements to emit sounds according to some rules, where &amp;quot;map elements&amp;quot; can be specific locations or terrain types. For now, only sound sources tied to locations are supported.&lt;br /&gt;
* '''id''': a unique identification key of the sound source&lt;br /&gt;
* '''sounds''': a list of comma separated, randomly played sounds associated with the sound source&lt;br /&gt;
* '''delay''': a numerical value (in milliseconds) of the minimal delay between two playbacks of the source's sound if the source remains visible on the screen; if one scrolls out and back in, the source will be considered as ready to play&lt;br /&gt;
* '''chance''': a percentage (a value from 0 to 100) describing the chance of the source being activated every second after the delay has passed or when the source's location appears on the screen (note that it cannot play more than one file at the same time)&lt;br /&gt;
* '''check_fogged''': possible values ''yes'' and ''no'' - ''yes'' means the source will not play if its locations are fogged&lt;br /&gt;
* '''check_shrouded''': possible values ''yes'' and ''no'' - ''yes'' means the source will not play if its locations are shrouded&lt;br /&gt;
* '''x,y''': similar to x,y as found in a [[StandardLocationFilter]], these are the locations associated with the sound source&lt;br /&gt;
* '''fade_range''' (default = 3): distance in hexes that determines a &amp;quot;circular&amp;quot; area around the one specified by '''full_range''' where sound volume fades out linearly&lt;br /&gt;
* '''full_range''' (default = 14): distance in hexes that determines a &amp;quot;circular&amp;quot; area where source plays with full volume, relative to screen center&lt;br /&gt;
* '''loop''': number of times a sound sample should be looped if it stays visible. -1 means infinite (~65000)&lt;br /&gt;
&lt;br /&gt;
=== [story] ===&lt;br /&gt;
{{DevFeature1.13|8}}&lt;br /&gt;
&lt;br /&gt;
Shows the story screen.&lt;br /&gt;
* '''title''': Default title used if a part does not specify one — unlike the intro storyscreen, the scenario name is not used as a default title.&lt;br /&gt;
* '''[part]''', '''[if]''', '''[switch]''', '''[wml_message]''', '''[deprecated_message]''' : See [[IntroWML]].&lt;br /&gt;
&lt;br /&gt;
=== [remove_sound_source] ===&lt;br /&gt;
Removes a previously defined sound source.&lt;br /&gt;
* '''id''': the identification key of the sound source to remove&lt;br /&gt;
&lt;br /&gt;
=== [music] ===&lt;br /&gt;
Switches to playing different music&lt;br /&gt;
* '''name''': the filename of the music to play (in ''music/'' as .ogg)&lt;br /&gt;
* see [[MusicListWML]] for the correct syntax&lt;br /&gt;
&lt;br /&gt;
=== [volume] ===&lt;br /&gt;
Changes the game volume to a percent of the preferences volume for the game being played. Values can go from 0 to 100:  &lt;br /&gt;
* '''music''':  Changes the music volume.&lt;br /&gt;
* '''sound''':  Changes the sound volume.&lt;br /&gt;
&lt;br /&gt;
=== [color_adjust] ===&lt;br /&gt;
Adjust the color tint of terrain, by adjusting time-of-day coloring.&lt;br /&gt;
* '''red''', '''green''', '''blue''': values from -255 to 255, the amount to tint by for each color&lt;br /&gt;
&lt;br /&gt;
=== [screen_fade] ===&lt;br /&gt;
{{DevFeature1.17|6}}&lt;br /&gt;
&lt;br /&gt;
Overlay the game display with the given color, fading over the specified duration. This can be used for screen fade effects.&lt;br /&gt;
* '''red''', '''green''', '''blue''': values from 0 to 255, the final overlay color (defaults to 0,0,0)&lt;br /&gt;
* '''alpha''': value from 0 to 255, the strength of the effect. 0 means no effect and can be used to fade in. 255 means fully opaque and can be used to fully fade out to the given color. Intermediate values will end up with a partial overlay tint on the game screen.&lt;br /&gt;
* '''duration''': the length of time it will take to complete the fade, in milliseconds. If 0 the effect is immediate.&lt;br /&gt;
&lt;br /&gt;
=== [delay] ===&lt;br /&gt;
Pauses the game.&lt;br /&gt;
* '''time''': the time to pause in milliseconds&lt;br /&gt;
* '''accelerate ''' (boolean yes|no, default no): {{DevFeature1.13|0}} whether the delay is affected by acceleration. When [delay] is used to make an animation, this should be set to yes so that your animation matches the ones generated by the game.&lt;br /&gt;
&lt;br /&gt;
=== [redraw] ===&lt;br /&gt;
Redraws the screen (this normally isn't done during events, although some of the other interface actions cause the screen or parts of it to be redrawn).&lt;br /&gt;
* '''clear_shroud''' (boolean yes|no, default no): If yes, clears fog and shroud around existing units. Useful if you, for example, spawn friendly units in the middle of an event and want the shroud to update accordingly (otherwise units that spawn inside fog would remain invisible for the duration of the event, since the fog would not automatically get cleared around them).&lt;br /&gt;
* '''[[StandardSideFilter]]''': the sides for which to recalculate fog and shroud.&lt;br /&gt;
* '''side''': If used (forces clear_shroud=yes), clears fog and shroud for that side.&lt;br /&gt;
&lt;br /&gt;
=== [unit_overlay] ===&lt;br /&gt;
Sets an image that will be drawn over a particular unit, and follow it around&lt;br /&gt;
* [[StandardUnitFilter]]: All matching units will get the overlay (do not use [filter])&lt;br /&gt;
* '''image''': the image to place on the unit&lt;br /&gt;
* '''object_id''': object id to use, defaults to the '''image''' key with an &amp;quot;overlay_&amp;quot; prefix; this allows using [[DirectActionsWML#.5Bremove_object.5D|'''[remove_object]''']]&lt;br /&gt;
* '''duration''': object duration&lt;br /&gt;
&lt;br /&gt;
=== [remove_unit_overlay] ===&lt;br /&gt;
Removes a particular overlayed image from a unit&lt;br /&gt;
* [[StandardUnitFilter]]: The overlay will get removed from all matching units (do not use [filter])&lt;br /&gt;
* '''image''': the image to remove from the unit&lt;br /&gt;
* '''object_id''': object id to use&lt;br /&gt;
Using [[DirectActionsWML#.5Bremove_object.5D|'''[remove_object]''']] is also possible, see https://github.com/wesnoth/wesnoth/commit/26c2f941f2bcdd89528481e114c0375ad2a46271&lt;br /&gt;
&lt;br /&gt;
=== [animate_unit] ===&lt;br /&gt;
Uses an animation of a unit to animate it on screen (if the unit has the corresponding animation).&lt;br /&gt;
* '''flag''': The key to find the custom animation in the unit description (see the '''[extra_anim]''' description in [[AnimationWML]]). Standard animations can be triggered with the following keywords: ''leading recruited standing idling levelout levelin healing healed poisoned movement defend attack death victory pre_teleport post_teleport''&lt;br /&gt;
* '''[filter]''' with a [[StandardUnitFilter]] as argument, see [[FilterWML]]. By default, the unit at the event location will be animated. You can use this tag to choose any other unit to animate.&lt;br /&gt;
* '''[primary_attack]''': If this tag is not present, the filter for animation will be triggered with no attack. If it is here, all attacks from the unit will be filtered, and a matching one will be used to filter the animation. Takes a weapon filter as argument, see [[FilterWML]].&lt;br /&gt;
* '''[secondary_attack]''': Similar to '''[primary_attack]'''. May be needed to trigger a defense animation correctly, if there are more than one animations available for the defending unit.&lt;br /&gt;
* '''hits''': yes/no/hit/miss/kill: which according variation of a attack/defense animation shall be chosen (required)&lt;br /&gt;
* '''text''': a text to hover during the animation &lt;br /&gt;
* '''male_text''', '''female_text''': {{DevFeature1.13|2}} (translatable) gender-specific versions of the above&lt;br /&gt;
* '''red''': red value for the text color (0-255)&lt;br /&gt;
* '''green''': green value for the text color&lt;br /&gt;
* '''blue''': blue value for the text color&lt;br /&gt;
* '''with_bars''': yes/no: whether to display the status bars during the animation (e.g. the hitpoint bar)&lt;br /&gt;
* '''[animate]''': a sub block with the same syntax as '''[animate_unit]''' except that the '''[filter]''' block is mandatory to find the unit. This block will find and animate another unit simultaneously.&lt;br /&gt;
* '''[facing]''': a [[StandardLocationFilter]] specifying what hex the unit should be facing when animated&lt;br /&gt;
&lt;br /&gt;
=== [label] ===&lt;br /&gt;
Places a label on the map.&lt;br /&gt;
* '''x''', '''y''': the location of the label. {{DevFeature1.13|1}} (only for [event][label]: full [[StandardLocationFilter|SLF]] support)&lt;br /&gt;
* '''text''': what the label should say. If you put an empty string &amp;lt;code&amp;gt;&amp;quot;&amp;quot;&amp;lt;/code&amp;gt; as an argument, the label will be completely removed. Use this method if you want to remove a specific label from any location.&lt;br /&gt;
* '''team_name''': if specified, the label will only be visible to the given team.&lt;br /&gt;
* '''color''': color of the label. The format is r,g,b; r, g and b are numbers between 0 and 255. When you use Pango markup in the text, you cannot use this, but in that case you could colorize the text via Pango markup.&lt;br /&gt;
* '''visible_in_fog''': whether the label should be visible through fog or not. Default yes.&lt;br /&gt;
* '''visible_in_shroud''': whether the label should be visible through shroud or not. Default no.&lt;br /&gt;
* '''immutable''': whether this label is protected from being removed or changed by players. Default yes.&lt;br /&gt;
* '''category''': the Show/Hide Labels dialog allows showing/hiding all labels of a given category by toggling a checkbox.&lt;br /&gt;
* '''tooltip''': A tooltip visible when mouseovering the hex the label is on&lt;br /&gt;
* '''side''': the number of the side that placed the label. Can be 0 for labels placed by WML.&lt;br /&gt;
&lt;br /&gt;
=== [floating_text]===&lt;br /&gt;
Floats text (similar to the damage and healing numbers) on the given locations.&lt;br /&gt;
* [[StandardLocationFilter]]: the text will be floated on all matching locations simultaneously (do not use [filter] unless you intend to match one or more units).&lt;br /&gt;
* '''text''': the text to display.&lt;br /&gt;
&lt;br /&gt;
The default text color is &amp;lt;span style=&amp;quot;color: #6b8cff;&amp;quot;&amp;gt;'''#6b8cff'''&amp;lt;/span&amp;gt;. To change the color, use [[#Formatting|Pango markup]]. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# Float some golden yellow text at 20,20.&lt;br /&gt;
[floating_text]&lt;br /&gt;
   x,y=20,20&lt;br /&gt;
   text=&amp;quot;&amp;lt;span color='#cccc33'&amp;gt;&amp;quot; + _ &amp;quot;Your text here&amp;quot; + &amp;quot;&amp;lt;/span&amp;gt;&amp;quot;&lt;br /&gt;
[/floating_text]&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== [deprecated_message] ===&lt;br /&gt;
Shows a deprecated message in the message area, this feature is only intended to be used to warn about deprecated macros in mainline. The message is not translatable.&lt;br /&gt;
* '''message''': the message to show.&lt;br /&gt;
* '''level''': {{DevFeature1.13|10}} The deprecation level, a number from 1 to 3.&lt;br /&gt;
* '''what''': {{DevFeature1.13|10}} The name of the thing being deprecated. Use this instead of '''message''' if possible; a stock message will be generated from it. Use '''message''' only if more information is required; it will be appended to the stock message. This should not be translatable&lt;br /&gt;
* '''version''': {{DevFeature1.13|10}} For deprecation levels 2 and 3, this indicates the version in which the feature could be removed. It does ''not'' indicate the version in which it became deprecated. &lt;br /&gt;
&lt;br /&gt;
The meanings of the deprecation levels are as follows:&lt;br /&gt;
&lt;br /&gt;
# Deprecated, but will only be removed if absolutely necessary. The '''version''' key is ignored.&lt;br /&gt;
# It will be removed no earlier than a specified version.&lt;br /&gt;
# It will be removed in the next stable version&lt;br /&gt;
# It has already been removed, leaving just a stub to inform users of how to update their code.&lt;br /&gt;
&lt;br /&gt;
Note that as of 1.13.11, deprecation messages show only in the log, not in the chat message area. The '''message''' can be translatable, but does not need to be.&lt;br /&gt;
&lt;br /&gt;
=== [wml_message] ===&lt;br /&gt;
Outputs a message to Wesnoth's console output. Intended for campaign designers to output silent text to the console, without annoying the player; then, that text might contain information useful for later bug-reporting. WML wrapper of [[LuaAPI/wesnoth#wesnoth.log]], see the link for more description.&lt;br /&gt;
* '''message''': the message to show.&lt;br /&gt;
* '''to_chat''': controls whether message is visible in chat, though logger=wml means message is visible anyways. Default ''no''.&lt;br /&gt;
* '''logger''': one of '''info''', '''debug''', '''warning''', '''error''', '''wml'''. Default ''info''.&lt;br /&gt;
&lt;br /&gt;
=== [test_condition] ===&lt;br /&gt;
&lt;br /&gt;
{{DevFeature1.13|2}}&lt;br /&gt;
&lt;br /&gt;
Evaluates the contained conditional tags. If they evaluate to the expected value, it prints out a message to the console explaining which part of the condition caused this result in a way similar to [wml_message]. This can be used if your conditional test is failing and you're not sure why.&lt;br /&gt;
&lt;br /&gt;
* '''result''': Whether you expect the conditions to fail or succeed. If no (the default), a message will be printed if the conditional tags fail. If yes, a message will instead be printed if the conditional tags pass.&lt;br /&gt;
* '''logger''': Same as for [wml_message]. Defaults to &amp;quot;warning&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
=== [open_help] ===&lt;br /&gt;
Opens the in-game help.&lt;br /&gt;
* '''topic''': the id of the topic to open&lt;br /&gt;
&lt;br /&gt;
Examples of ids:&lt;br /&gt;
* unit_Mage&lt;br /&gt;
* unit_Dark Adept&lt;br /&gt;
* weaponspecial_charge&lt;br /&gt;
* terrain_human_castle&lt;br /&gt;
&lt;br /&gt;
The engine will print the topic ids if run from the command line with the ''--log-debug=help'' option.&lt;br /&gt;
&lt;br /&gt;
=== [show_objectives] ===&lt;br /&gt;
refreshes the objectives defined by [objectives] and its [show_if] tags, and displays them. (It is also called whenever the user explicitly asks for the objectives; this matters only if the tag was overridden by a [[LuaWML#register_wml_action|Lua]] script.)&lt;br /&gt;
* '''side''': the side to show the objectives. If not set, all sides are used.&lt;br /&gt;
* '''[[StandardSideFilter]]''' tags and keys: Tag affects the matching sides instead of just all or the one given by the integer value of the side= key.&lt;br /&gt;
&lt;br /&gt;
=== [chat] ===&lt;br /&gt;
Displays a message in the chat area, not visible for observers. Alternative unconditionally visible for everyone: [[LuaWML:Display#wesnoth.message]]. {{DevFeature1.13|9}} can be visible for observers.&lt;br /&gt;
* '''speaker''': (default=&amp;quot;WML&amp;quot;) A string for the name of the sender of the message.&lt;br /&gt;
* '''message''': The message that should be displayed.&lt;br /&gt;
* '''observable''' (boolean yes|no, default yes): {{DevFeature1.13|9}} Whether the message is displayed for observers.&lt;br /&gt;
* '''[[StandardSideFilter]]''' tags and keys as argument; if the same client controls multiple sides that match, then the message will only be displayed once.&lt;br /&gt;
&lt;br /&gt;
=== [zoom] ===&lt;br /&gt;
&lt;br /&gt;
{{DevFeature1.13|8}}&lt;br /&gt;
&lt;br /&gt;
Changes the zoom level of the map.&lt;br /&gt;
&lt;br /&gt;
* '''factor''': The new zoom factor, measured as a multiple of the base zoom.&lt;br /&gt;
* '''relative''': If yes, zoom relative to current zoom level. Otherwise, set the absolute zoom level. Default no.&lt;br /&gt;
&lt;br /&gt;
== Useful Macros ==&lt;br /&gt;
There are some predefined macros that you find useful for interface 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;
* '''{HIGHLIGHT_UNIT}''' Highlight a unit on the map. Use this to show important units&lt;br /&gt;
* '''{HIGHLIGHT_IMAGE}''' Places and highlights an image on the map. Use this to show important items or locations&lt;br /&gt;
* '''{SET_IMAGE}''' Places an image on the map which has no other function.&lt;br /&gt;
* '''{QUAKE &amp;lt;soundfile&amp;gt;}''' Creates a tremor-like screenshake and plays &amp;lt;soundfile&amp;gt;. For example, '''{QUAKE (rumble.ogg)}'''.&lt;br /&gt;
* '''{FLASH_WHITE}''' Flash the screen white momentarily. You can also replace WHITE with RED, BLUE or GREEN for a different colour.&lt;br /&gt;
&lt;br /&gt;
== See Also ==&lt;br /&gt;
* [[DirectActionsWML]]&lt;br /&gt;
* [[InternalActionsWML]]&lt;br /&gt;
* [[EventWML]]&lt;br /&gt;
* [[ReferenceWML]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category: WML Reference]]&lt;br /&gt;
[[Category: ActionsWML]]&lt;/div&gt;</summary>
		<author><name>Soliton</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.wesnoth.org/index.php?title=InterfaceActionsWML&amp;diff=74419</id>
		<title>InterfaceActionsWML</title>
		<link rel="alternate" type="text/html" href="https://wiki.wesnoth.org/index.php?title=InterfaceActionsWML&amp;diff=74419"/>
		<updated>2025-07-02T12:09:22Z</updated>

		<summary type="html">&lt;p&gt;Soliton: /* [item] */ fix external links&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{WML Tags}}&lt;br /&gt;
== Interface actions ==&lt;br /&gt;
&lt;br /&gt;
Part of [[ActionWML]], interface actions are actions that do not have a direct effect on gameplay;&lt;br /&gt;
instead, they show something to the player.  The main interface tags&lt;br /&gt;
are '''[message]''' and '''[objectives]''', but several other tags affect&lt;br /&gt;
the interface also.&lt;br /&gt;
&lt;br /&gt;
== [inspect] ==&lt;br /&gt;
This user interface instantly displays the gamestate inspector dialog at the current scenario state (the same one that can be brought up with [[CommandMode|the ''':inspect''' command]]), which can be used to inspect the values of WML variables, AI configuration, recall lists, and more.&lt;br /&gt;
&lt;br /&gt;
* '''name''': optional attribute to specify the name of this gamestate inspector dialog. It is just a label to help differentiate between different invocations of gamestate inspector dialog.&lt;br /&gt;
&lt;br /&gt;
== [message] ==&lt;br /&gt;
The most commonly used interface action is [message], which displays a message to the user in a dialog box. It can also be used to take input from the user.&lt;br /&gt;
&lt;br /&gt;
The following key/tags are accepted for [message]:&lt;br /&gt;
* [[StandardUnitFilter]]: The unit whose profile and name are displayed. Do not use a [filter] tag. If no unit matching this filter is found, the message is not displayed (The unit has probably been killed).&amp;lt;br&amp;gt;[message] elements should be constructed so that it is either guaranteed that a certain unit is alive, or so that dialog flows smoothly even if the message isn't displayed.&lt;br /&gt;
&lt;br /&gt;
* '''speaker''': an alternative to standard unit filter. You may specify as the value of the speaker attribute a unit id or any of the following special values:&lt;br /&gt;
** '''narrator''': the dialog box is displayed without a caption for the unit speaking or a unit image&lt;br /&gt;
** '''unit''': the primary unit for the event is speaking&lt;br /&gt;
** '''second_unit''': the secondary unit for the event is speaking&lt;br /&gt;
&lt;br /&gt;
* '''message''': (translatable) the text to display to the right of the image. ''message'' is sometimes multiple lines; if it is, be sure to use quotes(''' ' ''' or ''' &amp;quot; ''')&lt;br /&gt;
* '''male_message''', '''female_message''': {{DevFeature1.13|2}} (translatable) Used instead of ''message'' if the unit's gender matches. Never used if there is no unit (ie ''speaker=narrator''). {{DevFeature1.13|6}} This matches the primary unit, not the secondary unit.&lt;br /&gt;
* '''wait_description''': {{DevFeature1.13|2}} the description of this message displayed when other players in a mp game wait for one player doing input in a [message] (with [option]s or [text_input]).&lt;br /&gt;
* '''[show_if]''': if present then this message will only be displayed if the conditional statement in this tag is passed (see [[ConditionalActionsWML#Condition_Tags|ConditionalActionsWML]])&lt;br /&gt;
* '''side_for''': (default: all sides) comma-separated list of sides for who message is shown. This will &amp;lt;b&amp;gt;not&amp;lt;/b&amp;gt; work with messages that take user input ([option]/[text_input]), which can only ever be shown to the current player. {{DevFeature1.13|0}} side_for= is now also accepted for messages with user input, it specifies on which side the message is shown (defaults to the currently playing side). For messages with input it does not accept a comma seperated list only a single number.&lt;br /&gt;
* '''image''': (default: profile image of speaker) the image to display to the left of the message text. Append ~RIGHT() if you want the image to appear on the right side. &lt;br /&gt;
** {{DevFeature1.13|0}} &amp;lt;b&amp;gt;none:&amp;lt;/b&amp;gt; display no image&lt;br /&gt;
* '''mirror''': {{DevFeature1.13|5}} whether to mirror the image specified by the '''image''' attribute.&lt;br /&gt;
* '''second_image''': {{DevFeature1.13|6}} same as the '''image''' attribute, but the image is displayed on the right of the message text. {{DevFeature1.17|7}} not working anymore, but there is plan to fix it eventually https://github.com/wesnoth/wesnoth/issues/8770&lt;br /&gt;
* '''second_mirror''': {{DevFeature1.13|6}} same as '''mirror''', but for the '''second_image''' attribute.&lt;br /&gt;
* '''image_pos''': {{DevFeature1.13|5}} whether to show the image on the left or right; supercedes the use of ~RIGHT() described above&lt;br /&gt;
* '''caption''': (default: name of speaker) the caption to display beside the image. Name to be displayed. Note: use a translation mark to avoid wmllint errors.&lt;br /&gt;
* '''scroll''': Boolean specifying whether the game view should scroll to the speaking unit. Defaults to ''yes''.&lt;br /&gt;
* '''highlight''': {{DevFeature1.13|5}} Boolean specifying whether to highlight the speaker. Defaults to ''yes''.&lt;br /&gt;
* '''sound''': a sound effect (wav file) to play as the message is displayed. This can be a comma-separated list, from which one will be randomly chosen.&lt;br /&gt;
* '''voice''', '''male_voice''', '''female_voice''': {{DevFeature1.13|?}} a sound to be played as the message is displayed. This can also be a comma-separated list, from which one will be randomly chosen. This is intended for voiceovers for the message. The gendered forms are applied the same as for '''message'''. They are never used when the speaker is the narrator - only '''voice''' is used in that case.&lt;br /&gt;
* {{anchor|message-option|'''[option]'''}}: No '''[option]''' elements have to be used. If '''[option]''' elements are present, then each option will be displayed in a menu for the user to select one option. ''Note: Messages with options will not be shown at all in prestart events''&lt;br /&gt;
** '''message''': (translatable) the text displayed for the option. {{DevFeature1.15|1}} This is now a synonym for '''description='''.&lt;br /&gt;
** '''image''', '''label''', '''description''', '''default''': See [[DescriptionWML#WML_Format|DescriptionWML]].&lt;br /&gt;
** '''value''': {{DevFeature1.13|?}} Gives the option a value to be stored in a variable.&lt;br /&gt;
** '''[show_if]''': if present then this option will only be displayed if the conditional statement in this tag is passed (see [[ConditionalActionsWML#Condition_Tags|ConditionalActionsWML]])&lt;br /&gt;
** '''[command]''': an element containing actions which are executed if the option is selected.&lt;br /&gt;
* '''variable''': {{DevFeature1.13|?}} If present, either the index or the value of the chosen option will be stored in the specified variable. Option indexing starts from 1. If option has '''[show_if]''' condition evaluated as false, then it is hidden and excluded from the indexing.&lt;br /&gt;
* {{anchor|message-text_input|'''[text_input]'''}}: there can be only one [text_input] tag. this adds a text input field to the message. ''Note: Messages with text_input will not be shown at all in prestart events''&lt;br /&gt;
** '''variable''': the variable that the user's input will be written to&lt;br /&gt;
** '''label''': a text label to the left of the input field&lt;br /&gt;
** '''max_length''': the maximum number of characters that may be typed into the field&lt;br /&gt;
** '''text''': text that is written into the field in the beginning&lt;br /&gt;
* Check [[EventWML#Multiplayer_safety]] to find out in which events you can safely use '''[option]''' and '''[text_input]''' without causing OOS.&lt;br /&gt;
&lt;br /&gt;
=== Formatting ===&lt;br /&gt;
'''[message]''' and other tags such as unit names (user_description), objectives, and floating text can make use of [https://docs.gtk.org/Pango/pango_markup.html#pango-markup Pango markup formatting codes].&lt;br /&gt;
&lt;br /&gt;
Prefer to use single quotes (') instead of double quotes (&amp;quot;) within the formatting string, as double quotes would need to be escaped in WML (&amp;quot;&amp;quot;). Escaping markup can be done with [https://github.com/wesnoth/wesnoth/blob/9daa10a9f27c5a95520e871417bbd72aa52aa688/src/font/pango/escape.hpp#L38-L42 HTML entities].&lt;br /&gt;
&lt;br /&gt;
For example, if you wanted to write &amp;quot;You are victorious!&amp;quot; in large, italic, gold letters, you might write it this way:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&amp;lt;span color='#BCB088' size='large' font-style='italic'&amp;gt;You are victorious!&amp;lt;/span&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
These are the codes taken from the Pango markup formatting guide:&lt;br /&gt;
&lt;br /&gt;
*'''font''', '''font_desc''': A font description string, such as &amp;quot;Sans Italic 12&amp;quot;.&lt;br /&gt;
*'''font_family''', '''face''': A font family name.&lt;br /&gt;
*'''font_size''', '''size''': Font size in 1024ths of a point, or one of the absolute sizes 'xx-small', 'x-small', 'small', 'medium', 'large', 'x-large', 'xx-large', or one of the relative sizes 'smaller' or 'larger'.&lt;br /&gt;
*'''font_style''', '''style''': One of 'normal', 'oblique', 'italic'.&lt;br /&gt;
*'''font_weight''', '''weight''': One of 'ultralight', 'light', 'normal', 'bold', 'ultrabold', 'heavy', or a numeric weight.&lt;br /&gt;
*'''font_variant''', '''variant''': One of 'normal' or 'smallcaps'.&lt;br /&gt;
*'''font_stretch''', '''stretch''': One of 'ultracondensed', 'extracondensed', 'condensed', 'semicondensed', 'normal', 'semiexpanded', 'expanded', 'extraexpanded', 'ultraexpanded'.&lt;br /&gt;
*'''foreground''', '''fgcolor''', '''color''': An RGB color specification such as '#00FF00' or a color name such as 'red'. The full list of color names may be found in Pango's [https://github.com/GNOME/pango/blob/main/tools/rgb.txt rgb.txt] file.&lt;br /&gt;
*'''background, bgcolor''': An RGB color specification such as '#00FF00' or a color name such as 'red'.&lt;br /&gt;
*'''underline''': One of 'none', 'single', 'double', 'low', 'error'.&lt;br /&gt;
*'''underline_color''': The color of underlines; an RGB color specification such as '#00FF00' or a color name such as 'red'.&lt;br /&gt;
*'''rise''': Vertical displacement, in 10000ths of an em. Can be negative for subscript, positive for superscript.&lt;br /&gt;
*'''strikethrough''': 'true' or 'false' whether to strike through the text.&lt;br /&gt;
*'''strikethrough_color''': The color of strikethrough lines; an RGB color specification such as '#00FF00' or a color name such as 'red'&lt;br /&gt;
*'''fallback''': 'true' or 'false' whether to enable fallback. If disabled, then characters will only be used from the closest matching font on the system. No fallback will be done to other fonts on the system that might contain the characters in the text. Fallback is enabled by default. Most applications should not disable fallback.&lt;br /&gt;
*'''letter_spacing''': Inter-letter spacing in 1024ths of a point.&lt;br /&gt;
*'''gravity''': One of 'south', 'east', 'north', 'west', 'auto'.&lt;br /&gt;
*'''gravity_hint''': One of 'natural', 'strong', 'line'.&lt;br /&gt;
&lt;br /&gt;
The following pango attributes are also available directly as attributes of the '''[message]''' tag:&lt;br /&gt;
{{DevFeature1.13|4}}&lt;br /&gt;
&lt;br /&gt;
*'''font'''&lt;br /&gt;
*'''font_family'''&lt;br /&gt;
*'''font_size'''&lt;br /&gt;
*'''font_style'''&lt;br /&gt;
*'''font_weight'''&lt;br /&gt;
*'''font_variant'''&lt;br /&gt;
*'''font_stretch'''&lt;br /&gt;
*'''color'''&lt;br /&gt;
*'''bgcolor'''&lt;br /&gt;
*'''underline'''&lt;br /&gt;
*'''underline_color'''&lt;br /&gt;
*'''rise'''&lt;br /&gt;
*'''strikethrough'''&lt;br /&gt;
*'''strikethrough_color'''&lt;br /&gt;
*'''fallback'''&lt;br /&gt;
*'''letter_spacing'''&lt;br /&gt;
*'''gravity'''&lt;br /&gt;
*'''gravity_hint'''&lt;br /&gt;
&lt;br /&gt;
== [objectives] ==&lt;br /&gt;
The other tag used for plot development is '''[objectives]'''.&lt;br /&gt;
The '''[objectives]''' tag overwrites any previously set objectives,&lt;br /&gt;
and displays text which should describe the objectives of the scenario.&lt;br /&gt;
Scenario objectives are displayed on the player's first turn after the tag is used,&lt;br /&gt;
or as part of the event if it triggers during that player's turn.&lt;br /&gt;
Objectives can also be accessed at any time in a scenario using the&lt;br /&gt;
&amp;quot;Scenario Objectives&amp;quot; game menu option, making this tag useful for&lt;br /&gt;
scenario-specific information that the player may need to refer to during play.&lt;br /&gt;
&lt;br /&gt;
Attributes of '''[objectives]''':&lt;br /&gt;
* '''side''': Default '0'. The side to set the objectives for. A value of 0 sets objectives for all sides. note: There are side-specific objectives and default objectives, which are used in case a side doesn't have specific ones. Specifying 0 sets the default ones.&lt;br /&gt;
* '''[[StandardSideFilter]]''' tags and keys: Sets the objectives of all matching sides to these passed specifications (the rest of this [objectives] tag). If no sides (such as when passing side=0) or all sides match, sets the default objectives, and the side specific ones for the matching sides otherwise.&lt;br /&gt;
* '''bullet''': Default '• '. Replaces the default bullet, with whatever is passed, for all objectives, gold carryover notes, and notes defined with [note].&lt;br /&gt;
* '''summary''': Displayed first in the objectives text, this should describe the basic objective for the overall scenario.  Can be omitted.&lt;br /&gt;
* '''note''': Displayed last in the objectives text, this is sometimes used for hints or additional information.  Can be omitted.&lt;br /&gt;
* '''victory_string''': Default ' _ &amp;quot;Victory:&amp;quot;', this text precedes the victory objectives. Can be set to &amp;quot;&amp;quot; too.&lt;br /&gt;
* '''defeat_string''': Default ' _ &amp;quot;Defeat:&amp;quot;', this text precedes the defeat objectives. Can be set to &amp;quot;&amp;quot; too.&lt;br /&gt;
* '''gold_carryover_string''': Default ' _ &amp;quot;Gold carryover:&amp;quot;', this text precedes the gold carryover information.&lt;br /&gt;
* '''notes_string''': Default ' _ &amp;quot;Notes:&amp;quot;', this text precedes the notes.&lt;br /&gt;
* '''silent''': Default: not present. If set to &amp;quot;yes&amp;quot;, the objectives are silently changed. Else, they will be shown to the user when appropriate.&lt;br /&gt;
* '''delayed_variable_substitution''': {{DevFeature1.13|8}} If set to yes, any variables or [insert_tag] are not substituted right away. Instead, they are substituted whenever the objectives are actually viewed.&lt;br /&gt;
&lt;br /&gt;
Tags of '''[objectives]''':&lt;br /&gt;
* {{anchor|objectives-objective|'''[objective]'''}}: describes a win or loss condition. Most scenarios have multiple win or loss conditions, so use a separate [objective] subtag for each line; this helps with translations.&lt;br /&gt;
** '''bullet''': Default '• ' or whatever is set in the parent [objectives] block. Replaces the default bullet, with whatever is provided, for the objective defined by the [objective] block.&lt;br /&gt;
** '''red''': Default '0' for winning objectives, '255' for losing objectives. Overrides the default red coloring of the entire objective, including the bullet.&lt;br /&gt;
** '''green''': Default '255' for winning objectives, '0' for losing objectives. Overrides the default green coloring of the entire objective, including the bullet.&lt;br /&gt;
** '''blue''': Default '0'. Overrides the default blue coloring of the entire objective, including the bullet.&lt;br /&gt;
** '''description''': text for the specific win or loss condition.&lt;br /&gt;
** '''caption''': a text which will be displayed above the ''description''. This can be used to display a subcategory of objectives below ''victory_string'' or ''defeat_string''.&lt;br /&gt;
** '''condition''': The color and placement of the text. Values are 'win'(colored green, placed after ''victory_string'') and 'lose'(colored red, placed after ''defeat_string'').&lt;br /&gt;
** '''show_turn_counter''': If set to yes, displays the number of turns remaining in the scenario. Default is no.&lt;br /&gt;
** '''[show_if]''': A condition that disables the objective if it doesn't hold. Conditional objectives are refreshed at '''[show_objectives]''' time only, or when manually opening the scenario objectives.&lt;br /&gt;
* {{anchor|objectives-gold_carryover|'''[gold_carryover]'''}}: describes how the gold carryover works in this scenario. This is intended to be a more convenient way of displaying carryover information than using the note= key in [objectives].&lt;br /&gt;
** '''bullet''': Default '• ' or whatever is set in the parent [objectives] block. Replaces the default bullet with whatever is provided.&lt;br /&gt;
** '''red''': Default '255'. Overrides the default red coloring of the entire objective, including the bullet.&lt;br /&gt;
** '''green''': Default '255'. Overrides the default green coloring of the entire objective, including the bullet.&lt;br /&gt;
** '''blue''': Default '192'. Overrides the default blue coloring of the entire objective, including the bullet.&lt;br /&gt;
** '''bonus''' (boolean): whether an early finish bonus is granted. If omitted, early finish bonus is not mentioned.&lt;br /&gt;
** '''carryover_percentage''': the amount of carryover gold. If omitted, the amount is not mentioned.&lt;br /&gt;
** '''[show_if]''': {{DevFeature1.13|11}} Gold carryover will not be shown if the specified condition isn't met. Conditional gold carryover is refreshed at '''[show_objectives]''' time only.&lt;br /&gt;
* {{anchor|objectives-note|'''[note]'''}}: describes a note, usually used for hints or additional information. This is an easier way of adding several notes than concatenating them together into a single string to use with the ''note='' key.&lt;br /&gt;
** '''bullet''': Default '• ' or whatever is set in the parent [objectives] block. Replaces the default bullet with whatever is provided for the note defined by the [note] block.&lt;br /&gt;
** '''red''': Default '255'. Overrides the default red coloring of the entire note, including the bullet.&lt;br /&gt;
** '''green''': Default '255'. Overrides the default green coloring of the entire note, including the bullet.&lt;br /&gt;
** '''blue''': Default '255'. Overrides the default blue coloring of the entire note, including the bullet.&lt;br /&gt;
** '''description''': the text of the note.&lt;br /&gt;
** '''[show_if]''': The note will not be shown if the specified condition isn't met. Conditional notes are refreshed at '''[show_objectives]''' time only.&lt;br /&gt;
&lt;br /&gt;
== [set_menu_item] ==&lt;br /&gt;
This tag is used to add a custom option in the right-click context menu which can then be used to trigger arbitrary WML commands. The menu items can be set and modified during any event, for example during &amp;quot;start&amp;quot; or &amp;quot;prestart&amp;quot; events. The user can also assign hotkeys to these WML commands unless specified otherwise. When the hotkey is pressed the event will be fired/filtered at the current mouse position.&lt;br /&gt;
&lt;br /&gt;
'''Note:''' Due to limitations in portable devices where there are no scroll bars for context menus, there is a hard-coded limit of 7 custom WML menu items. If you really need to have more than 7 menu items, try combining some of them in a submenu. {{DevFeature1.13|0}} This limitation is being removed in a [http://forums.wesnoth.org/viewtopic.php?p=572554#p572554 future version] of Wesnoth.&lt;br /&gt;
&lt;br /&gt;
* '''id''': the unique id for this menu item. If a menu item with this id already exists, it allows you to set specific changes to that item. All menus will be sorted lexicographically by the id string. The ordering is underscores, digits, and finally letters.&lt;br /&gt;
* '''description''': the in-game text that will appear for this item in the menu.&lt;br /&gt;
* '''image''': the image to display next to this item, defaults to &amp;quot;buttons/WML-custom.png&amp;quot;&lt;br /&gt;
* '''needs_select''': if ''yes'' (default ''no''), then the latest select event (see [[EventWML]]) that triggered before this menu item was chosen will be transmitted over the network before this menu item action will be. This only has any effect in networked multiplayer, and is intended to allow more elaborate menu item behaviour there without causing out of sync errors. If you don't know what this means, just leave it. {{DevFeature1.13|6}} ''needs_select=yes'' is deprecated, consider using manual variable syncing with [sync_variable].&lt;br /&gt;
* '''synced''' {{DevFeature1.13|1}}: if ''no'' (default ''yes'') the command handler will only be run on the client that invoked the menu item; this means that changing the gamestate in a command handler of a menu item with ''synced=no'' will cause OOS&lt;br /&gt;
* '''use_hotkey''': if ''no'' (default ''yes''), then the user cannot assign hotkeys to this menu item. If ''only'', the menu item is only accessible via hotkeys, not via right-click context; you can use this in combination with [default_hotkey] if you want custom hotkeys in your campaign/mp. &lt;br /&gt;
* '''[show_if]''': If present, the menu item will only be available if the conditional statement (see [[ConditionalActionsWML#Condition_Tags|ConditionalActionsWML]]) within evaluates to true. When this is evaluated, the WML variables ''$x1'' and ''$y1'' will point to the location on which the context menu was invoked, so it's possible to for example only enable the option on empty hexes or on a particular unit.&lt;br /&gt;
* '''[filter_location]''': contains a [[StandardLocationFilter]] similar to the one found inside Single Unit Filters. The menu item will only be available on matching locations.&lt;br /&gt;
* '''[default_hotkey]''': contains a hotkey WML to specify what hotkey to assign to this, '''if the user has no hotkey assigned to this yet'''. (Unlike the rest of a menu item definition, modifying this tag has no effect on the game; it is only effective when initially defining a menu item.) Hotkey WML matches the format in the preferences file and contains the following keys:&lt;br /&gt;
** '''key''': a string that contains the key to assign to this.&lt;br /&gt;
** '''alt''', '''shift''', '''cmd'''(apple only), '''ctrl''':  boolean values.&lt;br /&gt;
** '''repeat_on_hold''' {{DevFeature1.13|12}}: if ''yes'' (default ''no''), holding the hotkey will repeat the action continuously, unless it blocks input with something like '''[message]'''. Due to a bug, versions older than 1.13.12 always repeat the action, with no way to disable it.&lt;br /&gt;
* '''[command]''': contains the WML actions to be executed when the menu item is selected. Again, the WML variables ''$x1'' and ''$y1'' will point to the location on which the context menu was invoked on.&lt;br /&gt;
** '''delayed_variable_substitution ''' (boolean yes|no, default: yes): If no, forces a variable substitution run onto the wml included in this [command] block. Use this, if you want variables which are to substitute to get the values they have at execution time of the event where this set_menu_item appears. Other than that, they get the values they have at invocation time of the menu item.&lt;br /&gt;
&lt;br /&gt;
== [clear_menu_item] ==&lt;br /&gt;
&lt;br /&gt;
Removes a menu item from the scenario.&lt;br /&gt;
Normally menu items are, including all their defining wml, automatically carried over between scenarios. This tag prevents this. (The behavior is comparable to set_variable/clear_variable).&lt;br /&gt;
* '''id''': (string): id of the menu item to clear. Can be a comma-separated list.&lt;br /&gt;
&lt;br /&gt;
== Other interface tags ==&lt;br /&gt;
&lt;br /&gt;
The following tags are also action tags:&lt;br /&gt;
&lt;br /&gt;
=== [change_theme] ===&lt;br /&gt;
&lt;br /&gt;
{{DevFeature1.13|8}}&lt;br /&gt;
&lt;br /&gt;
Change the current interface theme.&lt;br /&gt;
&lt;br /&gt;
* '''theme''': The ID of the new theme. Use &amp;lt;code&amp;gt;theme=&amp;lt;/code&amp;gt; (empty key) to switch back to the theme that the player has selected in Preferences. On &amp;lt;b&amp;gt;1.14.2&amp;lt;/b&amp;gt; and later it is also possible to omit the key entirely to achieve the same effect (on previous versions this will crash the Lua engine).&lt;br /&gt;
&lt;br /&gt;
=== [item] ===&lt;br /&gt;
Makes a graphical item appear on a certain hex. Note this only places the graphics for an item. It does not make the item do anything. Use a moveto event to make moving onto the item do something. &amp;lt;tt&amp;gt;''('''Hint:''' There are a number of predefined items that are used in various campaigns that you can make use of. You can find [http://www.wesnoth.org/macro-reference.xhtml#file:items.cfg a list of them] if you look into the items.cfg file in the wesnoth install directory (under /data/core/macros).)''&amp;lt;/tt&amp;gt;&lt;br /&gt;
* '''x''', '''y''': the location to place the item. (only for [event][item]: full [[StandardLocationFilter|SLF]] support)&lt;br /&gt;
* '''image''': the image (in ''images/'' as .png) to place on the hex. This image is aligned with the top-left of the hex (which is 72 pixels wide and 72 pixels tall). It is drawn underneath units. ''('''Hint:''' If using an image smaller than 72x72, then it might be useful to [[ImagePathFunctions#Blit_Function|BLIT]] the image onto &amp;lt;tt&amp;gt;misc/blank-hex.png&amp;lt;/tt&amp;gt; (a blank 72x72 image).)''&lt;br /&gt;
* '''halo''': an image to place centered on the hex. It is drawn on top of units. Use this instead of ''image'' if the image is bigger than the hex or if you want to animate an image ([https://github.com/wesnoth/wesnoth/issues/1219 #1219]). ''Example (where the integer after the colon is the duration of each frame or square bracket expansion as per AnimationWML is used): halo=scenery/fire1.png:100,scenery/fire2.png:100,scenery/fire3.png:100,scenery/fire4.png:100,scenery/fire5.png:100,scenery/fire6.png:100,scenery/fire7.png:100,scenery/fire8.png:100'' or equivalently (requires Wesnoth 1.11.2+): ''halo=scenery/fire[1~8].png:100''&lt;br /&gt;
* '''name''' an id that can be used to remove the item.&lt;br /&gt;
* '''team_name''': name of the team for which the item is to be displayed (hidden for others). For multiple teams just put all the names in one string, for example separated by commas. {{DevFeature1.15|0}} In 1.14 the '''[side]team_name''' attribute was expected to be a substring of this '''team_name'''. In 1.15 both are expected to be comma-separated lists of names and the item is visible if the lists intersect. ([https://github.com/wesnoth/wesnoth/pull/3533 #3533])&lt;br /&gt;
* '''visible_in_fog''': whether the item should be visible through fog or not. Default yes.&lt;br /&gt;
* '''submerge''': float, between 0 and 1: specifies how much of the image should be submerged. Gets multiplied with [[TerrainWML|[terrain]]]&amp;lt;nowiki/&amp;gt;submerge. Default 0.&lt;br /&gt;
* '''z_order''': float: defines the order the items get drawn in. Default 0.&lt;br /&gt;
* '''redraw''': (boolean yes|no, default: yes): If no, disables implicit calls to [[InterfaceActionsWML#.5Bredraw.5D|[redraw]]] when placing the items.&lt;br /&gt;
* '''[filter_team]''': {{DevFeature1.15|0}} A [[StandardSideFilter]]. Set '''team_name''' to the union of all '''[side]team_name''' attributes of all sides that match the SSF. ([https://github.com/wesnoth/wesnoth/pull/3533 #3533])&lt;br /&gt;
* {{DevFeature1.15|0}} If both '''team_name''' and '''[filter_team]''' are set, '''team_name''' is ignored.&lt;br /&gt;
&lt;br /&gt;
=== [remove_item] ===&lt;br /&gt;
Removes any graphical items on a given hex.&lt;br /&gt;
* [[StandardLocationFilter]]: the hexes to remove items from&lt;br /&gt;
* '''image''': if specified, only removes the given item if one of its 'image', 'halo' or 'name' attributes is exactly this value. (for 'halo' and 'image' this in particular means that the image name must include any [[ImagePathFunctions|image path functions]] appended to the original image name.)&lt;br /&gt;
&lt;br /&gt;
=== [print] ===&lt;br /&gt;
Displays a message across the screen. The message will disappear after a certain time, or when another [print] tag is encountered.&lt;br /&gt;
* '''text''': (translatable) the text to display. Can be an empty string to remove a previous message without showing a new one.&lt;br /&gt;
* '''size''': (default=12) the pointsize of the font to use&lt;br /&gt;
* '''duration''': the length of time to display the text for.&lt;br /&gt;
** (Before 1.15.4) This is measured in the number of 'frames', and the default is 50. A frame in Wesnoth is usually displayed for around 30ms.&lt;br /&gt;
** {{DevFeature1.15|4}} This is measured in milliseconds. Don't use the default value, because it's a mere 50ms.&lt;br /&gt;
** {{DevFeature1.15|14}} The default is 5000 milliseconds.&lt;br /&gt;
** {{DevFeature1.15|14}} The string '''unlimited''' displays the text until it's removed by another [print] tag.&lt;br /&gt;
* '''color''': (default '''0,0,0''') three comma-separated values giving the red, green and blue values (0-255).&lt;br /&gt;
* '''red''', '''green''', '''blue''': deprecated, use color=0,0,0 instead.&lt;br /&gt;
&lt;br /&gt;
=== [move_unit_fake] ===&lt;br /&gt;
Moves an image of a unit along a certain path on the map. The path does not need to be a continuous list of adjacent hexes, so for example only the start and end points can be given, in which case the straightest line between those points will be calculated and used.&lt;br /&gt;
* '''type''': the type of the unit whose image to use&lt;br /&gt;
* '''x''': a comma-separated list of x locations to move along&lt;br /&gt;
* '''y''': a comma-separated list of y locations to move along (x and y values are matched pairs)&lt;br /&gt;
* '''side''': the side of the fake unit, used for team-coloring the fake unit&lt;br /&gt;
* '''gender''': the gender of the fake unit. Example: gender=female&lt;br /&gt;
* '''variation''': the variation of the fake unit. Example: variation=undead&lt;br /&gt;
* '''image_mods''': [[ImagePathFunctions|image path functions]] sequence to be applied on the fake unit.&lt;br /&gt;
* '''force_scroll''':  Whether to scroll the map or not even when [[#.5Block_view.5D|[lock_view]]] is in effect or ''Follow Unit Actions'' is disabled in ''Advanced Preferences''. Defaults to ''yes'' starting with version '''1.11.6'''; the attribute did not exist in previous versions and this action behaved as if ''no'' was passed instead.&lt;br /&gt;
&lt;br /&gt;
=== [move_units_fake] ===&lt;br /&gt;
moves multiple images of units along paths on the map. These units are moved in lockstep.&lt;br /&gt;
* '''force_scroll''': {{DevFeature1.15|0}} Has the same meaning as in [move_unit_fake] but a different default.&lt;br /&gt;
* '''[fake_unit]''': A fake unit to move&lt;br /&gt;
** '''type''': the type of unit whose image to use&lt;br /&gt;
** '''x''': a comma-separated list of x locations to move along&lt;br /&gt;
** '''y''': a comma-separated list of y locations to move along (x and y values are matched pairs)&lt;br /&gt;
** '''side''': the side of the fake unit, used for team-coloring the fake unit&lt;br /&gt;
** '''skip_steps''': the number of steps to skip before this unit starts moving&lt;br /&gt;
&lt;br /&gt;
=== [hide_unit] ===&lt;br /&gt;
Temporarily prevents the engine from displaying the given unit. The unit does not become invisible, as it would be with the '''[hides]''' ability; it is still the same plain unit, but without an image. Useful in conjunction with '''[move_unit_fake]''': to move a leader unit into position on-screen. Until 1.8 each '''[hide_unit]''' tag only hides one unit.&lt;br /&gt;
* [[StandardUnitFilter]]: All matching units will be hidden&lt;br /&gt;
&lt;br /&gt;
=== [unhide_unit] ===&lt;br /&gt;
Stops the currently hidden units from being hidden.&lt;br /&gt;
* [[StandardUnitFilter]]: Only the matching units will be unhidden&lt;br /&gt;
&lt;br /&gt;
=== [lock_view] ===&lt;br /&gt;
Locks gamemap view scrolling for human players, so they cannot scroll the gamemap view until it is unlocked. WML or Lua actions such as '''[scroll_to]''' will continue to work normally, as they ignore this restriction; the locked/unlocked state is preserved when saving the current game.&lt;br /&gt;
&lt;br /&gt;
This feature is generally intended to be used in cutscenes to prevent the player scrolling away from scripted actions.&lt;br /&gt;
&lt;br /&gt;
{{DevFeature1.13|8}} This now also blocks the player from zooming the gamemap view. WML or Lua zoom will continue to work normally.&lt;br /&gt;
&lt;br /&gt;
=== [unlock_view] ===&lt;br /&gt;
Unlocks gamemap view scrolling for human players.&lt;br /&gt;
&lt;br /&gt;
=== [scroll] ===&lt;br /&gt;
Scroll a certain number of pixels in a given direction. Useful for earthquake/shaking effects.&lt;br /&gt;
* '''x''', '''y''': the number of pixels to scroll along the x and y axis&lt;br /&gt;
* '''side''': the side or sides for which this should happen. By default, the [scroll] happens for everyone.&lt;br /&gt;
* '''[filter_side]''': a [[StandardSideFilter]] to select the sides for which this should happen. By default, the [scroll] happens for everyone.&lt;br /&gt;
&lt;br /&gt;
=== [scroll_to] ===&lt;br /&gt;
Scroll to a given hex&lt;br /&gt;
* [[StandardLocationFilter]], do not use a [filter_location] sub-tag. If more than one location matches the filter, only the first matching location will be used.&lt;br /&gt;
* '''check_fogged''': whether to scroll even to locations covered in fog or shroud. Possible values ''yes'' (don't scroll to fog) and ''no'' (scroll even to fog), with ''no'' as the default.&lt;br /&gt;
* '''immediate''': whether to instantly warp to the target hex regardless of the scroll speed setting in Preferences (defaults to ''no'').&lt;br /&gt;
* '''highlight''': {{DevFeature1.13|5}} Whether to highlight the hex being scrolled to (defaults to ''no'').&lt;br /&gt;
* '''side''': the side or sides for which this should happen. By default, the [scroll_to] happens for everyone.&lt;br /&gt;
* '''[filter_side]''': a [[StandardSideFilter]] to select the sides for which this should happen. By default, the [scroll_to] happens for everyone.&lt;br /&gt;
&lt;br /&gt;
=== [scroll_to_unit] ===&lt;br /&gt;
Scroll to a given unit&lt;br /&gt;
* [[StandardUnitFilter]]; do not use a [filter] subtag.&lt;br /&gt;
* '''check_fogged''': whether to scroll even to locations covered in fog or shroud. Possible values ''yes'' (don't scroll to fog) and ''no'' (scroll even to fog), with ''no'' as the default.&lt;br /&gt;
* '''immediate''': whether to instantly warp to the target hex regardless of the scroll speed setting in Preferences (defaults to ''no'').&lt;br /&gt;
* '''highlight''': {{DevFeature1.13|5}} Whether to highlight the hex the unit is on (defaults to ''no'').&lt;br /&gt;
* '''for_side''': the side or sides for which this should happen. By default, the [scroll_to_unit] happens for everyone.&lt;br /&gt;
* '''[for_side]''': a [[StandardSideFilter]] to select the sides for which this should happen. By default, the [scroll_to_unit] happens for everyone.&lt;br /&gt;
&lt;br /&gt;
=== [select_unit] ===&lt;br /&gt;
Selects a given unit.&lt;br /&gt;
* [[StandardUnitFilter]]: The first unit found will be selected.&lt;br /&gt;
* '''fire_event''': whether a ''select'' event should be triggered or not (def. ''no''). (Note that select events aren't multiplayer save.)&lt;br /&gt;
* '''highlight''': whether the unit's current hex should be highlighted (def. ''yes'').&lt;br /&gt;
&lt;br /&gt;
'''Note:''' fire_event does not appear to work in 1.14 or 1.16.&lt;br /&gt;
&lt;br /&gt;
=== [sound]===&lt;br /&gt;
Plays a sound&lt;br /&gt;
* '''name''': the filename of the sound to play (in ''sounds/'' as .wav or .ogg). This can be a comma-separated list, from which one sound will be chosen randomly.&lt;br /&gt;
* '''repeat''': repeats the sound for a specified additional number of times (default=0)&lt;br /&gt;
&lt;br /&gt;
=== [sound_source] ===&lt;br /&gt;
Creates a sound source. &amp;quot;Sound sources&amp;quot; is a general name for a mechanism which makes possible for map elements to emit sounds according to some rules, where &amp;quot;map elements&amp;quot; can be specific locations or terrain types. For now, only sound sources tied to locations are supported.&lt;br /&gt;
* '''id''': a unique identification key of the sound source&lt;br /&gt;
* '''sounds''': a list of comma separated, randomly played sounds associated with the sound source&lt;br /&gt;
* '''delay''': a numerical value (in milliseconds) of the minimal delay between two playbacks of the source's sound if the source remains visible on the screen; if one scrolls out and back in, the source will be considered as ready to play&lt;br /&gt;
* '''chance''': a percentage (a value from 0 to 100) describing the chance of the source being activated every second after the delay has passed or when the source's location appears on the screen (note that it cannot play more than one file at the same time)&lt;br /&gt;
* '''check_fogged''': possible values ''yes'' and ''no'' - ''yes'' means the source will not play if its locations are fogged&lt;br /&gt;
* '''check_shrouded''': possible values ''yes'' and ''no'' - ''yes'' means the source will not play if its locations are shrouded&lt;br /&gt;
* '''x,y''': similar to x,y as found in a [[StandardLocationFilter]], these are the locations associated with the sound source&lt;br /&gt;
* '''fade_range''' (default = 3): distance in hexes that determines a &amp;quot;circular&amp;quot; area around the one specified by '''full_range''' where sound volume fades out linearly&lt;br /&gt;
* '''full_range''' (default = 14): distance in hexes that determines a &amp;quot;circular&amp;quot; area where source plays with full volume, relative to screen center&lt;br /&gt;
* '''loop''': number of times a sound sample should be looped if it stays visible. -1 means infinite (~65000)&lt;br /&gt;
&lt;br /&gt;
=== [story] ===&lt;br /&gt;
{{DevFeature1.13|8}}&lt;br /&gt;
&lt;br /&gt;
Shows the story screen.&lt;br /&gt;
* '''title''': Default title used if a part does not specify one — unlike the intro storyscreen, the scenario name is not used as a default title.&lt;br /&gt;
* '''[part]''', '''[if]''', '''[switch]''', '''[wml_message]''', '''[deprecated_message]''' : See [[IntroWML]].&lt;br /&gt;
&lt;br /&gt;
=== [remove_sound_source] ===&lt;br /&gt;
Removes a previously defined sound source.&lt;br /&gt;
* '''id''': the identification key of the sound source to remove&lt;br /&gt;
&lt;br /&gt;
=== [music] ===&lt;br /&gt;
Switches to playing different music&lt;br /&gt;
* '''name''': the filename of the music to play (in ''music/'' as .ogg)&lt;br /&gt;
* see [[MusicListWML]] for the correct syntax&lt;br /&gt;
&lt;br /&gt;
=== [volume] ===&lt;br /&gt;
Changes the game volume to a percent of the preferences volume for the game being played. Values can go from 0 to 100:  &lt;br /&gt;
* '''music''':  Changes the music volume.&lt;br /&gt;
* '''sound''':  Changes the sound volume.&lt;br /&gt;
&lt;br /&gt;
=== [color_adjust] ===&lt;br /&gt;
Adjust the color tint of terrain, by adjusting time-of-day coloring.&lt;br /&gt;
* '''red''', '''green''', '''blue''': values from -255 to 255, the amount to tint by for each color&lt;br /&gt;
&lt;br /&gt;
=== [screen_fade] ===&lt;br /&gt;
{{DevFeature1.17|6}}&lt;br /&gt;
&lt;br /&gt;
Overlay the game display with the given color, fading over the specified duration. This can be used for screen fade effects.&lt;br /&gt;
* '''red''', '''green''', '''blue''': values from 0 to 255, the final overlay color (defaults to 0,0,0)&lt;br /&gt;
* '''alpha''': value from 0 to 255, the strength of the effect. 0 means no effect and can be used to fade in. 255 means fully opaque and can be used to fully fade out to the given color. Intermediate values will end up with a partial overlay tint on the game screen.&lt;br /&gt;
* '''duration''': the length of time it will take to complete the fade, in milliseconds. If 0 the effect is immediate.&lt;br /&gt;
&lt;br /&gt;
=== [delay] ===&lt;br /&gt;
Pauses the game.&lt;br /&gt;
* '''time''': the time to pause in milliseconds&lt;br /&gt;
* '''accelerate ''' (boolean yes|no, default no): {{DevFeature1.13|0}} whether the delay is affected by acceleration. When [delay] is used to make an animation, this should be set to yes so that your animation matches the ones generated by the game.&lt;br /&gt;
&lt;br /&gt;
=== [redraw] ===&lt;br /&gt;
Redraws the screen (this normally isn't done during events, although some of the other interface actions cause the screen or parts of it to be redrawn).&lt;br /&gt;
* '''clear_shroud''' (boolean yes|no, default no): If yes, clears fog and shroud around existing units. Useful if you, for example, spawn friendly units in the middle of an event and want the shroud to update accordingly (otherwise units that spawn inside fog would remain invisible for the duration of the event, since the fog would not automatically get cleared around them).&lt;br /&gt;
* '''[[StandardSideFilter]]''': the sides for which to recalculate fog and shroud.&lt;br /&gt;
* '''side''': If used (forces clear_shroud=yes), clears fog and shroud for that side.&lt;br /&gt;
&lt;br /&gt;
=== [unit_overlay] ===&lt;br /&gt;
Sets an image that will be drawn over a particular unit, and follow it around&lt;br /&gt;
* [[StandardUnitFilter]]: All matching units will get the overlay (do not use [filter])&lt;br /&gt;
* '''image''': the image to place on the unit&lt;br /&gt;
* '''object_id''': object id to use, defaults to the '''image''' key with an &amp;quot;overlay_&amp;quot; prefix; this allows using [[DirectActionsWML#.5Bremove_object.5D|'''[remove_object]''']]&lt;br /&gt;
* '''duration''': object duration&lt;br /&gt;
&lt;br /&gt;
=== [remove_unit_overlay] ===&lt;br /&gt;
Removes a particular overlayed image from a unit&lt;br /&gt;
* [[StandardUnitFilter]]: The overlay will get removed from all matching units (do not use [filter])&lt;br /&gt;
* '''image''': the image to remove from the unit&lt;br /&gt;
* '''object_id''': object id to use&lt;br /&gt;
Using [[DirectActionsWML#.5Bremove_object.5D|'''[remove_object]''']] is also possible, see https://github.com/wesnoth/wesnoth/commit/26c2f941f2bcdd89528481e114c0375ad2a46271&lt;br /&gt;
&lt;br /&gt;
=== [animate_unit] ===&lt;br /&gt;
Uses an animation of a unit to animate it on screen (if the unit has the corresponding animation).&lt;br /&gt;
* '''flag''': The key to find the custom animation in the unit description (see the '''[extra_anim]''' description in [[AnimationWML]]). Standard animations can be triggered with the following keywords: ''leading recruited standing idling levelout levelin healing healed poisoned movement defend attack death victory pre_teleport post_teleport''&lt;br /&gt;
* '''[filter]''' with a [[StandardUnitFilter]] as argument, see [[FilterWML]]. By default, the unit at the event location will be animated. You can use this tag to choose any other unit to animate.&lt;br /&gt;
* '''[primary_attack]''': If this tag is not present, the filter for animation will be triggered with no attack. If it is here, all attacks from the unit will be filtered, and a matching one will be used to filter the animation. Takes a weapon filter as argument, see [[FilterWML]].&lt;br /&gt;
* '''[secondary_attack]''': Similar to '''[primary_attack]'''. May be needed to trigger a defense animation correctly, if there are more than one animations available for the defending unit.&lt;br /&gt;
* '''hits''': yes/no/hit/miss/kill: which according variation of a attack/defense animation shall be chosen (required)&lt;br /&gt;
* '''text''': a text to hover during the animation &lt;br /&gt;
* '''male_text''', '''female_text''': {{DevFeature1.13|2}} (translatable) gender-specific versions of the above&lt;br /&gt;
* '''red''': red value for the text color (0-255)&lt;br /&gt;
* '''green''': green value for the text color&lt;br /&gt;
* '''blue''': blue value for the text color&lt;br /&gt;
* '''with_bars''': yes/no: whether to display the status bars during the animation (e.g. the hitpoint bar)&lt;br /&gt;
* '''[animate]''': a sub block with the same syntax as '''[animate_unit]''' except that the '''[filter]''' block is mandatory to find the unit. This block will find and animate another unit simultaneously.&lt;br /&gt;
* '''[facing]''': a [[StandardLocationFilter]] specifying what hex the unit should be facing when animated&lt;br /&gt;
&lt;br /&gt;
=== [label] ===&lt;br /&gt;
Places a label on the map.&lt;br /&gt;
* '''x''', '''y''': the location of the label. {{DevFeature1.13|1}} (only for [event][label]: full [[StandardLocationFilter|SLF]] support)&lt;br /&gt;
* '''text''': what the label should say. If you put an empty string &amp;lt;code&amp;gt;&amp;quot;&amp;quot;&amp;lt;/code&amp;gt; as an argument, the label will be completely removed. Use this method if you want to remove a specific label from any location.&lt;br /&gt;
* '''team_name''': if specified, the label will only be visible to the given team.&lt;br /&gt;
* '''color''': color of the label. The format is r,g,b; r, g and b are numbers between 0 and 255. When you use Pango markup in the text, you cannot use this, but in that case you could colorize the text via Pango markup.&lt;br /&gt;
* '''visible_in_fog''': whether the label should be visible through fog or not. Default yes.&lt;br /&gt;
* '''visible_in_shroud''': whether the label should be visible through shroud or not. Default no.&lt;br /&gt;
* '''immutable''': whether this label is protected from being removed or changed by players. Default yes.&lt;br /&gt;
* '''category''': the Show/Hide Labels dialog allows showing/hiding all labels of a given category by toggling a checkbox.&lt;br /&gt;
* '''tooltip''': A tooltip visible when mouseovering the hex the label is on&lt;br /&gt;
* '''side''': the number of the side that placed the label. Can be 0 for labels placed by WML.&lt;br /&gt;
&lt;br /&gt;
=== [floating_text]===&lt;br /&gt;
Floats text (similar to the damage and healing numbers) on the given locations.&lt;br /&gt;
* [[StandardLocationFilter]]: the text will be floated on all matching locations simultaneously (do not use [filter] unless you intend to match one or more units).&lt;br /&gt;
* '''text''': the text to display.&lt;br /&gt;
&lt;br /&gt;
The default text color is &amp;lt;span style=&amp;quot;color: #6b8cff;&amp;quot;&amp;gt;'''#6b8cff'''&amp;lt;/span&amp;gt;. To change the color, use [[#Formatting|Pango markup]]. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# Float some golden yellow text at 20,20.&lt;br /&gt;
[floating_text]&lt;br /&gt;
   x,y=20,20&lt;br /&gt;
   text=&amp;quot;&amp;lt;span color='#cccc33'&amp;gt;&amp;quot; + _ &amp;quot;Your text here&amp;quot; + &amp;quot;&amp;lt;/span&amp;gt;&amp;quot;&lt;br /&gt;
[/floating_text]&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== [deprecated_message] ===&lt;br /&gt;
Shows a deprecated message in the message area, this feature is only intended to be used to warn about deprecated macros in mainline. The message is not translatable.&lt;br /&gt;
* '''message''': the message to show.&lt;br /&gt;
* '''level''': {{DevFeature1.13|10}} The deprecation level, a number from 1 to 3.&lt;br /&gt;
* '''what''': {{DevFeature1.13|10}} The name of the thing being deprecated. Use this instead of '''message''' if possible; a stock message will be generated from it. Use '''message''' only if more information is required; it will be appended to the stock message. This should not be translatable&lt;br /&gt;
* '''version''': {{DevFeature1.13|10}} For deprecation levels 2 and 3, this indicates the version in which the feature could be removed. It does ''not'' indicate the version in which it became deprecated. &lt;br /&gt;
&lt;br /&gt;
The meanings of the deprecation levels are as follows:&lt;br /&gt;
&lt;br /&gt;
# Deprecated, but will only be removed if absolutely necessary. The '''version''' key is ignored.&lt;br /&gt;
# It will be removed no earlier than a specified version.&lt;br /&gt;
# It will be removed in the next stable version&lt;br /&gt;
# It has already been removed, leaving just a stub to inform users of how to update their code.&lt;br /&gt;
&lt;br /&gt;
Note that as of 1.13.11, deprecation messages show only in the log, not in the chat message area. The '''message''' can be translatable, but does not need to be.&lt;br /&gt;
&lt;br /&gt;
=== [wml_message] ===&lt;br /&gt;
Outputs a message to Wesnoth's console output. Intended for campaign designers to output silent text to the console, without annoying the player; then, that text might contain information useful for later bug-reporting. WML wrapper of [[LuaAPI/wesnoth#wesnoth.log]], see the link for more description.&lt;br /&gt;
* '''message''': the message to show.&lt;br /&gt;
* '''to_chat''': controls whether message is visible in chat, though logger=wml means message is visible anyways. Default ''no''.&lt;br /&gt;
* '''logger''': one of '''info''', '''debug''', '''warning''', '''error''', '''wml'''. Default ''info''.&lt;br /&gt;
&lt;br /&gt;
=== [test_condition] ===&lt;br /&gt;
&lt;br /&gt;
{{DevFeature1.13|2}}&lt;br /&gt;
&lt;br /&gt;
Evaluates the contained conditional tags. If they evaluate to the expected value, it prints out a message to the console explaining which part of the condition caused this result in a way similar to [wml_message]. This can be used if your conditional test is failing and you're not sure why.&lt;br /&gt;
&lt;br /&gt;
* '''result''': Whether you expect the conditions to fail or succeed. If no (the default), a message will be printed if the conditional tags fail. If yes, a message will instead be printed if the conditional tags pass.&lt;br /&gt;
* '''logger''': Same as for [wml_message]. Defaults to &amp;quot;warning&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
=== [open_help] ===&lt;br /&gt;
Opens the in-game help.&lt;br /&gt;
* '''topic''': the id of the topic to open&lt;br /&gt;
&lt;br /&gt;
Examples of ids:&lt;br /&gt;
* unit_Mage&lt;br /&gt;
* unit_Dark Adept&lt;br /&gt;
* weaponspecial_charge&lt;br /&gt;
* terrain_human_castle&lt;br /&gt;
&lt;br /&gt;
The engine will print the topic ids if run from the command line with the ''--log-debug=help'' option.&lt;br /&gt;
&lt;br /&gt;
=== [show_objectives] ===&lt;br /&gt;
refreshes the objectives defined by [objectives] and its [show_if] tags, and displays them. (It is also called whenever the user explicitly asks for the objectives; this matters only if the tag was overridden by a [[LuaWML#register_wml_action|Lua]] script.)&lt;br /&gt;
* '''side''': the side to show the objectives. If not set, all sides are used.&lt;br /&gt;
* '''[[StandardSideFilter]]''' tags and keys: Tag affects the matching sides instead of just all or the one given by the integer value of the side= key.&lt;br /&gt;
&lt;br /&gt;
=== [chat] ===&lt;br /&gt;
Displays a message in the chat area, not visible for observers. Alternative unconditionally visible for everyone: [[LuaWML:Display#wesnoth.message]]. {{DevFeature1.13|9}} can be visible for observers.&lt;br /&gt;
* '''speaker''': (default=&amp;quot;WML&amp;quot;) A string for the name of the sender of the message.&lt;br /&gt;
* '''message''': The message that should be displayed.&lt;br /&gt;
* '''observable''' (boolean yes|no, default yes): {{DevFeature1.13|9}} Whether the message is displayed for observers.&lt;br /&gt;
* '''[[StandardSideFilter]]''' tags and keys as argument; if the same client controls multiple sides that match, then the message will only be displayed once.&lt;br /&gt;
&lt;br /&gt;
=== [zoom] ===&lt;br /&gt;
&lt;br /&gt;
{{DevFeature1.13|8}}&lt;br /&gt;
&lt;br /&gt;
Changes the zoom level of the map.&lt;br /&gt;
&lt;br /&gt;
* '''factor''': The new zoom factor, measured as a multiple of the base zoom.&lt;br /&gt;
* '''relative''': If yes, zoom relative to current zoom level. Otherwise, set the absolute zoom level. Default no.&lt;br /&gt;
&lt;br /&gt;
== Useful Macros ==&lt;br /&gt;
There are some predefined macros that you find useful for interface 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;
* '''{HIGHLIGHT_UNIT}''' Highlight a unit on the map. Use this to show important units&lt;br /&gt;
* '''{HIGHLIGHT_IMAGE}''' Places and highlights an image on the map. Use this to show important items or locations&lt;br /&gt;
* '''{SET_IMAGE}''' Places an image on the map which has no other function.&lt;br /&gt;
* '''{QUAKE &amp;lt;soundfile&amp;gt;}''' Creates a tremor-like screenshake and plays &amp;lt;soundfile&amp;gt;. For example, '''{QUAKE (rumble.ogg)}'''.&lt;br /&gt;
* '''{FLASH_WHITE}''' Flash the screen white momentarily. You can also replace WHITE with RED, BLUE or GREEN for a different colour.&lt;br /&gt;
&lt;br /&gt;
== See Also ==&lt;br /&gt;
* [[DirectActionsWML]]&lt;br /&gt;
* [[InternalActionsWML]]&lt;br /&gt;
* [[EventWML]]&lt;br /&gt;
* [[ReferenceWML]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category: WML Reference]]&lt;br /&gt;
[[Category: ActionsWML]]&lt;/div&gt;</summary>
		<author><name>Soliton</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.wesnoth.org/index.php?title=InterfaceActionsWML&amp;diff=74418</id>
		<title>InterfaceActionsWML</title>
		<link rel="alternate" type="text/html" href="https://wiki.wesnoth.org/index.php?title=InterfaceActionsWML&amp;diff=74418"/>
		<updated>2025-07-02T12:02:09Z</updated>

		<summary type="html">&lt;p&gt;Soliton: /* [item] */ move example where it belongs&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{WML Tags}}&lt;br /&gt;
== Interface actions ==&lt;br /&gt;
&lt;br /&gt;
Part of [[ActionWML]], interface actions are actions that do not have a direct effect on gameplay;&lt;br /&gt;
instead, they show something to the player.  The main interface tags&lt;br /&gt;
are '''[message]''' and '''[objectives]''', but several other tags affect&lt;br /&gt;
the interface also.&lt;br /&gt;
&lt;br /&gt;
== [inspect] ==&lt;br /&gt;
This user interface instantly displays the gamestate inspector dialog at the current scenario state (the same one that can be brought up with [[CommandMode|the ''':inspect''' command]]), which can be used to inspect the values of WML variables, AI configuration, recall lists, and more.&lt;br /&gt;
&lt;br /&gt;
* '''name''': optional attribute to specify the name of this gamestate inspector dialog. It is just a label to help differentiate between different invocations of gamestate inspector dialog.&lt;br /&gt;
&lt;br /&gt;
== [message] ==&lt;br /&gt;
The most commonly used interface action is [message], which displays a message to the user in a dialog box. It can also be used to take input from the user.&lt;br /&gt;
&lt;br /&gt;
The following key/tags are accepted for [message]:&lt;br /&gt;
* [[StandardUnitFilter]]: The unit whose profile and name are displayed. Do not use a [filter] tag. If no unit matching this filter is found, the message is not displayed (The unit has probably been killed).&amp;lt;br&amp;gt;[message] elements should be constructed so that it is either guaranteed that a certain unit is alive, or so that dialog flows smoothly even if the message isn't displayed.&lt;br /&gt;
&lt;br /&gt;
* '''speaker''': an alternative to standard unit filter. You may specify as the value of the speaker attribute a unit id or any of the following special values:&lt;br /&gt;
** '''narrator''': the dialog box is displayed without a caption for the unit speaking or a unit image&lt;br /&gt;
** '''unit''': the primary unit for the event is speaking&lt;br /&gt;
** '''second_unit''': the secondary unit for the event is speaking&lt;br /&gt;
&lt;br /&gt;
* '''message''': (translatable) the text to display to the right of the image. ''message'' is sometimes multiple lines; if it is, be sure to use quotes(''' ' ''' or ''' &amp;quot; ''')&lt;br /&gt;
* '''male_message''', '''female_message''': {{DevFeature1.13|2}} (translatable) Used instead of ''message'' if the unit's gender matches. Never used if there is no unit (ie ''speaker=narrator''). {{DevFeature1.13|6}} This matches the primary unit, not the secondary unit.&lt;br /&gt;
* '''wait_description''': {{DevFeature1.13|2}} the description of this message displayed when other players in a mp game wait for one player doing input in a [message] (with [option]s or [text_input]).&lt;br /&gt;
* '''[show_if]''': if present then this message will only be displayed if the conditional statement in this tag is passed (see [[ConditionalActionsWML#Condition_Tags|ConditionalActionsWML]])&lt;br /&gt;
* '''side_for''': (default: all sides) comma-separated list of sides for who message is shown. This will &amp;lt;b&amp;gt;not&amp;lt;/b&amp;gt; work with messages that take user input ([option]/[text_input]), which can only ever be shown to the current player. {{DevFeature1.13|0}} side_for= is now also accepted for messages with user input, it specifies on which side the message is shown (defaults to the currently playing side). For messages with input it does not accept a comma seperated list only a single number.&lt;br /&gt;
* '''image''': (default: profile image of speaker) the image to display to the left of the message text. Append ~RIGHT() if you want the image to appear on the right side. &lt;br /&gt;
** {{DevFeature1.13|0}} &amp;lt;b&amp;gt;none:&amp;lt;/b&amp;gt; display no image&lt;br /&gt;
* '''mirror''': {{DevFeature1.13|5}} whether to mirror the image specified by the '''image''' attribute.&lt;br /&gt;
* '''second_image''': {{DevFeature1.13|6}} same as the '''image''' attribute, but the image is displayed on the right of the message text. {{DevFeature1.17|7}} not working anymore, but there is plan to fix it eventually https://github.com/wesnoth/wesnoth/issues/8770&lt;br /&gt;
* '''second_mirror''': {{DevFeature1.13|6}} same as '''mirror''', but for the '''second_image''' attribute.&lt;br /&gt;
* '''image_pos''': {{DevFeature1.13|5}} whether to show the image on the left or right; supercedes the use of ~RIGHT() described above&lt;br /&gt;
* '''caption''': (default: name of speaker) the caption to display beside the image. Name to be displayed. Note: use a translation mark to avoid wmllint errors.&lt;br /&gt;
* '''scroll''': Boolean specifying whether the game view should scroll to the speaking unit. Defaults to ''yes''.&lt;br /&gt;
* '''highlight''': {{DevFeature1.13|5}} Boolean specifying whether to highlight the speaker. Defaults to ''yes''.&lt;br /&gt;
* '''sound''': a sound effect (wav file) to play as the message is displayed. This can be a comma-separated list, from which one will be randomly chosen.&lt;br /&gt;
* '''voice''', '''male_voice''', '''female_voice''': {{DevFeature1.13|?}} a sound to be played as the message is displayed. This can also be a comma-separated list, from which one will be randomly chosen. This is intended for voiceovers for the message. The gendered forms are applied the same as for '''message'''. They are never used when the speaker is the narrator - only '''voice''' is used in that case.&lt;br /&gt;
* {{anchor|message-option|'''[option]'''}}: No '''[option]''' elements have to be used. If '''[option]''' elements are present, then each option will be displayed in a menu for the user to select one option. ''Note: Messages with options will not be shown at all in prestart events''&lt;br /&gt;
** '''message''': (translatable) the text displayed for the option. {{DevFeature1.15|1}} This is now a synonym for '''description='''.&lt;br /&gt;
** '''image''', '''label''', '''description''', '''default''': See [[DescriptionWML#WML_Format|DescriptionWML]].&lt;br /&gt;
** '''value''': {{DevFeature1.13|?}} Gives the option a value to be stored in a variable.&lt;br /&gt;
** '''[show_if]''': if present then this option will only be displayed if the conditional statement in this tag is passed (see [[ConditionalActionsWML#Condition_Tags|ConditionalActionsWML]])&lt;br /&gt;
** '''[command]''': an element containing actions which are executed if the option is selected.&lt;br /&gt;
* '''variable''': {{DevFeature1.13|?}} If present, either the index or the value of the chosen option will be stored in the specified variable. Option indexing starts from 1. If option has '''[show_if]''' condition evaluated as false, then it is hidden and excluded from the indexing.&lt;br /&gt;
* {{anchor|message-text_input|'''[text_input]'''}}: there can be only one [text_input] tag. this adds a text input field to the message. ''Note: Messages with text_input will not be shown at all in prestart events''&lt;br /&gt;
** '''variable''': the variable that the user's input will be written to&lt;br /&gt;
** '''label''': a text label to the left of the input field&lt;br /&gt;
** '''max_length''': the maximum number of characters that may be typed into the field&lt;br /&gt;
** '''text''': text that is written into the field in the beginning&lt;br /&gt;
* Check [[EventWML#Multiplayer_safety]] to find out in which events you can safely use '''[option]''' and '''[text_input]''' without causing OOS.&lt;br /&gt;
&lt;br /&gt;
=== Formatting ===&lt;br /&gt;
'''[message]''' and other tags such as unit names (user_description), objectives, and floating text can make use of [https://docs.gtk.org/Pango/pango_markup.html#pango-markup Pango markup formatting codes].&lt;br /&gt;
&lt;br /&gt;
Prefer to use single quotes (') instead of double quotes (&amp;quot;) within the formatting string, as double quotes would need to be escaped in WML (&amp;quot;&amp;quot;). Escaping markup can be done with [https://github.com/wesnoth/wesnoth/blob/9daa10a9f27c5a95520e871417bbd72aa52aa688/src/font/pango/escape.hpp#L38-L42 HTML entities].&lt;br /&gt;
&lt;br /&gt;
For example, if you wanted to write &amp;quot;You are victorious!&amp;quot; in large, italic, gold letters, you might write it this way:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&amp;lt;span color='#BCB088' size='large' font-style='italic'&amp;gt;You are victorious!&amp;lt;/span&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
These are the codes taken from the Pango markup formatting guide:&lt;br /&gt;
&lt;br /&gt;
*'''font''', '''font_desc''': A font description string, such as &amp;quot;Sans Italic 12&amp;quot;.&lt;br /&gt;
*'''font_family''', '''face''': A font family name.&lt;br /&gt;
*'''font_size''', '''size''': Font size in 1024ths of a point, or one of the absolute sizes 'xx-small', 'x-small', 'small', 'medium', 'large', 'x-large', 'xx-large', or one of the relative sizes 'smaller' or 'larger'.&lt;br /&gt;
*'''font_style''', '''style''': One of 'normal', 'oblique', 'italic'.&lt;br /&gt;
*'''font_weight''', '''weight''': One of 'ultralight', 'light', 'normal', 'bold', 'ultrabold', 'heavy', or a numeric weight.&lt;br /&gt;
*'''font_variant''', '''variant''': One of 'normal' or 'smallcaps'.&lt;br /&gt;
*'''font_stretch''', '''stretch''': One of 'ultracondensed', 'extracondensed', 'condensed', 'semicondensed', 'normal', 'semiexpanded', 'expanded', 'extraexpanded', 'ultraexpanded'.&lt;br /&gt;
*'''foreground''', '''fgcolor''', '''color''': An RGB color specification such as '#00FF00' or a color name such as 'red'. The full list of color names may be found in Pango's [https://github.com/GNOME/pango/blob/main/tools/rgb.txt rgb.txt] file.&lt;br /&gt;
*'''background, bgcolor''': An RGB color specification such as '#00FF00' or a color name such as 'red'.&lt;br /&gt;
*'''underline''': One of 'none', 'single', 'double', 'low', 'error'.&lt;br /&gt;
*'''underline_color''': The color of underlines; an RGB color specification such as '#00FF00' or a color name such as 'red'.&lt;br /&gt;
*'''rise''': Vertical displacement, in 10000ths of an em. Can be negative for subscript, positive for superscript.&lt;br /&gt;
*'''strikethrough''': 'true' or 'false' whether to strike through the text.&lt;br /&gt;
*'''strikethrough_color''': The color of strikethrough lines; an RGB color specification such as '#00FF00' or a color name such as 'red'&lt;br /&gt;
*'''fallback''': 'true' or 'false' whether to enable fallback. If disabled, then characters will only be used from the closest matching font on the system. No fallback will be done to other fonts on the system that might contain the characters in the text. Fallback is enabled by default. Most applications should not disable fallback.&lt;br /&gt;
*'''letter_spacing''': Inter-letter spacing in 1024ths of a point.&lt;br /&gt;
*'''gravity''': One of 'south', 'east', 'north', 'west', 'auto'.&lt;br /&gt;
*'''gravity_hint''': One of 'natural', 'strong', 'line'.&lt;br /&gt;
&lt;br /&gt;
The following pango attributes are also available directly as attributes of the '''[message]''' tag:&lt;br /&gt;
{{DevFeature1.13|4}}&lt;br /&gt;
&lt;br /&gt;
*'''font'''&lt;br /&gt;
*'''font_family'''&lt;br /&gt;
*'''font_size'''&lt;br /&gt;
*'''font_style'''&lt;br /&gt;
*'''font_weight'''&lt;br /&gt;
*'''font_variant'''&lt;br /&gt;
*'''font_stretch'''&lt;br /&gt;
*'''color'''&lt;br /&gt;
*'''bgcolor'''&lt;br /&gt;
*'''underline'''&lt;br /&gt;
*'''underline_color'''&lt;br /&gt;
*'''rise'''&lt;br /&gt;
*'''strikethrough'''&lt;br /&gt;
*'''strikethrough_color'''&lt;br /&gt;
*'''fallback'''&lt;br /&gt;
*'''letter_spacing'''&lt;br /&gt;
*'''gravity'''&lt;br /&gt;
*'''gravity_hint'''&lt;br /&gt;
&lt;br /&gt;
== [objectives] ==&lt;br /&gt;
The other tag used for plot development is '''[objectives]'''.&lt;br /&gt;
The '''[objectives]''' tag overwrites any previously set objectives,&lt;br /&gt;
and displays text which should describe the objectives of the scenario.&lt;br /&gt;
Scenario objectives are displayed on the player's first turn after the tag is used,&lt;br /&gt;
or as part of the event if it triggers during that player's turn.&lt;br /&gt;
Objectives can also be accessed at any time in a scenario using the&lt;br /&gt;
&amp;quot;Scenario Objectives&amp;quot; game menu option, making this tag useful for&lt;br /&gt;
scenario-specific information that the player may need to refer to during play.&lt;br /&gt;
&lt;br /&gt;
Attributes of '''[objectives]''':&lt;br /&gt;
* '''side''': Default '0'. The side to set the objectives for. A value of 0 sets objectives for all sides. note: There are side-specific objectives and default objectives, which are used in case a side doesn't have specific ones. Specifying 0 sets the default ones.&lt;br /&gt;
* '''[[StandardSideFilter]]''' tags and keys: Sets the objectives of all matching sides to these passed specifications (the rest of this [objectives] tag). If no sides (such as when passing side=0) or all sides match, sets the default objectives, and the side specific ones for the matching sides otherwise.&lt;br /&gt;
* '''bullet''': Default '• '. Replaces the default bullet, with whatever is passed, for all objectives, gold carryover notes, and notes defined with [note].&lt;br /&gt;
* '''summary''': Displayed first in the objectives text, this should describe the basic objective for the overall scenario.  Can be omitted.&lt;br /&gt;
* '''note''': Displayed last in the objectives text, this is sometimes used for hints or additional information.  Can be omitted.&lt;br /&gt;
* '''victory_string''': Default ' _ &amp;quot;Victory:&amp;quot;', this text precedes the victory objectives. Can be set to &amp;quot;&amp;quot; too.&lt;br /&gt;
* '''defeat_string''': Default ' _ &amp;quot;Defeat:&amp;quot;', this text precedes the defeat objectives. Can be set to &amp;quot;&amp;quot; too.&lt;br /&gt;
* '''gold_carryover_string''': Default ' _ &amp;quot;Gold carryover:&amp;quot;', this text precedes the gold carryover information.&lt;br /&gt;
* '''notes_string''': Default ' _ &amp;quot;Notes:&amp;quot;', this text precedes the notes.&lt;br /&gt;
* '''silent''': Default: not present. If set to &amp;quot;yes&amp;quot;, the objectives are silently changed. Else, they will be shown to the user when appropriate.&lt;br /&gt;
* '''delayed_variable_substitution''': {{DevFeature1.13|8}} If set to yes, any variables or [insert_tag] are not substituted right away. Instead, they are substituted whenever the objectives are actually viewed.&lt;br /&gt;
&lt;br /&gt;
Tags of '''[objectives]''':&lt;br /&gt;
* {{anchor|objectives-objective|'''[objective]'''}}: describes a win or loss condition. Most scenarios have multiple win or loss conditions, so use a separate [objective] subtag for each line; this helps with translations.&lt;br /&gt;
** '''bullet''': Default '• ' or whatever is set in the parent [objectives] block. Replaces the default bullet, with whatever is provided, for the objective defined by the [objective] block.&lt;br /&gt;
** '''red''': Default '0' for winning objectives, '255' for losing objectives. Overrides the default red coloring of the entire objective, including the bullet.&lt;br /&gt;
** '''green''': Default '255' for winning objectives, '0' for losing objectives. Overrides the default green coloring of the entire objective, including the bullet.&lt;br /&gt;
** '''blue''': Default '0'. Overrides the default blue coloring of the entire objective, including the bullet.&lt;br /&gt;
** '''description''': text for the specific win or loss condition.&lt;br /&gt;
** '''caption''': a text which will be displayed above the ''description''. This can be used to display a subcategory of objectives below ''victory_string'' or ''defeat_string''.&lt;br /&gt;
** '''condition''': The color and placement of the text. Values are 'win'(colored green, placed after ''victory_string'') and 'lose'(colored red, placed after ''defeat_string'').&lt;br /&gt;
** '''show_turn_counter''': If set to yes, displays the number of turns remaining in the scenario. Default is no.&lt;br /&gt;
** '''[show_if]''': A condition that disables the objective if it doesn't hold. Conditional objectives are refreshed at '''[show_objectives]''' time only, or when manually opening the scenario objectives.&lt;br /&gt;
* {{anchor|objectives-gold_carryover|'''[gold_carryover]'''}}: describes how the gold carryover works in this scenario. This is intended to be a more convenient way of displaying carryover information than using the note= key in [objectives].&lt;br /&gt;
** '''bullet''': Default '• ' or whatever is set in the parent [objectives] block. Replaces the default bullet with whatever is provided.&lt;br /&gt;
** '''red''': Default '255'. Overrides the default red coloring of the entire objective, including the bullet.&lt;br /&gt;
** '''green''': Default '255'. Overrides the default green coloring of the entire objective, including the bullet.&lt;br /&gt;
** '''blue''': Default '192'. Overrides the default blue coloring of the entire objective, including the bullet.&lt;br /&gt;
** '''bonus''' (boolean): whether an early finish bonus is granted. If omitted, early finish bonus is not mentioned.&lt;br /&gt;
** '''carryover_percentage''': the amount of carryover gold. If omitted, the amount is not mentioned.&lt;br /&gt;
** '''[show_if]''': {{DevFeature1.13|11}} Gold carryover will not be shown if the specified condition isn't met. Conditional gold carryover is refreshed at '''[show_objectives]''' time only.&lt;br /&gt;
* {{anchor|objectives-note|'''[note]'''}}: describes a note, usually used for hints or additional information. This is an easier way of adding several notes than concatenating them together into a single string to use with the ''note='' key.&lt;br /&gt;
** '''bullet''': Default '• ' or whatever is set in the parent [objectives] block. Replaces the default bullet with whatever is provided for the note defined by the [note] block.&lt;br /&gt;
** '''red''': Default '255'. Overrides the default red coloring of the entire note, including the bullet.&lt;br /&gt;
** '''green''': Default '255'. Overrides the default green coloring of the entire note, including the bullet.&lt;br /&gt;
** '''blue''': Default '255'. Overrides the default blue coloring of the entire note, including the bullet.&lt;br /&gt;
** '''description''': the text of the note.&lt;br /&gt;
** '''[show_if]''': The note will not be shown if the specified condition isn't met. Conditional notes are refreshed at '''[show_objectives]''' time only.&lt;br /&gt;
&lt;br /&gt;
== [set_menu_item] ==&lt;br /&gt;
This tag is used to add a custom option in the right-click context menu which can then be used to trigger arbitrary WML commands. The menu items can be set and modified during any event, for example during &amp;quot;start&amp;quot; or &amp;quot;prestart&amp;quot; events. The user can also assign hotkeys to these WML commands unless specified otherwise. When the hotkey is pressed the event will be fired/filtered at the current mouse position.&lt;br /&gt;
&lt;br /&gt;
'''Note:''' Due to limitations in portable devices where there are no scroll bars for context menus, there is a hard-coded limit of 7 custom WML menu items. If you really need to have more than 7 menu items, try combining some of them in a submenu. {{DevFeature1.13|0}} This limitation is being removed in a [http://forums.wesnoth.org/viewtopic.php?p=572554#p572554 future version] of Wesnoth.&lt;br /&gt;
&lt;br /&gt;
* '''id''': the unique id for this menu item. If a menu item with this id already exists, it allows you to set specific changes to that item. All menus will be sorted lexicographically by the id string. The ordering is underscores, digits, and finally letters.&lt;br /&gt;
* '''description''': the in-game text that will appear for this item in the menu.&lt;br /&gt;
* '''image''': the image to display next to this item, defaults to &amp;quot;buttons/WML-custom.png&amp;quot;&lt;br /&gt;
* '''needs_select''': if ''yes'' (default ''no''), then the latest select event (see [[EventWML]]) that triggered before this menu item was chosen will be transmitted over the network before this menu item action will be. This only has any effect in networked multiplayer, and is intended to allow more elaborate menu item behaviour there without causing out of sync errors. If you don't know what this means, just leave it. {{DevFeature1.13|6}} ''needs_select=yes'' is deprecated, consider using manual variable syncing with [sync_variable].&lt;br /&gt;
* '''synced''' {{DevFeature1.13|1}}: if ''no'' (default ''yes'') the command handler will only be run on the client that invoked the menu item; this means that changing the gamestate in a command handler of a menu item with ''synced=no'' will cause OOS&lt;br /&gt;
* '''use_hotkey''': if ''no'' (default ''yes''), then the user cannot assign hotkeys to this menu item. If ''only'', the menu item is only accessible via hotkeys, not via right-click context; you can use this in combination with [default_hotkey] if you want custom hotkeys in your campaign/mp. &lt;br /&gt;
* '''[show_if]''': If present, the menu item will only be available if the conditional statement (see [[ConditionalActionsWML#Condition_Tags|ConditionalActionsWML]]) within evaluates to true. When this is evaluated, the WML variables ''$x1'' and ''$y1'' will point to the location on which the context menu was invoked, so it's possible to for example only enable the option on empty hexes or on a particular unit.&lt;br /&gt;
* '''[filter_location]''': contains a [[StandardLocationFilter]] similar to the one found inside Single Unit Filters. The menu item will only be available on matching locations.&lt;br /&gt;
* '''[default_hotkey]''': contains a hotkey WML to specify what hotkey to assign to this, '''if the user has no hotkey assigned to this yet'''. (Unlike the rest of a menu item definition, modifying this tag has no effect on the game; it is only effective when initially defining a menu item.) Hotkey WML matches the format in the preferences file and contains the following keys:&lt;br /&gt;
** '''key''': a string that contains the key to assign to this.&lt;br /&gt;
** '''alt''', '''shift''', '''cmd'''(apple only), '''ctrl''':  boolean values.&lt;br /&gt;
** '''repeat_on_hold''' {{DevFeature1.13|12}}: if ''yes'' (default ''no''), holding the hotkey will repeat the action continuously, unless it blocks input with something like '''[message]'''. Due to a bug, versions older than 1.13.12 always repeat the action, with no way to disable it.&lt;br /&gt;
* '''[command]''': contains the WML actions to be executed when the menu item is selected. Again, the WML variables ''$x1'' and ''$y1'' will point to the location on which the context menu was invoked on.&lt;br /&gt;
** '''delayed_variable_substitution ''' (boolean yes|no, default: yes): If no, forces a variable substitution run onto the wml included in this [command] block. Use this, if you want variables which are to substitute to get the values they have at execution time of the event where this set_menu_item appears. Other than that, they get the values they have at invocation time of the menu item.&lt;br /&gt;
&lt;br /&gt;
== [clear_menu_item] ==&lt;br /&gt;
&lt;br /&gt;
Removes a menu item from the scenario.&lt;br /&gt;
Normally menu items are, including all their defining wml, automatically carried over between scenarios. This tag prevents this. (The behavior is comparable to set_variable/clear_variable).&lt;br /&gt;
* '''id''': (string): id of the menu item to clear. Can be a comma-separated list.&lt;br /&gt;
&lt;br /&gt;
== Other interface tags ==&lt;br /&gt;
&lt;br /&gt;
The following tags are also action tags:&lt;br /&gt;
&lt;br /&gt;
=== [change_theme] ===&lt;br /&gt;
&lt;br /&gt;
{{DevFeature1.13|8}}&lt;br /&gt;
&lt;br /&gt;
Change the current interface theme.&lt;br /&gt;
&lt;br /&gt;
* '''theme''': The ID of the new theme. Use &amp;lt;code&amp;gt;theme=&amp;lt;/code&amp;gt; (empty key) to switch back to the theme that the player has selected in Preferences. On &amp;lt;b&amp;gt;1.14.2&amp;lt;/b&amp;gt; and later it is also possible to omit the key entirely to achieve the same effect (on previous versions this will crash the Lua engine).&lt;br /&gt;
&lt;br /&gt;
=== [item] ===&lt;br /&gt;
Makes a graphical item appear on a certain hex. Note this only places the graphics for an item. It does not make the item do anything. Use a moveto event to make moving onto the item do something. &amp;lt;tt&amp;gt;''('''Hint:''' There are a number of predefined items that are used in various campaigns that you can make use of. You can find [http://www.wesnoth.org/macro-reference.xhtml#file:items.cfg a list of them] if you look into the items.cfg file in the wesnoth install directory (under /data/core/macros).)''&amp;lt;/tt&amp;gt;&lt;br /&gt;
* '''x''', '''y''': the location to place the item. (only for [event][item]: full [[StandardLocationFilter|SLF]] support)&lt;br /&gt;
* '''image''': the image (in ''images/'' as .png) to place on the hex. This image is aligned with the top-left of the hex (which is 72 pixels wide and 72 pixels tall). It is drawn underneath units. ''('''Hint:''' If using an image smaller than 72x72, then it might be useful to [[ImagePathFunctions#Blit_Function|BLIT]] the image onto &amp;lt;tt&amp;gt;misc/blank-hex.png&amp;lt;/tt&amp;gt; (a blank 72x72 image).)''&lt;br /&gt;
* '''halo''': an image to place centered on the hex. It is drawn on top of units. Use this instead of ''image'' if the image is bigger than the hex or if you want to animate an image (https://github.com/wesnoth/wesnoth/issues/1219). ''Example (where the integer after the colon is the duration of each frame or square bracket expansion as per AnimationWML is used): halo=scenery/fire1.png:100,scenery/fire2.png:100,scenery/fire3.png:100,scenery/fire4.png:100,scenery/fire5.png:100,scenery/fire6.png:100,scenery/fire7.png:100,scenery/fire8.png:100'' or equivalently (requires Wesnoth 1.11.2+): ''halo=scenery/fire[1~8].png:100''&lt;br /&gt;
* '''name''' an id that can be used to remove the item.&lt;br /&gt;
* '''team_name''': name of the team for which the item is to be displayed (hidden for others). For multiple teams just put all the names in one string, for example separated by commas. {{DevFeature1.15|0}} In 1.14 the '''[side]team_name''' attribute was expected to be a substring of this '''team_name'''. In 1.15 both are expected to be comma-separated lists of names and the item is visible if the lists intersect. ([[https://github.com/wesnoth/wesnoth/pull/3533|#3533]])&lt;br /&gt;
* '''visible_in_fog''': whether the item should be visible through fog or not. Default yes.&lt;br /&gt;
* '''submerge''': float, between 0 and 1: specifies how much of the image should be submerged. Gets multiplied with [[TerrainWML|[terrain]]]&amp;lt;nowiki/&amp;gt;submerge. Default 0.&lt;br /&gt;
* '''z_order''': float: defines the order the items get drawn in. Default 0.&lt;br /&gt;
* '''redraw''': (boolean yes|no, default: yes): If no, disables implicit calls to [[InterfaceActionsWML#.5Bredraw.5D|[redraw]]] when placing the items.&lt;br /&gt;
* '''[filter_team]''': {{DevFeature1.15|0}} A [[StandardSideFilter]]. Set '''team_name''' to the union of all '''[side]team_name''' attributes of all sides that match the SSF. ([[https://github.com/wesnoth/wesnoth/pull/3533|#3533]])&lt;br /&gt;
* {{DevFeature1.15|0}} If both '''team_name''' and '''[filter_team]''' are set, '''team_name''' is ignored.&lt;br /&gt;
&lt;br /&gt;
=== [remove_item] ===&lt;br /&gt;
Removes any graphical items on a given hex.&lt;br /&gt;
* [[StandardLocationFilter]]: the hexes to remove items from&lt;br /&gt;
* '''image''': if specified, only removes the given item if one of its 'image', 'halo' or 'name' attributes is exactly this value. (for 'halo' and 'image' this in particular means that the image name must include any [[ImagePathFunctions|image path functions]] appended to the original image name.)&lt;br /&gt;
&lt;br /&gt;
=== [print] ===&lt;br /&gt;
Displays a message across the screen. The message will disappear after a certain time, or when another [print] tag is encountered.&lt;br /&gt;
* '''text''': (translatable) the text to display. Can be an empty string to remove a previous message without showing a new one.&lt;br /&gt;
* '''size''': (default=12) the pointsize of the font to use&lt;br /&gt;
* '''duration''': the length of time to display the text for.&lt;br /&gt;
** (Before 1.15.4) This is measured in the number of 'frames', and the default is 50. A frame in Wesnoth is usually displayed for around 30ms.&lt;br /&gt;
** {{DevFeature1.15|4}} This is measured in milliseconds. Don't use the default value, because it's a mere 50ms.&lt;br /&gt;
** {{DevFeature1.15|14}} The default is 5000 milliseconds.&lt;br /&gt;
** {{DevFeature1.15|14}} The string '''unlimited''' displays the text until it's removed by another [print] tag.&lt;br /&gt;
* '''color''': (default '''0,0,0''') three comma-separated values giving the red, green and blue values (0-255).&lt;br /&gt;
* '''red''', '''green''', '''blue''': deprecated, use color=0,0,0 instead.&lt;br /&gt;
&lt;br /&gt;
=== [move_unit_fake] ===&lt;br /&gt;
Moves an image of a unit along a certain path on the map. The path does not need to be a continuous list of adjacent hexes, so for example only the start and end points can be given, in which case the straightest line between those points will be calculated and used.&lt;br /&gt;
* '''type''': the type of the unit whose image to use&lt;br /&gt;
* '''x''': a comma-separated list of x locations to move along&lt;br /&gt;
* '''y''': a comma-separated list of y locations to move along (x and y values are matched pairs)&lt;br /&gt;
* '''side''': the side of the fake unit, used for team-coloring the fake unit&lt;br /&gt;
* '''gender''': the gender of the fake unit. Example: gender=female&lt;br /&gt;
* '''variation''': the variation of the fake unit. Example: variation=undead&lt;br /&gt;
* '''image_mods''': [[ImagePathFunctions|image path functions]] sequence to be applied on the fake unit.&lt;br /&gt;
* '''force_scroll''':  Whether to scroll the map or not even when [[#.5Block_view.5D|[lock_view]]] is in effect or ''Follow Unit Actions'' is disabled in ''Advanced Preferences''. Defaults to ''yes'' starting with version '''1.11.6'''; the attribute did not exist in previous versions and this action behaved as if ''no'' was passed instead.&lt;br /&gt;
&lt;br /&gt;
=== [move_units_fake] ===&lt;br /&gt;
moves multiple images of units along paths on the map. These units are moved in lockstep.&lt;br /&gt;
* '''force_scroll''': {{DevFeature1.15|0}} Has the same meaning as in [move_unit_fake] but a different default.&lt;br /&gt;
* '''[fake_unit]''': A fake unit to move&lt;br /&gt;
** '''type''': the type of unit whose image to use&lt;br /&gt;
** '''x''': a comma-separated list of x locations to move along&lt;br /&gt;
** '''y''': a comma-separated list of y locations to move along (x and y values are matched pairs)&lt;br /&gt;
** '''side''': the side of the fake unit, used for team-coloring the fake unit&lt;br /&gt;
** '''skip_steps''': the number of steps to skip before this unit starts moving&lt;br /&gt;
&lt;br /&gt;
=== [hide_unit] ===&lt;br /&gt;
Temporarily prevents the engine from displaying the given unit. The unit does not become invisible, as it would be with the '''[hides]''' ability; it is still the same plain unit, but without an image. Useful in conjunction with '''[move_unit_fake]''': to move a leader unit into position on-screen. Until 1.8 each '''[hide_unit]''' tag only hides one unit.&lt;br /&gt;
* [[StandardUnitFilter]]: All matching units will be hidden&lt;br /&gt;
&lt;br /&gt;
=== [unhide_unit] ===&lt;br /&gt;
Stops the currently hidden units from being hidden.&lt;br /&gt;
* [[StandardUnitFilter]]: Only the matching units will be unhidden&lt;br /&gt;
&lt;br /&gt;
=== [lock_view] ===&lt;br /&gt;
Locks gamemap view scrolling for human players, so they cannot scroll the gamemap view until it is unlocked. WML or Lua actions such as '''[scroll_to]''' will continue to work normally, as they ignore this restriction; the locked/unlocked state is preserved when saving the current game.&lt;br /&gt;
&lt;br /&gt;
This feature is generally intended to be used in cutscenes to prevent the player scrolling away from scripted actions.&lt;br /&gt;
&lt;br /&gt;
{{DevFeature1.13|8}} This now also blocks the player from zooming the gamemap view. WML or Lua zoom will continue to work normally.&lt;br /&gt;
&lt;br /&gt;
=== [unlock_view] ===&lt;br /&gt;
Unlocks gamemap view scrolling for human players.&lt;br /&gt;
&lt;br /&gt;
=== [scroll] ===&lt;br /&gt;
Scroll a certain number of pixels in a given direction. Useful for earthquake/shaking effects.&lt;br /&gt;
* '''x''', '''y''': the number of pixels to scroll along the x and y axis&lt;br /&gt;
* '''side''': the side or sides for which this should happen. By default, the [scroll] happens for everyone.&lt;br /&gt;
* '''[filter_side]''': a [[StandardSideFilter]] to select the sides for which this should happen. By default, the [scroll] happens for everyone.&lt;br /&gt;
&lt;br /&gt;
=== [scroll_to] ===&lt;br /&gt;
Scroll to a given hex&lt;br /&gt;
* [[StandardLocationFilter]], do not use a [filter_location] sub-tag. If more than one location matches the filter, only the first matching location will be used.&lt;br /&gt;
* '''check_fogged''': whether to scroll even to locations covered in fog or shroud. Possible values ''yes'' (don't scroll to fog) and ''no'' (scroll even to fog), with ''no'' as the default.&lt;br /&gt;
* '''immediate''': whether to instantly warp to the target hex regardless of the scroll speed setting in Preferences (defaults to ''no'').&lt;br /&gt;
* '''highlight''': {{DevFeature1.13|5}} Whether to highlight the hex being scrolled to (defaults to ''no'').&lt;br /&gt;
* '''side''': the side or sides for which this should happen. By default, the [scroll_to] happens for everyone.&lt;br /&gt;
* '''[filter_side]''': a [[StandardSideFilter]] to select the sides for which this should happen. By default, the [scroll_to] happens for everyone.&lt;br /&gt;
&lt;br /&gt;
=== [scroll_to_unit] ===&lt;br /&gt;
Scroll to a given unit&lt;br /&gt;
* [[StandardUnitFilter]]; do not use a [filter] subtag.&lt;br /&gt;
* '''check_fogged''': whether to scroll even to locations covered in fog or shroud. Possible values ''yes'' (don't scroll to fog) and ''no'' (scroll even to fog), with ''no'' as the default.&lt;br /&gt;
* '''immediate''': whether to instantly warp to the target hex regardless of the scroll speed setting in Preferences (defaults to ''no'').&lt;br /&gt;
* '''highlight''': {{DevFeature1.13|5}} Whether to highlight the hex the unit is on (defaults to ''no'').&lt;br /&gt;
* '''for_side''': the side or sides for which this should happen. By default, the [scroll_to_unit] happens for everyone.&lt;br /&gt;
* '''[for_side]''': a [[StandardSideFilter]] to select the sides for which this should happen. By default, the [scroll_to_unit] happens for everyone.&lt;br /&gt;
&lt;br /&gt;
=== [select_unit] ===&lt;br /&gt;
Selects a given unit.&lt;br /&gt;
* [[StandardUnitFilter]]: The first unit found will be selected.&lt;br /&gt;
* '''fire_event''': whether a ''select'' event should be triggered or not (def. ''no''). (Note that select events aren't multiplayer save.)&lt;br /&gt;
* '''highlight''': whether the unit's current hex should be highlighted (def. ''yes'').&lt;br /&gt;
&lt;br /&gt;
'''Note:''' fire_event does not appear to work in 1.14 or 1.16.&lt;br /&gt;
&lt;br /&gt;
=== [sound]===&lt;br /&gt;
Plays a sound&lt;br /&gt;
* '''name''': the filename of the sound to play (in ''sounds/'' as .wav or .ogg). This can be a comma-separated list, from which one sound will be chosen randomly.&lt;br /&gt;
* '''repeat''': repeats the sound for a specified additional number of times (default=0)&lt;br /&gt;
&lt;br /&gt;
=== [sound_source] ===&lt;br /&gt;
Creates a sound source. &amp;quot;Sound sources&amp;quot; is a general name for a mechanism which makes possible for map elements to emit sounds according to some rules, where &amp;quot;map elements&amp;quot; can be specific locations or terrain types. For now, only sound sources tied to locations are supported.&lt;br /&gt;
* '''id''': a unique identification key of the sound source&lt;br /&gt;
* '''sounds''': a list of comma separated, randomly played sounds associated with the sound source&lt;br /&gt;
* '''delay''': a numerical value (in milliseconds) of the minimal delay between two playbacks of the source's sound if the source remains visible on the screen; if one scrolls out and back in, the source will be considered as ready to play&lt;br /&gt;
* '''chance''': a percentage (a value from 0 to 100) describing the chance of the source being activated every second after the delay has passed or when the source's location appears on the screen (note that it cannot play more than one file at the same time)&lt;br /&gt;
* '''check_fogged''': possible values ''yes'' and ''no'' - ''yes'' means the source will not play if its locations are fogged&lt;br /&gt;
* '''check_shrouded''': possible values ''yes'' and ''no'' - ''yes'' means the source will not play if its locations are shrouded&lt;br /&gt;
* '''x,y''': similar to x,y as found in a [[StandardLocationFilter]], these are the locations associated with the sound source&lt;br /&gt;
* '''fade_range''' (default = 3): distance in hexes that determines a &amp;quot;circular&amp;quot; area around the one specified by '''full_range''' where sound volume fades out linearly&lt;br /&gt;
* '''full_range''' (default = 14): distance in hexes that determines a &amp;quot;circular&amp;quot; area where source plays with full volume, relative to screen center&lt;br /&gt;
* '''loop''': number of times a sound sample should be looped if it stays visible. -1 means infinite (~65000)&lt;br /&gt;
&lt;br /&gt;
=== [story] ===&lt;br /&gt;
{{DevFeature1.13|8}}&lt;br /&gt;
&lt;br /&gt;
Shows the story screen.&lt;br /&gt;
* '''title''': Default title used if a part does not specify one — unlike the intro storyscreen, the scenario name is not used as a default title.&lt;br /&gt;
* '''[part]''', '''[if]''', '''[switch]''', '''[wml_message]''', '''[deprecated_message]''' : See [[IntroWML]].&lt;br /&gt;
&lt;br /&gt;
=== [remove_sound_source] ===&lt;br /&gt;
Removes a previously defined sound source.&lt;br /&gt;
* '''id''': the identification key of the sound source to remove&lt;br /&gt;
&lt;br /&gt;
=== [music] ===&lt;br /&gt;
Switches to playing different music&lt;br /&gt;
* '''name''': the filename of the music to play (in ''music/'' as .ogg)&lt;br /&gt;
* see [[MusicListWML]] for the correct syntax&lt;br /&gt;
&lt;br /&gt;
=== [volume] ===&lt;br /&gt;
Changes the game volume to a percent of the preferences volume for the game being played. Values can go from 0 to 100:  &lt;br /&gt;
* '''music''':  Changes the music volume.&lt;br /&gt;
* '''sound''':  Changes the sound volume.&lt;br /&gt;
&lt;br /&gt;
=== [color_adjust] ===&lt;br /&gt;
Adjust the color tint of terrain, by adjusting time-of-day coloring.&lt;br /&gt;
* '''red''', '''green''', '''blue''': values from -255 to 255, the amount to tint by for each color&lt;br /&gt;
&lt;br /&gt;
=== [screen_fade] ===&lt;br /&gt;
{{DevFeature1.17|6}}&lt;br /&gt;
&lt;br /&gt;
Overlay the game display with the given color, fading over the specified duration. This can be used for screen fade effects.&lt;br /&gt;
* '''red''', '''green''', '''blue''': values from 0 to 255, the final overlay color (defaults to 0,0,0)&lt;br /&gt;
* '''alpha''': value from 0 to 255, the strength of the effect. 0 means no effect and can be used to fade in. 255 means fully opaque and can be used to fully fade out to the given color. Intermediate values will end up with a partial overlay tint on the game screen.&lt;br /&gt;
* '''duration''': the length of time it will take to complete the fade, in milliseconds. If 0 the effect is immediate.&lt;br /&gt;
&lt;br /&gt;
=== [delay] ===&lt;br /&gt;
Pauses the game.&lt;br /&gt;
* '''time''': the time to pause in milliseconds&lt;br /&gt;
* '''accelerate ''' (boolean yes|no, default no): {{DevFeature1.13|0}} whether the delay is affected by acceleration. When [delay] is used to make an animation, this should be set to yes so that your animation matches the ones generated by the game.&lt;br /&gt;
&lt;br /&gt;
=== [redraw] ===&lt;br /&gt;
Redraws the screen (this normally isn't done during events, although some of the other interface actions cause the screen or parts of it to be redrawn).&lt;br /&gt;
* '''clear_shroud''' (boolean yes|no, default no): If yes, clears fog and shroud around existing units. Useful if you, for example, spawn friendly units in the middle of an event and want the shroud to update accordingly (otherwise units that spawn inside fog would remain invisible for the duration of the event, since the fog would not automatically get cleared around them).&lt;br /&gt;
* '''[[StandardSideFilter]]''': the sides for which to recalculate fog and shroud.&lt;br /&gt;
* '''side''': If used (forces clear_shroud=yes), clears fog and shroud for that side.&lt;br /&gt;
&lt;br /&gt;
=== [unit_overlay] ===&lt;br /&gt;
Sets an image that will be drawn over a particular unit, and follow it around&lt;br /&gt;
* [[StandardUnitFilter]]: All matching units will get the overlay (do not use [filter])&lt;br /&gt;
* '''image''': the image to place on the unit&lt;br /&gt;
* '''object_id''': object id to use, defaults to the '''image''' key with an &amp;quot;overlay_&amp;quot; prefix; this allows using [[DirectActionsWML#.5Bremove_object.5D|'''[remove_object]''']]&lt;br /&gt;
* '''duration''': object duration&lt;br /&gt;
&lt;br /&gt;
=== [remove_unit_overlay] ===&lt;br /&gt;
Removes a particular overlayed image from a unit&lt;br /&gt;
* [[StandardUnitFilter]]: The overlay will get removed from all matching units (do not use [filter])&lt;br /&gt;
* '''image''': the image to remove from the unit&lt;br /&gt;
* '''object_id''': object id to use&lt;br /&gt;
Using [[DirectActionsWML#.5Bremove_object.5D|'''[remove_object]''']] is also possible, see https://github.com/wesnoth/wesnoth/commit/26c2f941f2bcdd89528481e114c0375ad2a46271&lt;br /&gt;
&lt;br /&gt;
=== [animate_unit] ===&lt;br /&gt;
Uses an animation of a unit to animate it on screen (if the unit has the corresponding animation).&lt;br /&gt;
* '''flag''': The key to find the custom animation in the unit description (see the '''[extra_anim]''' description in [[AnimationWML]]). Standard animations can be triggered with the following keywords: ''leading recruited standing idling levelout levelin healing healed poisoned movement defend attack death victory pre_teleport post_teleport''&lt;br /&gt;
* '''[filter]''' with a [[StandardUnitFilter]] as argument, see [[FilterWML]]. By default, the unit at the event location will be animated. You can use this tag to choose any other unit to animate.&lt;br /&gt;
* '''[primary_attack]''': If this tag is not present, the filter for animation will be triggered with no attack. If it is here, all attacks from the unit will be filtered, and a matching one will be used to filter the animation. Takes a weapon filter as argument, see [[FilterWML]].&lt;br /&gt;
* '''[secondary_attack]''': Similar to '''[primary_attack]'''. May be needed to trigger a defense animation correctly, if there are more than one animations available for the defending unit.&lt;br /&gt;
* '''hits''': yes/no/hit/miss/kill: which according variation of a attack/defense animation shall be chosen (required)&lt;br /&gt;
* '''text''': a text to hover during the animation &lt;br /&gt;
* '''male_text''', '''female_text''': {{DevFeature1.13|2}} (translatable) gender-specific versions of the above&lt;br /&gt;
* '''red''': red value for the text color (0-255)&lt;br /&gt;
* '''green''': green value for the text color&lt;br /&gt;
* '''blue''': blue value for the text color&lt;br /&gt;
* '''with_bars''': yes/no: whether to display the status bars during the animation (e.g. the hitpoint bar)&lt;br /&gt;
* '''[animate]''': a sub block with the same syntax as '''[animate_unit]''' except that the '''[filter]''' block is mandatory to find the unit. This block will find and animate another unit simultaneously.&lt;br /&gt;
* '''[facing]''': a [[StandardLocationFilter]] specifying what hex the unit should be facing when animated&lt;br /&gt;
&lt;br /&gt;
=== [label] ===&lt;br /&gt;
Places a label on the map.&lt;br /&gt;
* '''x''', '''y''': the location of the label. {{DevFeature1.13|1}} (only for [event][label]: full [[StandardLocationFilter|SLF]] support)&lt;br /&gt;
* '''text''': what the label should say. If you put an empty string &amp;lt;code&amp;gt;&amp;quot;&amp;quot;&amp;lt;/code&amp;gt; as an argument, the label will be completely removed. Use this method if you want to remove a specific label from any location.&lt;br /&gt;
* '''team_name''': if specified, the label will only be visible to the given team.&lt;br /&gt;
* '''color''': color of the label. The format is r,g,b; r, g and b are numbers between 0 and 255. When you use Pango markup in the text, you cannot use this, but in that case you could colorize the text via Pango markup.&lt;br /&gt;
* '''visible_in_fog''': whether the label should be visible through fog or not. Default yes.&lt;br /&gt;
* '''visible_in_shroud''': whether the label should be visible through shroud or not. Default no.&lt;br /&gt;
* '''immutable''': whether this label is protected from being removed or changed by players. Default yes.&lt;br /&gt;
* '''category''': the Show/Hide Labels dialog allows showing/hiding all labels of a given category by toggling a checkbox.&lt;br /&gt;
* '''tooltip''': A tooltip visible when mouseovering the hex the label is on&lt;br /&gt;
* '''side''': the number of the side that placed the label. Can be 0 for labels placed by WML.&lt;br /&gt;
&lt;br /&gt;
=== [floating_text]===&lt;br /&gt;
Floats text (similar to the damage and healing numbers) on the given locations.&lt;br /&gt;
* [[StandardLocationFilter]]: the text will be floated on all matching locations simultaneously (do not use [filter] unless you intend to match one or more units).&lt;br /&gt;
* '''text''': the text to display.&lt;br /&gt;
&lt;br /&gt;
The default text color is &amp;lt;span style=&amp;quot;color: #6b8cff;&amp;quot;&amp;gt;'''#6b8cff'''&amp;lt;/span&amp;gt;. To change the color, use [[#Formatting|Pango markup]]. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# Float some golden yellow text at 20,20.&lt;br /&gt;
[floating_text]&lt;br /&gt;
   x,y=20,20&lt;br /&gt;
   text=&amp;quot;&amp;lt;span color='#cccc33'&amp;gt;&amp;quot; + _ &amp;quot;Your text here&amp;quot; + &amp;quot;&amp;lt;/span&amp;gt;&amp;quot;&lt;br /&gt;
[/floating_text]&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== [deprecated_message] ===&lt;br /&gt;
Shows a deprecated message in the message area, this feature is only intended to be used to warn about deprecated macros in mainline. The message is not translatable.&lt;br /&gt;
* '''message''': the message to show.&lt;br /&gt;
* '''level''': {{DevFeature1.13|10}} The deprecation level, a number from 1 to 3.&lt;br /&gt;
* '''what''': {{DevFeature1.13|10}} The name of the thing being deprecated. Use this instead of '''message''' if possible; a stock message will be generated from it. Use '''message''' only if more information is required; it will be appended to the stock message. This should not be translatable&lt;br /&gt;
* '''version''': {{DevFeature1.13|10}} For deprecation levels 2 and 3, this indicates the version in which the feature could be removed. It does ''not'' indicate the version in which it became deprecated. &lt;br /&gt;
&lt;br /&gt;
The meanings of the deprecation levels are as follows:&lt;br /&gt;
&lt;br /&gt;
# Deprecated, but will only be removed if absolutely necessary. The '''version''' key is ignored.&lt;br /&gt;
# It will be removed no earlier than a specified version.&lt;br /&gt;
# It will be removed in the next stable version&lt;br /&gt;
# It has already been removed, leaving just a stub to inform users of how to update their code.&lt;br /&gt;
&lt;br /&gt;
Note that as of 1.13.11, deprecation messages show only in the log, not in the chat message area. The '''message''' can be translatable, but does not need to be.&lt;br /&gt;
&lt;br /&gt;
=== [wml_message] ===&lt;br /&gt;
Outputs a message to Wesnoth's console output. Intended for campaign designers to output silent text to the console, without annoying the player; then, that text might contain information useful for later bug-reporting. WML wrapper of [[LuaAPI/wesnoth#wesnoth.log]], see the link for more description.&lt;br /&gt;
* '''message''': the message to show.&lt;br /&gt;
* '''to_chat''': controls whether message is visible in chat, though logger=wml means message is visible anyways. Default ''no''.&lt;br /&gt;
* '''logger''': one of '''info''', '''debug''', '''warning''', '''error''', '''wml'''. Default ''info''.&lt;br /&gt;
&lt;br /&gt;
=== [test_condition] ===&lt;br /&gt;
&lt;br /&gt;
{{DevFeature1.13|2}}&lt;br /&gt;
&lt;br /&gt;
Evaluates the contained conditional tags. If they evaluate to the expected value, it prints out a message to the console explaining which part of the condition caused this result in a way similar to [wml_message]. This can be used if your conditional test is failing and you're not sure why.&lt;br /&gt;
&lt;br /&gt;
* '''result''': Whether you expect the conditions to fail or succeed. If no (the default), a message will be printed if the conditional tags fail. If yes, a message will instead be printed if the conditional tags pass.&lt;br /&gt;
* '''logger''': Same as for [wml_message]. Defaults to &amp;quot;warning&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
=== [open_help] ===&lt;br /&gt;
Opens the in-game help.&lt;br /&gt;
* '''topic''': the id of the topic to open&lt;br /&gt;
&lt;br /&gt;
Examples of ids:&lt;br /&gt;
* unit_Mage&lt;br /&gt;
* unit_Dark Adept&lt;br /&gt;
* weaponspecial_charge&lt;br /&gt;
* terrain_human_castle&lt;br /&gt;
&lt;br /&gt;
The engine will print the topic ids if run from the command line with the ''--log-debug=help'' option.&lt;br /&gt;
&lt;br /&gt;
=== [show_objectives] ===&lt;br /&gt;
refreshes the objectives defined by [objectives] and its [show_if] tags, and displays them. (It is also called whenever the user explicitly asks for the objectives; this matters only if the tag was overridden by a [[LuaWML#register_wml_action|Lua]] script.)&lt;br /&gt;
* '''side''': the side to show the objectives. If not set, all sides are used.&lt;br /&gt;
* '''[[StandardSideFilter]]''' tags and keys: Tag affects the matching sides instead of just all or the one given by the integer value of the side= key.&lt;br /&gt;
&lt;br /&gt;
=== [chat] ===&lt;br /&gt;
Displays a message in the chat area, not visible for observers. Alternative unconditionally visible for everyone: [[LuaWML:Display#wesnoth.message]]. {{DevFeature1.13|9}} can be visible for observers.&lt;br /&gt;
* '''speaker''': (default=&amp;quot;WML&amp;quot;) A string for the name of the sender of the message.&lt;br /&gt;
* '''message''': The message that should be displayed.&lt;br /&gt;
* '''observable''' (boolean yes|no, default yes): {{DevFeature1.13|9}} Whether the message is displayed for observers.&lt;br /&gt;
* '''[[StandardSideFilter]]''' tags and keys as argument; if the same client controls multiple sides that match, then the message will only be displayed once.&lt;br /&gt;
&lt;br /&gt;
=== [zoom] ===&lt;br /&gt;
&lt;br /&gt;
{{DevFeature1.13|8}}&lt;br /&gt;
&lt;br /&gt;
Changes the zoom level of the map.&lt;br /&gt;
&lt;br /&gt;
* '''factor''': The new zoom factor, measured as a multiple of the base zoom.&lt;br /&gt;
* '''relative''': If yes, zoom relative to current zoom level. Otherwise, set the absolute zoom level. Default no.&lt;br /&gt;
&lt;br /&gt;
== Useful Macros ==&lt;br /&gt;
There are some predefined macros that you find useful for interface 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;
* '''{HIGHLIGHT_UNIT}''' Highlight a unit on the map. Use this to show important units&lt;br /&gt;
* '''{HIGHLIGHT_IMAGE}''' Places and highlights an image on the map. Use this to show important items or locations&lt;br /&gt;
* '''{SET_IMAGE}''' Places an image on the map which has no other function.&lt;br /&gt;
* '''{QUAKE &amp;lt;soundfile&amp;gt;}''' Creates a tremor-like screenshake and plays &amp;lt;soundfile&amp;gt;. For example, '''{QUAKE (rumble.ogg)}'''.&lt;br /&gt;
* '''{FLASH_WHITE}''' Flash the screen white momentarily. You can also replace WHITE with RED, BLUE or GREEN for a different colour.&lt;br /&gt;
&lt;br /&gt;
== See Also ==&lt;br /&gt;
* [[DirectActionsWML]]&lt;br /&gt;
* [[InternalActionsWML]]&lt;br /&gt;
* [[EventWML]]&lt;br /&gt;
* [[ReferenceWML]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category: WML Reference]]&lt;br /&gt;
[[Category: ActionsWML]]&lt;/div&gt;</summary>
		<author><name>Soliton</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.wesnoth.org/index.php?title=InterfaceActionsWML&amp;diff=74417</id>
		<title>InterfaceActionsWML</title>
		<link rel="alternate" type="text/html" href="https://wiki.wesnoth.org/index.php?title=InterfaceActionsWML&amp;diff=74417"/>
		<updated>2025-07-02T11:57:47Z</updated>

		<summary type="html">&lt;p&gt;Soliton: /* [item] */ document submerge and z_order&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{WML Tags}}&lt;br /&gt;
== Interface actions ==&lt;br /&gt;
&lt;br /&gt;
Part of [[ActionWML]], interface actions are actions that do not have a direct effect on gameplay;&lt;br /&gt;
instead, they show something to the player.  The main interface tags&lt;br /&gt;
are '''[message]''' and '''[objectives]''', but several other tags affect&lt;br /&gt;
the interface also.&lt;br /&gt;
&lt;br /&gt;
== [inspect] ==&lt;br /&gt;
This user interface instantly displays the gamestate inspector dialog at the current scenario state (the same one that can be brought up with [[CommandMode|the ''':inspect''' command]]), which can be used to inspect the values of WML variables, AI configuration, recall lists, and more.&lt;br /&gt;
&lt;br /&gt;
* '''name''': optional attribute to specify the name of this gamestate inspector dialog. It is just a label to help differentiate between different invocations of gamestate inspector dialog.&lt;br /&gt;
&lt;br /&gt;
== [message] ==&lt;br /&gt;
The most commonly used interface action is [message], which displays a message to the user in a dialog box. It can also be used to take input from the user.&lt;br /&gt;
&lt;br /&gt;
The following key/tags are accepted for [message]:&lt;br /&gt;
* [[StandardUnitFilter]]: The unit whose profile and name are displayed. Do not use a [filter] tag. If no unit matching this filter is found, the message is not displayed (The unit has probably been killed).&amp;lt;br&amp;gt;[message] elements should be constructed so that it is either guaranteed that a certain unit is alive, or so that dialog flows smoothly even if the message isn't displayed.&lt;br /&gt;
&lt;br /&gt;
* '''speaker''': an alternative to standard unit filter. You may specify as the value of the speaker attribute a unit id or any of the following special values:&lt;br /&gt;
** '''narrator''': the dialog box is displayed without a caption for the unit speaking or a unit image&lt;br /&gt;
** '''unit''': the primary unit for the event is speaking&lt;br /&gt;
** '''second_unit''': the secondary unit for the event is speaking&lt;br /&gt;
&lt;br /&gt;
* '''message''': (translatable) the text to display to the right of the image. ''message'' is sometimes multiple lines; if it is, be sure to use quotes(''' ' ''' or ''' &amp;quot; ''')&lt;br /&gt;
* '''male_message''', '''female_message''': {{DevFeature1.13|2}} (translatable) Used instead of ''message'' if the unit's gender matches. Never used if there is no unit (ie ''speaker=narrator''). {{DevFeature1.13|6}} This matches the primary unit, not the secondary unit.&lt;br /&gt;
* '''wait_description''': {{DevFeature1.13|2}} the description of this message displayed when other players in a mp game wait for one player doing input in a [message] (with [option]s or [text_input]).&lt;br /&gt;
* '''[show_if]''': if present then this message will only be displayed if the conditional statement in this tag is passed (see [[ConditionalActionsWML#Condition_Tags|ConditionalActionsWML]])&lt;br /&gt;
* '''side_for''': (default: all sides) comma-separated list of sides for who message is shown. This will &amp;lt;b&amp;gt;not&amp;lt;/b&amp;gt; work with messages that take user input ([option]/[text_input]), which can only ever be shown to the current player. {{DevFeature1.13|0}} side_for= is now also accepted for messages with user input, it specifies on which side the message is shown (defaults to the currently playing side). For messages with input it does not accept a comma seperated list only a single number.&lt;br /&gt;
* '''image''': (default: profile image of speaker) the image to display to the left of the message text. Append ~RIGHT() if you want the image to appear on the right side. &lt;br /&gt;
** {{DevFeature1.13|0}} &amp;lt;b&amp;gt;none:&amp;lt;/b&amp;gt; display no image&lt;br /&gt;
* '''mirror''': {{DevFeature1.13|5}} whether to mirror the image specified by the '''image''' attribute.&lt;br /&gt;
* '''second_image''': {{DevFeature1.13|6}} same as the '''image''' attribute, but the image is displayed on the right of the message text. {{DevFeature1.17|7}} not working anymore, but there is plan to fix it eventually https://github.com/wesnoth/wesnoth/issues/8770&lt;br /&gt;
* '''second_mirror''': {{DevFeature1.13|6}} same as '''mirror''', but for the '''second_image''' attribute.&lt;br /&gt;
* '''image_pos''': {{DevFeature1.13|5}} whether to show the image on the left or right; supercedes the use of ~RIGHT() described above&lt;br /&gt;
* '''caption''': (default: name of speaker) the caption to display beside the image. Name to be displayed. Note: use a translation mark to avoid wmllint errors.&lt;br /&gt;
* '''scroll''': Boolean specifying whether the game view should scroll to the speaking unit. Defaults to ''yes''.&lt;br /&gt;
* '''highlight''': {{DevFeature1.13|5}} Boolean specifying whether to highlight the speaker. Defaults to ''yes''.&lt;br /&gt;
* '''sound''': a sound effect (wav file) to play as the message is displayed. This can be a comma-separated list, from which one will be randomly chosen.&lt;br /&gt;
* '''voice''', '''male_voice''', '''female_voice''': {{DevFeature1.13|?}} a sound to be played as the message is displayed. This can also be a comma-separated list, from which one will be randomly chosen. This is intended for voiceovers for the message. The gendered forms are applied the same as for '''message'''. They are never used when the speaker is the narrator - only '''voice''' is used in that case.&lt;br /&gt;
* {{anchor|message-option|'''[option]'''}}: No '''[option]''' elements have to be used. If '''[option]''' elements are present, then each option will be displayed in a menu for the user to select one option. ''Note: Messages with options will not be shown at all in prestart events''&lt;br /&gt;
** '''message''': (translatable) the text displayed for the option. {{DevFeature1.15|1}} This is now a synonym for '''description='''.&lt;br /&gt;
** '''image''', '''label''', '''description''', '''default''': See [[DescriptionWML#WML_Format|DescriptionWML]].&lt;br /&gt;
** '''value''': {{DevFeature1.13|?}} Gives the option a value to be stored in a variable.&lt;br /&gt;
** '''[show_if]''': if present then this option will only be displayed if the conditional statement in this tag is passed (see [[ConditionalActionsWML#Condition_Tags|ConditionalActionsWML]])&lt;br /&gt;
** '''[command]''': an element containing actions which are executed if the option is selected.&lt;br /&gt;
* '''variable''': {{DevFeature1.13|?}} If present, either the index or the value of the chosen option will be stored in the specified variable. Option indexing starts from 1. If option has '''[show_if]''' condition evaluated as false, then it is hidden and excluded from the indexing.&lt;br /&gt;
* {{anchor|message-text_input|'''[text_input]'''}}: there can be only one [text_input] tag. this adds a text input field to the message. ''Note: Messages with text_input will not be shown at all in prestart events''&lt;br /&gt;
** '''variable''': the variable that the user's input will be written to&lt;br /&gt;
** '''label''': a text label to the left of the input field&lt;br /&gt;
** '''max_length''': the maximum number of characters that may be typed into the field&lt;br /&gt;
** '''text''': text that is written into the field in the beginning&lt;br /&gt;
* Check [[EventWML#Multiplayer_safety]] to find out in which events you can safely use '''[option]''' and '''[text_input]''' without causing OOS.&lt;br /&gt;
&lt;br /&gt;
=== Formatting ===&lt;br /&gt;
'''[message]''' and other tags such as unit names (user_description), objectives, and floating text can make use of [https://docs.gtk.org/Pango/pango_markup.html#pango-markup Pango markup formatting codes].&lt;br /&gt;
&lt;br /&gt;
Prefer to use single quotes (') instead of double quotes (&amp;quot;) within the formatting string, as double quotes would need to be escaped in WML (&amp;quot;&amp;quot;). Escaping markup can be done with [https://github.com/wesnoth/wesnoth/blob/9daa10a9f27c5a95520e871417bbd72aa52aa688/src/font/pango/escape.hpp#L38-L42 HTML entities].&lt;br /&gt;
&lt;br /&gt;
For example, if you wanted to write &amp;quot;You are victorious!&amp;quot; in large, italic, gold letters, you might write it this way:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&amp;lt;span color='#BCB088' size='large' font-style='italic'&amp;gt;You are victorious!&amp;lt;/span&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
These are the codes taken from the Pango markup formatting guide:&lt;br /&gt;
&lt;br /&gt;
*'''font''', '''font_desc''': A font description string, such as &amp;quot;Sans Italic 12&amp;quot;.&lt;br /&gt;
*'''font_family''', '''face''': A font family name.&lt;br /&gt;
*'''font_size''', '''size''': Font size in 1024ths of a point, or one of the absolute sizes 'xx-small', 'x-small', 'small', 'medium', 'large', 'x-large', 'xx-large', or one of the relative sizes 'smaller' or 'larger'.&lt;br /&gt;
*'''font_style''', '''style''': One of 'normal', 'oblique', 'italic'.&lt;br /&gt;
*'''font_weight''', '''weight''': One of 'ultralight', 'light', 'normal', 'bold', 'ultrabold', 'heavy', or a numeric weight.&lt;br /&gt;
*'''font_variant''', '''variant''': One of 'normal' or 'smallcaps'.&lt;br /&gt;
*'''font_stretch''', '''stretch''': One of 'ultracondensed', 'extracondensed', 'condensed', 'semicondensed', 'normal', 'semiexpanded', 'expanded', 'extraexpanded', 'ultraexpanded'.&lt;br /&gt;
*'''foreground''', '''fgcolor''', '''color''': An RGB color specification such as '#00FF00' or a color name such as 'red'. The full list of color names may be found in Pango's [https://github.com/GNOME/pango/blob/main/tools/rgb.txt rgb.txt] file.&lt;br /&gt;
*'''background, bgcolor''': An RGB color specification such as '#00FF00' or a color name such as 'red'.&lt;br /&gt;
*'''underline''': One of 'none', 'single', 'double', 'low', 'error'.&lt;br /&gt;
*'''underline_color''': The color of underlines; an RGB color specification such as '#00FF00' or a color name such as 'red'.&lt;br /&gt;
*'''rise''': Vertical displacement, in 10000ths of an em. Can be negative for subscript, positive for superscript.&lt;br /&gt;
*'''strikethrough''': 'true' or 'false' whether to strike through the text.&lt;br /&gt;
*'''strikethrough_color''': The color of strikethrough lines; an RGB color specification such as '#00FF00' or a color name such as 'red'&lt;br /&gt;
*'''fallback''': 'true' or 'false' whether to enable fallback. If disabled, then characters will only be used from the closest matching font on the system. No fallback will be done to other fonts on the system that might contain the characters in the text. Fallback is enabled by default. Most applications should not disable fallback.&lt;br /&gt;
*'''letter_spacing''': Inter-letter spacing in 1024ths of a point.&lt;br /&gt;
*'''gravity''': One of 'south', 'east', 'north', 'west', 'auto'.&lt;br /&gt;
*'''gravity_hint''': One of 'natural', 'strong', 'line'.&lt;br /&gt;
&lt;br /&gt;
The following pango attributes are also available directly as attributes of the '''[message]''' tag:&lt;br /&gt;
{{DevFeature1.13|4}}&lt;br /&gt;
&lt;br /&gt;
*'''font'''&lt;br /&gt;
*'''font_family'''&lt;br /&gt;
*'''font_size'''&lt;br /&gt;
*'''font_style'''&lt;br /&gt;
*'''font_weight'''&lt;br /&gt;
*'''font_variant'''&lt;br /&gt;
*'''font_stretch'''&lt;br /&gt;
*'''color'''&lt;br /&gt;
*'''bgcolor'''&lt;br /&gt;
*'''underline'''&lt;br /&gt;
*'''underline_color'''&lt;br /&gt;
*'''rise'''&lt;br /&gt;
*'''strikethrough'''&lt;br /&gt;
*'''strikethrough_color'''&lt;br /&gt;
*'''fallback'''&lt;br /&gt;
*'''letter_spacing'''&lt;br /&gt;
*'''gravity'''&lt;br /&gt;
*'''gravity_hint'''&lt;br /&gt;
&lt;br /&gt;
== [objectives] ==&lt;br /&gt;
The other tag used for plot development is '''[objectives]'''.&lt;br /&gt;
The '''[objectives]''' tag overwrites any previously set objectives,&lt;br /&gt;
and displays text which should describe the objectives of the scenario.&lt;br /&gt;
Scenario objectives are displayed on the player's first turn after the tag is used,&lt;br /&gt;
or as part of the event if it triggers during that player's turn.&lt;br /&gt;
Objectives can also be accessed at any time in a scenario using the&lt;br /&gt;
&amp;quot;Scenario Objectives&amp;quot; game menu option, making this tag useful for&lt;br /&gt;
scenario-specific information that the player may need to refer to during play.&lt;br /&gt;
&lt;br /&gt;
Attributes of '''[objectives]''':&lt;br /&gt;
* '''side''': Default '0'. The side to set the objectives for. A value of 0 sets objectives for all sides. note: There are side-specific objectives and default objectives, which are used in case a side doesn't have specific ones. Specifying 0 sets the default ones.&lt;br /&gt;
* '''[[StandardSideFilter]]''' tags and keys: Sets the objectives of all matching sides to these passed specifications (the rest of this [objectives] tag). If no sides (such as when passing side=0) or all sides match, sets the default objectives, and the side specific ones for the matching sides otherwise.&lt;br /&gt;
* '''bullet''': Default '• '. Replaces the default bullet, with whatever is passed, for all objectives, gold carryover notes, and notes defined with [note].&lt;br /&gt;
* '''summary''': Displayed first in the objectives text, this should describe the basic objective for the overall scenario.  Can be omitted.&lt;br /&gt;
* '''note''': Displayed last in the objectives text, this is sometimes used for hints or additional information.  Can be omitted.&lt;br /&gt;
* '''victory_string''': Default ' _ &amp;quot;Victory:&amp;quot;', this text precedes the victory objectives. Can be set to &amp;quot;&amp;quot; too.&lt;br /&gt;
* '''defeat_string''': Default ' _ &amp;quot;Defeat:&amp;quot;', this text precedes the defeat objectives. Can be set to &amp;quot;&amp;quot; too.&lt;br /&gt;
* '''gold_carryover_string''': Default ' _ &amp;quot;Gold carryover:&amp;quot;', this text precedes the gold carryover information.&lt;br /&gt;
* '''notes_string''': Default ' _ &amp;quot;Notes:&amp;quot;', this text precedes the notes.&lt;br /&gt;
* '''silent''': Default: not present. If set to &amp;quot;yes&amp;quot;, the objectives are silently changed. Else, they will be shown to the user when appropriate.&lt;br /&gt;
* '''delayed_variable_substitution''': {{DevFeature1.13|8}} If set to yes, any variables or [insert_tag] are not substituted right away. Instead, they are substituted whenever the objectives are actually viewed.&lt;br /&gt;
&lt;br /&gt;
Tags of '''[objectives]''':&lt;br /&gt;
* {{anchor|objectives-objective|'''[objective]'''}}: describes a win or loss condition. Most scenarios have multiple win or loss conditions, so use a separate [objective] subtag for each line; this helps with translations.&lt;br /&gt;
** '''bullet''': Default '• ' or whatever is set in the parent [objectives] block. Replaces the default bullet, with whatever is provided, for the objective defined by the [objective] block.&lt;br /&gt;
** '''red''': Default '0' for winning objectives, '255' for losing objectives. Overrides the default red coloring of the entire objective, including the bullet.&lt;br /&gt;
** '''green''': Default '255' for winning objectives, '0' for losing objectives. Overrides the default green coloring of the entire objective, including the bullet.&lt;br /&gt;
** '''blue''': Default '0'. Overrides the default blue coloring of the entire objective, including the bullet.&lt;br /&gt;
** '''description''': text for the specific win or loss condition.&lt;br /&gt;
** '''caption''': a text which will be displayed above the ''description''. This can be used to display a subcategory of objectives below ''victory_string'' or ''defeat_string''.&lt;br /&gt;
** '''condition''': The color and placement of the text. Values are 'win'(colored green, placed after ''victory_string'') and 'lose'(colored red, placed after ''defeat_string'').&lt;br /&gt;
** '''show_turn_counter''': If set to yes, displays the number of turns remaining in the scenario. Default is no.&lt;br /&gt;
** '''[show_if]''': A condition that disables the objective if it doesn't hold. Conditional objectives are refreshed at '''[show_objectives]''' time only, or when manually opening the scenario objectives.&lt;br /&gt;
* {{anchor|objectives-gold_carryover|'''[gold_carryover]'''}}: describes how the gold carryover works in this scenario. This is intended to be a more convenient way of displaying carryover information than using the note= key in [objectives].&lt;br /&gt;
** '''bullet''': Default '• ' or whatever is set in the parent [objectives] block. Replaces the default bullet with whatever is provided.&lt;br /&gt;
** '''red''': Default '255'. Overrides the default red coloring of the entire objective, including the bullet.&lt;br /&gt;
** '''green''': Default '255'. Overrides the default green coloring of the entire objective, including the bullet.&lt;br /&gt;
** '''blue''': Default '192'. Overrides the default blue coloring of the entire objective, including the bullet.&lt;br /&gt;
** '''bonus''' (boolean): whether an early finish bonus is granted. If omitted, early finish bonus is not mentioned.&lt;br /&gt;
** '''carryover_percentage''': the amount of carryover gold. If omitted, the amount is not mentioned.&lt;br /&gt;
** '''[show_if]''': {{DevFeature1.13|11}} Gold carryover will not be shown if the specified condition isn't met. Conditional gold carryover is refreshed at '''[show_objectives]''' time only.&lt;br /&gt;
* {{anchor|objectives-note|'''[note]'''}}: describes a note, usually used for hints or additional information. This is an easier way of adding several notes than concatenating them together into a single string to use with the ''note='' key.&lt;br /&gt;
** '''bullet''': Default '• ' or whatever is set in the parent [objectives] block. Replaces the default bullet with whatever is provided for the note defined by the [note] block.&lt;br /&gt;
** '''red''': Default '255'. Overrides the default red coloring of the entire note, including the bullet.&lt;br /&gt;
** '''green''': Default '255'. Overrides the default green coloring of the entire note, including the bullet.&lt;br /&gt;
** '''blue''': Default '255'. Overrides the default blue coloring of the entire note, including the bullet.&lt;br /&gt;
** '''description''': the text of the note.&lt;br /&gt;
** '''[show_if]''': The note will not be shown if the specified condition isn't met. Conditional notes are refreshed at '''[show_objectives]''' time only.&lt;br /&gt;
&lt;br /&gt;
== [set_menu_item] ==&lt;br /&gt;
This tag is used to add a custom option in the right-click context menu which can then be used to trigger arbitrary WML commands. The menu items can be set and modified during any event, for example during &amp;quot;start&amp;quot; or &amp;quot;prestart&amp;quot; events. The user can also assign hotkeys to these WML commands unless specified otherwise. When the hotkey is pressed the event will be fired/filtered at the current mouse position.&lt;br /&gt;
&lt;br /&gt;
'''Note:''' Due to limitations in portable devices where there are no scroll bars for context menus, there is a hard-coded limit of 7 custom WML menu items. If you really need to have more than 7 menu items, try combining some of them in a submenu. {{DevFeature1.13|0}} This limitation is being removed in a [http://forums.wesnoth.org/viewtopic.php?p=572554#p572554 future version] of Wesnoth.&lt;br /&gt;
&lt;br /&gt;
* '''id''': the unique id for this menu item. If a menu item with this id already exists, it allows you to set specific changes to that item. All menus will be sorted lexicographically by the id string. The ordering is underscores, digits, and finally letters.&lt;br /&gt;
* '''description''': the in-game text that will appear for this item in the menu.&lt;br /&gt;
* '''image''': the image to display next to this item, defaults to &amp;quot;buttons/WML-custom.png&amp;quot;&lt;br /&gt;
* '''needs_select''': if ''yes'' (default ''no''), then the latest select event (see [[EventWML]]) that triggered before this menu item was chosen will be transmitted over the network before this menu item action will be. This only has any effect in networked multiplayer, and is intended to allow more elaborate menu item behaviour there without causing out of sync errors. If you don't know what this means, just leave it. {{DevFeature1.13|6}} ''needs_select=yes'' is deprecated, consider using manual variable syncing with [sync_variable].&lt;br /&gt;
* '''synced''' {{DevFeature1.13|1}}: if ''no'' (default ''yes'') the command handler will only be run on the client that invoked the menu item; this means that changing the gamestate in a command handler of a menu item with ''synced=no'' will cause OOS&lt;br /&gt;
* '''use_hotkey''': if ''no'' (default ''yes''), then the user cannot assign hotkeys to this menu item. If ''only'', the menu item is only accessible via hotkeys, not via right-click context; you can use this in combination with [default_hotkey] if you want custom hotkeys in your campaign/mp. &lt;br /&gt;
* '''[show_if]''': If present, the menu item will only be available if the conditional statement (see [[ConditionalActionsWML#Condition_Tags|ConditionalActionsWML]]) within evaluates to true. When this is evaluated, the WML variables ''$x1'' and ''$y1'' will point to the location on which the context menu was invoked, so it's possible to for example only enable the option on empty hexes or on a particular unit.&lt;br /&gt;
* '''[filter_location]''': contains a [[StandardLocationFilter]] similar to the one found inside Single Unit Filters. The menu item will only be available on matching locations.&lt;br /&gt;
* '''[default_hotkey]''': contains a hotkey WML to specify what hotkey to assign to this, '''if the user has no hotkey assigned to this yet'''. (Unlike the rest of a menu item definition, modifying this tag has no effect on the game; it is only effective when initially defining a menu item.) Hotkey WML matches the format in the preferences file and contains the following keys:&lt;br /&gt;
** '''key''': a string that contains the key to assign to this.&lt;br /&gt;
** '''alt''', '''shift''', '''cmd'''(apple only), '''ctrl''':  boolean values.&lt;br /&gt;
** '''repeat_on_hold''' {{DevFeature1.13|12}}: if ''yes'' (default ''no''), holding the hotkey will repeat the action continuously, unless it blocks input with something like '''[message]'''. Due to a bug, versions older than 1.13.12 always repeat the action, with no way to disable it.&lt;br /&gt;
* '''[command]''': contains the WML actions to be executed when the menu item is selected. Again, the WML variables ''$x1'' and ''$y1'' will point to the location on which the context menu was invoked on.&lt;br /&gt;
** '''delayed_variable_substitution ''' (boolean yes|no, default: yes): If no, forces a variable substitution run onto the wml included in this [command] block. Use this, if you want variables which are to substitute to get the values they have at execution time of the event where this set_menu_item appears. Other than that, they get the values they have at invocation time of the menu item.&lt;br /&gt;
&lt;br /&gt;
== [clear_menu_item] ==&lt;br /&gt;
&lt;br /&gt;
Removes a menu item from the scenario.&lt;br /&gt;
Normally menu items are, including all their defining wml, automatically carried over between scenarios. This tag prevents this. (The behavior is comparable to set_variable/clear_variable).&lt;br /&gt;
* '''id''': (string): id of the menu item to clear. Can be a comma-separated list.&lt;br /&gt;
&lt;br /&gt;
== Other interface tags ==&lt;br /&gt;
&lt;br /&gt;
The following tags are also action tags:&lt;br /&gt;
&lt;br /&gt;
=== [change_theme] ===&lt;br /&gt;
&lt;br /&gt;
{{DevFeature1.13|8}}&lt;br /&gt;
&lt;br /&gt;
Change the current interface theme.&lt;br /&gt;
&lt;br /&gt;
* '''theme''': The ID of the new theme. Use &amp;lt;code&amp;gt;theme=&amp;lt;/code&amp;gt; (empty key) to switch back to the theme that the player has selected in Preferences. On &amp;lt;b&amp;gt;1.14.2&amp;lt;/b&amp;gt; and later it is also possible to omit the key entirely to achieve the same effect (on previous versions this will crash the Lua engine).&lt;br /&gt;
&lt;br /&gt;
=== [item] ===&lt;br /&gt;
Makes a graphical item appear on a certain hex. Note this only places the graphics for an item. It does not make the item do anything. Use a moveto event to make moving onto the item do something. &amp;lt;tt&amp;gt;''('''Hint:''' There are a number of predefined items that are used in various campaigns that you can make use of. You can find [http://www.wesnoth.org/macro-reference.xhtml#file:items.cfg a list of them] if you look into the items.cfg file in the wesnoth install directory (under /data/core/macros).)''&amp;lt;/tt&amp;gt;&lt;br /&gt;
* '''x''', '''y''': the location to place the item. (only for [event][item]: full [[StandardLocationFilter|SLF]] support)&lt;br /&gt;
* '''image''': the image (in ''images/'' as .png) to place on the hex. This image is aligned with the top-left of the hex (which is 72 pixels wide and 72 pixels tall). It is drawn underneath units. ''('''Hint:''' If using an image smaller than 72x72, then it might be useful to [[ImagePathFunctions#Blit_Function|BLIT]] the image onto &amp;lt;tt&amp;gt;misc/blank-hex.png&amp;lt;/tt&amp;gt; (a blank 72x72 image).)''&lt;br /&gt;
* '''halo''': an image to place centered on the hex. It is drawn on top of units. Use this instead of ''image'' if the image is bigger than the hex or if you want to animate an image (https://github.com/wesnoth/wesnoth/issues/1219).&lt;br /&gt;
* '''name''' an id that can be used to remove the item.&lt;br /&gt;
''Example (where the integer after the colon is the duration of each frame or square bracket expansion as per AnimationWML is used): halo=scenery/fire1.png:100,scenery/fire2.png:100,scenery/fire3.png:100,scenery/fire4.png:100,scenery/fire5.png:100,scenery/fire6.png:100,scenery/fire7.png:100,scenery/fire8.png:100''&lt;br /&gt;
or equivalently (requires Wesnoth 1.11.2+):&lt;br /&gt;
''halo=scenery/fire[1~8].png:100''&lt;br /&gt;
* '''team_name''': name of the team for which the item is to be displayed (hidden for others). For multiple teams just put all the names in one string, for example separated by commas. {{DevFeature1.15|0}} In 1.14 the '''[side]team_name''' attribute was expected to be a substring of this '''team_name'''. In 1.15 both are expected to be comma-separated lists of names and the item is visible if the lists intersect. ([[https://github.com/wesnoth/wesnoth/pull/3533|#3533]])&lt;br /&gt;
* '''visible_in_fog''': whether the item should be visible through fog or not. Default yes.&lt;br /&gt;
* '''submerge''': float, between 0 and 1: specifies how much of the image should be submerged. Gets multiplied with [[TerrainWML|[terrain]]]&amp;lt;nowiki/&amp;gt;submerge. Default 0.&lt;br /&gt;
* '''z_order''': float: defines the order the items get drawn in. Default 0.&lt;br /&gt;
* '''redraw''': (boolean yes|no, default: yes): If no, disables implicit calls to [[InterfaceActionsWML#.5Bredraw.5D|[redraw]]] when placing the items.&lt;br /&gt;
* '''[filter_team]''': {{DevFeature1.15|0}} A [[StandardSideFilter]]. Set '''team_name''' to the union of all '''[side]team_name''' attributes of all sides that match the SSF. ([[https://github.com/wesnoth/wesnoth/pull/3533|#3533]])&lt;br /&gt;
* {{DevFeature1.15|0}} If both '''team_name''' and '''[filter_team]''' are set, '''team_name''' is ignored.&lt;br /&gt;
&lt;br /&gt;
=== [remove_item] ===&lt;br /&gt;
Removes any graphical items on a given hex.&lt;br /&gt;
* [[StandardLocationFilter]]: the hexes to remove items from&lt;br /&gt;
* '''image''': if specified, only removes the given item if one of its 'image', 'halo' or 'name' attributes is exactly this value. (for 'halo' and 'image' this in particular means that the image name must include any [[ImagePathFunctions|image path functions]] appended to the original image name.)&lt;br /&gt;
&lt;br /&gt;
=== [print] ===&lt;br /&gt;
Displays a message across the screen. The message will disappear after a certain time, or when another [print] tag is encountered.&lt;br /&gt;
* '''text''': (translatable) the text to display. Can be an empty string to remove a previous message without showing a new one.&lt;br /&gt;
* '''size''': (default=12) the pointsize of the font to use&lt;br /&gt;
* '''duration''': the length of time to display the text for.&lt;br /&gt;
** (Before 1.15.4) This is measured in the number of 'frames', and the default is 50. A frame in Wesnoth is usually displayed for around 30ms.&lt;br /&gt;
** {{DevFeature1.15|4}} This is measured in milliseconds. Don't use the default value, because it's a mere 50ms.&lt;br /&gt;
** {{DevFeature1.15|14}} The default is 5000 milliseconds.&lt;br /&gt;
** {{DevFeature1.15|14}} The string '''unlimited''' displays the text until it's removed by another [print] tag.&lt;br /&gt;
* '''color''': (default '''0,0,0''') three comma-separated values giving the red, green and blue values (0-255).&lt;br /&gt;
* '''red''', '''green''', '''blue''': deprecated, use color=0,0,0 instead.&lt;br /&gt;
&lt;br /&gt;
=== [move_unit_fake] ===&lt;br /&gt;
Moves an image of a unit along a certain path on the map. The path does not need to be a continuous list of adjacent hexes, so for example only the start and end points can be given, in which case the straightest line between those points will be calculated and used.&lt;br /&gt;
* '''type''': the type of the unit whose image to use&lt;br /&gt;
* '''x''': a comma-separated list of x locations to move along&lt;br /&gt;
* '''y''': a comma-separated list of y locations to move along (x and y values are matched pairs)&lt;br /&gt;
* '''side''': the side of the fake unit, used for team-coloring the fake unit&lt;br /&gt;
* '''gender''': the gender of the fake unit. Example: gender=female&lt;br /&gt;
* '''variation''': the variation of the fake unit. Example: variation=undead&lt;br /&gt;
* '''image_mods''': [[ImagePathFunctions|image path functions]] sequence to be applied on the fake unit.&lt;br /&gt;
* '''force_scroll''':  Whether to scroll the map or not even when [[#.5Block_view.5D|[lock_view]]] is in effect or ''Follow Unit Actions'' is disabled in ''Advanced Preferences''. Defaults to ''yes'' starting with version '''1.11.6'''; the attribute did not exist in previous versions and this action behaved as if ''no'' was passed instead.&lt;br /&gt;
&lt;br /&gt;
=== [move_units_fake] ===&lt;br /&gt;
moves multiple images of units along paths on the map. These units are moved in lockstep.&lt;br /&gt;
* '''force_scroll''': {{DevFeature1.15|0}} Has the same meaning as in [move_unit_fake] but a different default.&lt;br /&gt;
* '''[fake_unit]''': A fake unit to move&lt;br /&gt;
** '''type''': the type of unit whose image to use&lt;br /&gt;
** '''x''': a comma-separated list of x locations to move along&lt;br /&gt;
** '''y''': a comma-separated list of y locations to move along (x and y values are matched pairs)&lt;br /&gt;
** '''side''': the side of the fake unit, used for team-coloring the fake unit&lt;br /&gt;
** '''skip_steps''': the number of steps to skip before this unit starts moving&lt;br /&gt;
&lt;br /&gt;
=== [hide_unit] ===&lt;br /&gt;
Temporarily prevents the engine from displaying the given unit. The unit does not become invisible, as it would be with the '''[hides]''' ability; it is still the same plain unit, but without an image. Useful in conjunction with '''[move_unit_fake]''': to move a leader unit into position on-screen. Until 1.8 each '''[hide_unit]''' tag only hides one unit.&lt;br /&gt;
* [[StandardUnitFilter]]: All matching units will be hidden&lt;br /&gt;
&lt;br /&gt;
=== [unhide_unit] ===&lt;br /&gt;
Stops the currently hidden units from being hidden.&lt;br /&gt;
* [[StandardUnitFilter]]: Only the matching units will be unhidden&lt;br /&gt;
&lt;br /&gt;
=== [lock_view] ===&lt;br /&gt;
Locks gamemap view scrolling for human players, so they cannot scroll the gamemap view until it is unlocked. WML or Lua actions such as '''[scroll_to]''' will continue to work normally, as they ignore this restriction; the locked/unlocked state is preserved when saving the current game.&lt;br /&gt;
&lt;br /&gt;
This feature is generally intended to be used in cutscenes to prevent the player scrolling away from scripted actions.&lt;br /&gt;
&lt;br /&gt;
{{DevFeature1.13|8}} This now also blocks the player from zooming the gamemap view. WML or Lua zoom will continue to work normally.&lt;br /&gt;
&lt;br /&gt;
=== [unlock_view] ===&lt;br /&gt;
Unlocks gamemap view scrolling for human players.&lt;br /&gt;
&lt;br /&gt;
=== [scroll] ===&lt;br /&gt;
Scroll a certain number of pixels in a given direction. Useful for earthquake/shaking effects.&lt;br /&gt;
* '''x''', '''y''': the number of pixels to scroll along the x and y axis&lt;br /&gt;
* '''side''': the side or sides for which this should happen. By default, the [scroll] happens for everyone.&lt;br /&gt;
* '''[filter_side]''': a [[StandardSideFilter]] to select the sides for which this should happen. By default, the [scroll] happens for everyone.&lt;br /&gt;
&lt;br /&gt;
=== [scroll_to] ===&lt;br /&gt;
Scroll to a given hex&lt;br /&gt;
* [[StandardLocationFilter]], do not use a [filter_location] sub-tag. If more than one location matches the filter, only the first matching location will be used.&lt;br /&gt;
* '''check_fogged''': whether to scroll even to locations covered in fog or shroud. Possible values ''yes'' (don't scroll to fog) and ''no'' (scroll even to fog), with ''no'' as the default.&lt;br /&gt;
* '''immediate''': whether to instantly warp to the target hex regardless of the scroll speed setting in Preferences (defaults to ''no'').&lt;br /&gt;
* '''highlight''': {{DevFeature1.13|5}} Whether to highlight the hex being scrolled to (defaults to ''no'').&lt;br /&gt;
* '''side''': the side or sides for which this should happen. By default, the [scroll_to] happens for everyone.&lt;br /&gt;
* '''[filter_side]''': a [[StandardSideFilter]] to select the sides for which this should happen. By default, the [scroll_to] happens for everyone.&lt;br /&gt;
&lt;br /&gt;
=== [scroll_to_unit] ===&lt;br /&gt;
Scroll to a given unit&lt;br /&gt;
* [[StandardUnitFilter]]; do not use a [filter] subtag.&lt;br /&gt;
* '''check_fogged''': whether to scroll even to locations covered in fog or shroud. Possible values ''yes'' (don't scroll to fog) and ''no'' (scroll even to fog), with ''no'' as the default.&lt;br /&gt;
* '''immediate''': whether to instantly warp to the target hex regardless of the scroll speed setting in Preferences (defaults to ''no'').&lt;br /&gt;
* '''highlight''': {{DevFeature1.13|5}} Whether to highlight the hex the unit is on (defaults to ''no'').&lt;br /&gt;
* '''for_side''': the side or sides for which this should happen. By default, the [scroll_to_unit] happens for everyone.&lt;br /&gt;
* '''[for_side]''': a [[StandardSideFilter]] to select the sides for which this should happen. By default, the [scroll_to_unit] happens for everyone.&lt;br /&gt;
&lt;br /&gt;
=== [select_unit] ===&lt;br /&gt;
Selects a given unit.&lt;br /&gt;
* [[StandardUnitFilter]]: The first unit found will be selected.&lt;br /&gt;
* '''fire_event''': whether a ''select'' event should be triggered or not (def. ''no''). (Note that select events aren't multiplayer save.)&lt;br /&gt;
* '''highlight''': whether the unit's current hex should be highlighted (def. ''yes'').&lt;br /&gt;
&lt;br /&gt;
'''Note:''' fire_event does not appear to work in 1.14 or 1.16.&lt;br /&gt;
&lt;br /&gt;
=== [sound]===&lt;br /&gt;
Plays a sound&lt;br /&gt;
* '''name''': the filename of the sound to play (in ''sounds/'' as .wav or .ogg). This can be a comma-separated list, from which one sound will be chosen randomly.&lt;br /&gt;
* '''repeat''': repeats the sound for a specified additional number of times (default=0)&lt;br /&gt;
&lt;br /&gt;
=== [sound_source] ===&lt;br /&gt;
Creates a sound source. &amp;quot;Sound sources&amp;quot; is a general name for a mechanism which makes possible for map elements to emit sounds according to some rules, where &amp;quot;map elements&amp;quot; can be specific locations or terrain types. For now, only sound sources tied to locations are supported.&lt;br /&gt;
* '''id''': a unique identification key of the sound source&lt;br /&gt;
* '''sounds''': a list of comma separated, randomly played sounds associated with the sound source&lt;br /&gt;
* '''delay''': a numerical value (in milliseconds) of the minimal delay between two playbacks of the source's sound if the source remains visible on the screen; if one scrolls out and back in, the source will be considered as ready to play&lt;br /&gt;
* '''chance''': a percentage (a value from 0 to 100) describing the chance of the source being activated every second after the delay has passed or when the source's location appears on the screen (note that it cannot play more than one file at the same time)&lt;br /&gt;
* '''check_fogged''': possible values ''yes'' and ''no'' - ''yes'' means the source will not play if its locations are fogged&lt;br /&gt;
* '''check_shrouded''': possible values ''yes'' and ''no'' - ''yes'' means the source will not play if its locations are shrouded&lt;br /&gt;
* '''x,y''': similar to x,y as found in a [[StandardLocationFilter]], these are the locations associated with the sound source&lt;br /&gt;
* '''fade_range''' (default = 3): distance in hexes that determines a &amp;quot;circular&amp;quot; area around the one specified by '''full_range''' where sound volume fades out linearly&lt;br /&gt;
* '''full_range''' (default = 14): distance in hexes that determines a &amp;quot;circular&amp;quot; area where source plays with full volume, relative to screen center&lt;br /&gt;
* '''loop''': number of times a sound sample should be looped if it stays visible. -1 means infinite (~65000)&lt;br /&gt;
&lt;br /&gt;
=== [story] ===&lt;br /&gt;
{{DevFeature1.13|8}}&lt;br /&gt;
&lt;br /&gt;
Shows the story screen.&lt;br /&gt;
* '''title''': Default title used if a part does not specify one — unlike the intro storyscreen, the scenario name is not used as a default title.&lt;br /&gt;
* '''[part]''', '''[if]''', '''[switch]''', '''[wml_message]''', '''[deprecated_message]''' : See [[IntroWML]].&lt;br /&gt;
&lt;br /&gt;
=== [remove_sound_source] ===&lt;br /&gt;
Removes a previously defined sound source.&lt;br /&gt;
* '''id''': the identification key of the sound source to remove&lt;br /&gt;
&lt;br /&gt;
=== [music] ===&lt;br /&gt;
Switches to playing different music&lt;br /&gt;
* '''name''': the filename of the music to play (in ''music/'' as .ogg)&lt;br /&gt;
* see [[MusicListWML]] for the correct syntax&lt;br /&gt;
&lt;br /&gt;
=== [volume] ===&lt;br /&gt;
Changes the game volume to a percent of the preferences volume for the game being played. Values can go from 0 to 100:  &lt;br /&gt;
* '''music''':  Changes the music volume.&lt;br /&gt;
* '''sound''':  Changes the sound volume.&lt;br /&gt;
&lt;br /&gt;
=== [color_adjust] ===&lt;br /&gt;
Adjust the color tint of terrain, by adjusting time-of-day coloring.&lt;br /&gt;
* '''red''', '''green''', '''blue''': values from -255 to 255, the amount to tint by for each color&lt;br /&gt;
&lt;br /&gt;
=== [screen_fade] ===&lt;br /&gt;
{{DevFeature1.17|6}}&lt;br /&gt;
&lt;br /&gt;
Overlay the game display with the given color, fading over the specified duration. This can be used for screen fade effects.&lt;br /&gt;
* '''red''', '''green''', '''blue''': values from 0 to 255, the final overlay color (defaults to 0,0,0)&lt;br /&gt;
* '''alpha''': value from 0 to 255, the strength of the effect. 0 means no effect and can be used to fade in. 255 means fully opaque and can be used to fully fade out to the given color. Intermediate values will end up with a partial overlay tint on the game screen.&lt;br /&gt;
* '''duration''': the length of time it will take to complete the fade, in milliseconds. If 0 the effect is immediate.&lt;br /&gt;
&lt;br /&gt;
=== [delay] ===&lt;br /&gt;
Pauses the game.&lt;br /&gt;
* '''time''': the time to pause in milliseconds&lt;br /&gt;
* '''accelerate ''' (boolean yes|no, default no): {{DevFeature1.13|0}} whether the delay is affected by acceleration. When [delay] is used to make an animation, this should be set to yes so that your animation matches the ones generated by the game.&lt;br /&gt;
&lt;br /&gt;
=== [redraw] ===&lt;br /&gt;
Redraws the screen (this normally isn't done during events, although some of the other interface actions cause the screen or parts of it to be redrawn).&lt;br /&gt;
* '''clear_shroud''' (boolean yes|no, default no): If yes, clears fog and shroud around existing units. Useful if you, for example, spawn friendly units in the middle of an event and want the shroud to update accordingly (otherwise units that spawn inside fog would remain invisible for the duration of the event, since the fog would not automatically get cleared around them).&lt;br /&gt;
* '''[[StandardSideFilter]]''': the sides for which to recalculate fog and shroud.&lt;br /&gt;
* '''side''': If used (forces clear_shroud=yes), clears fog and shroud for that side.&lt;br /&gt;
&lt;br /&gt;
=== [unit_overlay] ===&lt;br /&gt;
Sets an image that will be drawn over a particular unit, and follow it around&lt;br /&gt;
* [[StandardUnitFilter]]: All matching units will get the overlay (do not use [filter])&lt;br /&gt;
* '''image''': the image to place on the unit&lt;br /&gt;
* '''object_id''': object id to use, defaults to the '''image''' key with an &amp;quot;overlay_&amp;quot; prefix; this allows using [[DirectActionsWML#.5Bremove_object.5D|'''[remove_object]''']]&lt;br /&gt;
* '''duration''': object duration&lt;br /&gt;
&lt;br /&gt;
=== [remove_unit_overlay] ===&lt;br /&gt;
Removes a particular overlayed image from a unit&lt;br /&gt;
* [[StandardUnitFilter]]: The overlay will get removed from all matching units (do not use [filter])&lt;br /&gt;
* '''image''': the image to remove from the unit&lt;br /&gt;
* '''object_id''': object id to use&lt;br /&gt;
Using [[DirectActionsWML#.5Bremove_object.5D|'''[remove_object]''']] is also possible, see https://github.com/wesnoth/wesnoth/commit/26c2f941f2bcdd89528481e114c0375ad2a46271&lt;br /&gt;
&lt;br /&gt;
=== [animate_unit] ===&lt;br /&gt;
Uses an animation of a unit to animate it on screen (if the unit has the corresponding animation).&lt;br /&gt;
* '''flag''': The key to find the custom animation in the unit description (see the '''[extra_anim]''' description in [[AnimationWML]]). Standard animations can be triggered with the following keywords: ''leading recruited standing idling levelout levelin healing healed poisoned movement defend attack death victory pre_teleport post_teleport''&lt;br /&gt;
* '''[filter]''' with a [[StandardUnitFilter]] as argument, see [[FilterWML]]. By default, the unit at the event location will be animated. You can use this tag to choose any other unit to animate.&lt;br /&gt;
* '''[primary_attack]''': If this tag is not present, the filter for animation will be triggered with no attack. If it is here, all attacks from the unit will be filtered, and a matching one will be used to filter the animation. Takes a weapon filter as argument, see [[FilterWML]].&lt;br /&gt;
* '''[secondary_attack]''': Similar to '''[primary_attack]'''. May be needed to trigger a defense animation correctly, if there are more than one animations available for the defending unit.&lt;br /&gt;
* '''hits''': yes/no/hit/miss/kill: which according variation of a attack/defense animation shall be chosen (required)&lt;br /&gt;
* '''text''': a text to hover during the animation &lt;br /&gt;
* '''male_text''', '''female_text''': {{DevFeature1.13|2}} (translatable) gender-specific versions of the above&lt;br /&gt;
* '''red''': red value for the text color (0-255)&lt;br /&gt;
* '''green''': green value for the text color&lt;br /&gt;
* '''blue''': blue value for the text color&lt;br /&gt;
* '''with_bars''': yes/no: whether to display the status bars during the animation (e.g. the hitpoint bar)&lt;br /&gt;
* '''[animate]''': a sub block with the same syntax as '''[animate_unit]''' except that the '''[filter]''' block is mandatory to find the unit. This block will find and animate another unit simultaneously.&lt;br /&gt;
* '''[facing]''': a [[StandardLocationFilter]] specifying what hex the unit should be facing when animated&lt;br /&gt;
&lt;br /&gt;
=== [label] ===&lt;br /&gt;
Places a label on the map.&lt;br /&gt;
* '''x''', '''y''': the location of the label. {{DevFeature1.13|1}} (only for [event][label]: full [[StandardLocationFilter|SLF]] support)&lt;br /&gt;
* '''text''': what the label should say. If you put an empty string &amp;lt;code&amp;gt;&amp;quot;&amp;quot;&amp;lt;/code&amp;gt; as an argument, the label will be completely removed. Use this method if you want to remove a specific label from any location.&lt;br /&gt;
* '''team_name''': if specified, the label will only be visible to the given team.&lt;br /&gt;
* '''color''': color of the label. The format is r,g,b; r, g and b are numbers between 0 and 255. When you use Pango markup in the text, you cannot use this, but in that case you could colorize the text via Pango markup.&lt;br /&gt;
* '''visible_in_fog''': whether the label should be visible through fog or not. Default yes.&lt;br /&gt;
* '''visible_in_shroud''': whether the label should be visible through shroud or not. Default no.&lt;br /&gt;
* '''immutable''': whether this label is protected from being removed or changed by players. Default yes.&lt;br /&gt;
* '''category''': the Show/Hide Labels dialog allows showing/hiding all labels of a given category by toggling a checkbox.&lt;br /&gt;
* '''tooltip''': A tooltip visible when mouseovering the hex the label is on&lt;br /&gt;
* '''side''': the number of the side that placed the label. Can be 0 for labels placed by WML.&lt;br /&gt;
&lt;br /&gt;
=== [floating_text]===&lt;br /&gt;
Floats text (similar to the damage and healing numbers) on the given locations.&lt;br /&gt;
* [[StandardLocationFilter]]: the text will be floated on all matching locations simultaneously (do not use [filter] unless you intend to match one or more units).&lt;br /&gt;
* '''text''': the text to display.&lt;br /&gt;
&lt;br /&gt;
The default text color is &amp;lt;span style=&amp;quot;color: #6b8cff;&amp;quot;&amp;gt;'''#6b8cff'''&amp;lt;/span&amp;gt;. To change the color, use [[#Formatting|Pango markup]]. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# Float some golden yellow text at 20,20.&lt;br /&gt;
[floating_text]&lt;br /&gt;
   x,y=20,20&lt;br /&gt;
   text=&amp;quot;&amp;lt;span color='#cccc33'&amp;gt;&amp;quot; + _ &amp;quot;Your text here&amp;quot; + &amp;quot;&amp;lt;/span&amp;gt;&amp;quot;&lt;br /&gt;
[/floating_text]&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== [deprecated_message] ===&lt;br /&gt;
Shows a deprecated message in the message area, this feature is only intended to be used to warn about deprecated macros in mainline. The message is not translatable.&lt;br /&gt;
* '''message''': the message to show.&lt;br /&gt;
* '''level''': {{DevFeature1.13|10}} The deprecation level, a number from 1 to 3.&lt;br /&gt;
* '''what''': {{DevFeature1.13|10}} The name of the thing being deprecated. Use this instead of '''message''' if possible; a stock message will be generated from it. Use '''message''' only if more information is required; it will be appended to the stock message. This should not be translatable&lt;br /&gt;
* '''version''': {{DevFeature1.13|10}} For deprecation levels 2 and 3, this indicates the version in which the feature could be removed. It does ''not'' indicate the version in which it became deprecated. &lt;br /&gt;
&lt;br /&gt;
The meanings of the deprecation levels are as follows:&lt;br /&gt;
&lt;br /&gt;
# Deprecated, but will only be removed if absolutely necessary. The '''version''' key is ignored.&lt;br /&gt;
# It will be removed no earlier than a specified version.&lt;br /&gt;
# It will be removed in the next stable version&lt;br /&gt;
# It has already been removed, leaving just a stub to inform users of how to update their code.&lt;br /&gt;
&lt;br /&gt;
Note that as of 1.13.11, deprecation messages show only in the log, not in the chat message area. The '''message''' can be translatable, but does not need to be.&lt;br /&gt;
&lt;br /&gt;
=== [wml_message] ===&lt;br /&gt;
Outputs a message to Wesnoth's console output. Intended for campaign designers to output silent text to the console, without annoying the player; then, that text might contain information useful for later bug-reporting. WML wrapper of [[LuaAPI/wesnoth#wesnoth.log]], see the link for more description.&lt;br /&gt;
* '''message''': the message to show.&lt;br /&gt;
* '''to_chat''': controls whether message is visible in chat, though logger=wml means message is visible anyways. Default ''no''.&lt;br /&gt;
* '''logger''': one of '''info''', '''debug''', '''warning''', '''error''', '''wml'''. Default ''info''.&lt;br /&gt;
&lt;br /&gt;
=== [test_condition] ===&lt;br /&gt;
&lt;br /&gt;
{{DevFeature1.13|2}}&lt;br /&gt;
&lt;br /&gt;
Evaluates the contained conditional tags. If they evaluate to the expected value, it prints out a message to the console explaining which part of the condition caused this result in a way similar to [wml_message]. This can be used if your conditional test is failing and you're not sure why.&lt;br /&gt;
&lt;br /&gt;
* '''result''': Whether you expect the conditions to fail or succeed. If no (the default), a message will be printed if the conditional tags fail. If yes, a message will instead be printed if the conditional tags pass.&lt;br /&gt;
* '''logger''': Same as for [wml_message]. Defaults to &amp;quot;warning&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
=== [open_help] ===&lt;br /&gt;
Opens the in-game help.&lt;br /&gt;
* '''topic''': the id of the topic to open&lt;br /&gt;
&lt;br /&gt;
Examples of ids:&lt;br /&gt;
* unit_Mage&lt;br /&gt;
* unit_Dark Adept&lt;br /&gt;
* weaponspecial_charge&lt;br /&gt;
* terrain_human_castle&lt;br /&gt;
&lt;br /&gt;
The engine will print the topic ids if run from the command line with the ''--log-debug=help'' option.&lt;br /&gt;
&lt;br /&gt;
=== [show_objectives] ===&lt;br /&gt;
refreshes the objectives defined by [objectives] and its [show_if] tags, and displays them. (It is also called whenever the user explicitly asks for the objectives; this matters only if the tag was overridden by a [[LuaWML#register_wml_action|Lua]] script.)&lt;br /&gt;
* '''side''': the side to show the objectives. If not set, all sides are used.&lt;br /&gt;
* '''[[StandardSideFilter]]''' tags and keys: Tag affects the matching sides instead of just all or the one given by the integer value of the side= key.&lt;br /&gt;
&lt;br /&gt;
=== [chat] ===&lt;br /&gt;
Displays a message in the chat area, not visible for observers. Alternative unconditionally visible for everyone: [[LuaWML:Display#wesnoth.message]]. {{DevFeature1.13|9}} can be visible for observers.&lt;br /&gt;
* '''speaker''': (default=&amp;quot;WML&amp;quot;) A string for the name of the sender of the message.&lt;br /&gt;
* '''message''': The message that should be displayed.&lt;br /&gt;
* '''observable''' (boolean yes|no, default yes): {{DevFeature1.13|9}} Whether the message is displayed for observers.&lt;br /&gt;
* '''[[StandardSideFilter]]''' tags and keys as argument; if the same client controls multiple sides that match, then the message will only be displayed once.&lt;br /&gt;
&lt;br /&gt;
=== [zoom] ===&lt;br /&gt;
&lt;br /&gt;
{{DevFeature1.13|8}}&lt;br /&gt;
&lt;br /&gt;
Changes the zoom level of the map.&lt;br /&gt;
&lt;br /&gt;
* '''factor''': The new zoom factor, measured as a multiple of the base zoom.&lt;br /&gt;
* '''relative''': If yes, zoom relative to current zoom level. Otherwise, set the absolute zoom level. Default no.&lt;br /&gt;
&lt;br /&gt;
== Useful Macros ==&lt;br /&gt;
There are some predefined macros that you find useful for interface 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;
* '''{HIGHLIGHT_UNIT}''' Highlight a unit on the map. Use this to show important units&lt;br /&gt;
* '''{HIGHLIGHT_IMAGE}''' Places and highlights an image on the map. Use this to show important items or locations&lt;br /&gt;
* '''{SET_IMAGE}''' Places an image on the map which has no other function.&lt;br /&gt;
* '''{QUAKE &amp;lt;soundfile&amp;gt;}''' Creates a tremor-like screenshake and plays &amp;lt;soundfile&amp;gt;. For example, '''{QUAKE (rumble.ogg)}'''.&lt;br /&gt;
* '''{FLASH_WHITE}''' Flash the screen white momentarily. You can also replace WHITE with RED, BLUE or GREEN for a different colour.&lt;br /&gt;
&lt;br /&gt;
== See Also ==&lt;br /&gt;
* [[DirectActionsWML]]&lt;br /&gt;
* [[InternalActionsWML]]&lt;br /&gt;
* [[EventWML]]&lt;br /&gt;
* [[ReferenceWML]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category: WML Reference]]&lt;br /&gt;
[[Category: ActionsWML]]&lt;/div&gt;</summary>
		<author><name>Soliton</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.wesnoth.org/index.php?title=GameConfigWML&amp;diff=74415</id>
		<title>GameConfigWML</title>
		<link rel="alternate" type="text/html" href="https://wiki.wesnoth.org/index.php?title=GameConfigWML&amp;diff=74415"/>
		<updated>2025-06-27T14:34:48Z</updated>

		<summary type="html">&lt;p&gt;Soliton: /* The [game_config] tag */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{WML Tags}}&lt;br /&gt;
== The [game_config] tag ==&lt;br /&gt;
&lt;br /&gt;
This tag is a top level WML tag which can only be used once because&lt;br /&gt;
it defines basic settings that are used everywhere in the game.&lt;br /&gt;
In official versions of Wesnoth it is in ''game_config.cfg''; values used there are labeled 'standard'.&lt;br /&gt;
&lt;br /&gt;
{{Note|This page is very outdated, and will take multiple edits to update.}}&lt;br /&gt;
&lt;br /&gt;
The following keys are recognised&lt;br /&gt;
* '''base_income''': (standard 2) how much your leader earns without any villages&lt;br /&gt;
* '''village_income''': (standard 1) how much your leader earns for each village you control&lt;br /&gt;
* '''village_support''': (standard 1) how many unit levels a village supports&lt;br /&gt;
* '''poison_amount''': (standard 8) the amount of damage poison deals to a unit&lt;br /&gt;
* '''rest_heal_amount''': (standard 2) how much HP a unit gains each turn it rests&lt;br /&gt;
* '''recall_cost''': (standard 20) how much it costs to recall a unit; this cost is independent of level.&lt;br /&gt;
* '''kill_experience''': (standard 8) killing a unit with ''level=X'' will give ''X''*''kill_experience'' experience to the killing unit. However, if a unit has ''level=0'', it will still give half of ''X'' experience.&lt;br /&gt;
&lt;br /&gt;
* '''default_defeat_music''': (standard 'defeat.ogg,defeat2.ogg') default list of music tracks that are chosen to play on player's defeat; this can be overriden per-scenario&lt;br /&gt;
* '''default_victory_music''': (standard 'victory.ogg,victory2.ogg') default list of music tracks that are chosen to play on player's victory; this can be overriden per-scenario&lt;br /&gt;
* '''title_music''': (standard 'main_menu.ogg') the music to play at the title screen&lt;br /&gt;
&lt;br /&gt;
* '''energy''': (standard 'misc/bar-energy.png') the images used to display hp/xp bars.&lt;br /&gt;
* '''orb''': (standard 'misc/orb.png') the orb image to add on top of the hp bar, this is recolorable to show the status; see 'Orbs', [[WesnothManual]]&lt;br /&gt;
* '''orb_two_color''': (standard 'misc/orb-two-color.png') like '''orb''', but has two separate recolorable parts. Note this is the image to use, although the colors to use for recoloring it also have names that end '_color'.&lt;br /&gt;
* '''show_moved_orb''', '''show_partial_orb''', '''show_unmoved_orb''': (default to 'yes' when omitted from the .cfg) whether to show the orb for the player's own units when they're in the given state&lt;br /&gt;
* '''show_disengaged_orb''': (defaults to 'yes' when omitted from the .cfg) whether to show a special orb instead of the &amp;quot;partial&amp;quot; orb when a unit can move but can't attack&lt;br /&gt;
* '''show_ally_orb''': (defaults to 'yes' when omitted from the .cfg) whether to show an orb on allied units&lt;br /&gt;
* '''show_enemy_orb''': (defaults to '' 'no' '' when omitted from the .cfg) whether to show an orb on opposing units&lt;br /&gt;
* '''show_status_on_ally_orb''': (defaults to 'yes' when omitted from the .cfg) if true, during allies' turns their units have orbs that show the unmoved/partial/moved status. If true, overrides 'show_ally_orb' during that ally's turn.&lt;br /&gt;
* '''ally_orb_color''': (standard 'lightblue') target for recoloring the ally orb&lt;br /&gt;
* '''enemy_orb_color''': (standard 'black') target for recoloring the enemy orb, although by default this orb is not shown&lt;br /&gt;
* '''moved_orb_color''': (standard 'red') target for recoloring the moved orb&lt;br /&gt;
* '''partial_orb_color''': (standard 'brightorange') target for recoloring the partially-moved orb, also used for half of the disengaged orb&lt;br /&gt;
* '''unmoved_orb_color''': (standard 'brightgreen') target for recoloring the fully-moved orb, also used for half of the disengaged orb&lt;br /&gt;
&lt;br /&gt;
* '''flag_image''': (standard 'image/flag'terrain/flag-1.png:150,terrain/flag-2.png:150,terrain/flag-3.png:150,terrain/flag-4.png:150') the default flag animation to mark captured villages (if no custom flag is defined in the [side] tag). By example, this animation has 4 frames of 150ms each. An automatic side-coloring is applied. &lt;br /&gt;
* '''flag_icon_image''': (standard 'flags/flag-icon.png') the default flag icon to indicate the side playing in the statusbar (if no custom flag_icon is defined in the [side] tag). An automatic side-coloring is applied. &lt;br /&gt;
* ''' hp_bar_scaling ''': (standard '0.6') The ratio of hitpoints to height used for displaying the hp bar. Can be overwritten in [unit] and [unit_type].&lt;br /&gt;
* ''' xp_bar_scaling ''': (standard '0.5') The ratio of xp to height used for displaying the xp bar. Can be overwritten in [unit] and [unit_type].&lt;br /&gt;
&lt;br /&gt;
* '''footprint_left_nw''', '''footprint_left_n''', '''footprint_right_nw''', '''footprint_right_n''': images used to display the path that a unit would take to the tile the cursor is on.&lt;br /&gt;
The first image of each key is used for tiles which would take only 1 movement point for the selected unit to move onto;&lt;br /&gt;
the second for ones which would take more.&lt;br /&gt;
The 'n' and 'nw' designations distinguish between tiles which are moved from orthogonally and diagonally in the same way as described in '''[missile_frame]''', [[AnimationWML]].&lt;br /&gt;
The 'left' and 'right' designations are used alternately throughout the path;&lt;br /&gt;
however, the standard values are the same for 'left' and 'right'.&lt;br /&gt;
&lt;br /&gt;
* '''terrain_mask_image''': (standard 'terrain/alphamask.png') used to give a hex-shape from a rectangular image.&lt;br /&gt;
* '''grid_image''': (standard 'terrain/grid.png') the image used by the grid option &lt;br /&gt;
* '''unreachable_image''': (standard 'terrain/darken.png') the stripes mask used to show unreachable locations&lt;br /&gt;
&lt;br /&gt;
* '''observer_image''': (standard 'misc/eye.png') the image to use for observer in multi-player games. (The eye in the upper right hand corner.)&lt;br /&gt;
* '''zoom_levels''': {{DevFeature1.13|8}} A comma-separated list of valid zoom levels, with 1.0 representing 100%.&lt;br /&gt;
&lt;br /&gt;
== Color Palettes ==&lt;br /&gt;
&lt;br /&gt;
Color palettes are defined by two tags within '''[game_config]'''. These tags also work in a couple of other places (https://github.com/wesnoth/wesnoth/issues/8555) like the top level.&lt;br /&gt;
&lt;br /&gt;
* '''[color_palette]''': Contains the definitions of source palettes, such as magenta. Each key defines a palette, and must be set to a comma-separated list of hexadecimal colors.&lt;br /&gt;
* '''[color_range]''': Defines a target color palette.&lt;br /&gt;
** '''id''': Used to reference the palette, for example from '''[side]''' or ~RC().&lt;br /&gt;
** '''name''': A translatable name for the color. &amp;lt;s&amp;gt;This may be ignored for non-core colors?&amp;lt;/s&amp;gt;&lt;br /&gt;
** '''rgb''': A comma-separated sequence of four hexadecimal colors:&lt;br /&gt;
**# the average shade of a unit's team-color portions&lt;br /&gt;
**# the maximum highlight shade of a unit's team-color portions&lt;br /&gt;
**# the minimum shadow shade of a unit's team-color portions&lt;br /&gt;
**# the color of the markers on the mini-map.&lt;br /&gt;
** '''default''': (only under '''[game_config]''') if yes this color is added to the colors that get assigned to sides by default in the order they appear (side 1 gets the first color with default=yes (red) etc)&lt;br /&gt;
&lt;br /&gt;
== See Also ==&lt;br /&gt;
&lt;br /&gt;
* [[ReferenceWML]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category: WML Reference]]&lt;/div&gt;</summary>
		<author><name>Soliton</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.wesnoth.org/index.php?title=Template:WML_Tags&amp;diff=74414</id>
		<title>Template:WML Tags</title>
		<link rel="alternate" type="text/html" href="https://wiki.wesnoth.org/index.php?title=Template:WML_Tags&amp;diff=74414"/>
		<updated>2025-06-27T12:20:34Z</updated>

		<summary type="html">&lt;p&gt;Soliton: remove duplicate&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{| class=&amp;quot;reference-sidebar&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
&amp;lt;span class=&amp;quot;editlink&amp;quot;&amp;gt;&amp;amp;#91;[{{SERVER}}{{localurl:Template:WML Tags|action=edit}} edit]&amp;amp;#93;&amp;lt;/span&amp;gt;'''[[ReferenceWML|WML Tags]]'''&lt;br /&gt;
|-&lt;br /&gt;
|''A:'' &lt;br /&gt;
[[AbilitiesWML#The .5Babilities.5D tag|abilities]],&lt;br /&gt;
[[CreditsWML#.5Babout.5D|about]],&lt;br /&gt;
[[AchievementsWML#.5Bachievement.5D|achievement]],&lt;br /&gt;
[[AchievementsWML#.5Bachievement_group.5D|achievement_group]],&lt;br /&gt;
[[Lua_AI_Legacy_Methods_Howto#Behavior_.28Sticky.29_Candidate_Actions|add_ai_behavior]],&lt;br /&gt;
[[AdvancedPreferenceWML|advanced_preference]],&lt;br /&gt;
[[UnitTypeWML#advancefrom|advancefrom]],&lt;br /&gt;
[[UnitTypeWML#After_max_level_advancement_.28AMLA.29|advancement]],&lt;br /&gt;
[[StatisticalScenarioWML#The_.5Bteam.5D_tag|advances]],&lt;br /&gt;
[[AbilitiesWML#affect_adjacent|affect_adjacent]],&lt;br /&gt;
[[Wesnoth_AI_Framework#The_.5Bai.5D_Tag_.E2.80.94_Top-level_Elements|ai]],&lt;br /&gt;
[[StandardSideFilter#allied_with|allied_with]], &lt;br /&gt;
[[DirectActionsWML#.5Ballow_end_turn.5D|allow_end_turn]],&lt;br /&gt;
[[DirectActionsWML#.5Ballow_extra_recruit.5D|allow_extra_recruit]],&lt;br /&gt;
[[DirectActionsWML#.5Ballow_recruit.5D|allow_recruit]],&lt;br /&gt;
[[DirectActionsWML#.5Ballow_undo.5D|allow_undo]],&lt;br /&gt;
[[ConditionalActionsWML#Meta-Condition_Tags|and]],&lt;br /&gt;
[[InterfaceActionsWML#.5Banimate_unit.5D|animate_unit]],&lt;br /&gt;
[[AnimationWML#The .5Banimation.5D tag|animation]],&lt;br /&gt;
[[Wesnoth_AI_Framework#The_.5Bai.5D_Tag_.E2.80.94_Aspects|aspect]],&lt;br /&gt;
attack ([[ReplayWML#attack|replay]], [[UnitTypeWML#Attacks|weapon]]),&lt;br /&gt;
[[AnimationWML#short-attack|attack_anim]],&lt;br /&gt;
attacks ([[AbilitiesWML#The_.5Bspecials.5D_tag|special]], [[StatisticalScenarioWML#The_.5Bteam.5D_tag|stats]]),&lt;br /&gt;
[[AiWML#avoid|avoid]];&lt;br /&gt;
|-&lt;br /&gt;
|''B:'' &lt;br /&gt;
[[UnitTypeWML#base_unit|base_unit]], &lt;br /&gt;
[[IntroWML#.5Bbackground_layer.5D|background_layer]],&lt;br /&gt;
[[AbilitiesWML#The_.5Bspecials.5D_tag|berserk]], &lt;br /&gt;
[[BinaryPathWML|binary_path]],&lt;br /&gt;
[[InternalActionsWML#Flow_control_actions|break]],&lt;br /&gt;
[[EditorWML#The_.5Bbrush.5D_tag|brush]];&lt;br /&gt;
|-&lt;br /&gt;
|''C:'' &lt;br /&gt;
[[CampaignWML#The_.5Bcampaign.5D_tag|campaign]],&lt;br /&gt;
[[DirectActionsWML#.5Bcancel_action.5D|cancel_action]],&lt;br /&gt;
[[Wesnoth_AI_Framework#The_.5Bcandidate_action.5D_Tag|candidate_action]], &lt;br /&gt;
[[DirectActionsWML#.5Bcapture_village.5D|capture_village]],&lt;br /&gt;
[[ConditionalActionsWML#.5Bswitch.5D|case]],&lt;br /&gt;
[[AbilitiesWML#The_.5Bspecials.5D_tag|chance_to_hit]], &lt;br /&gt;
[[InterfaceActionsWML#.5Bchange_theme.5D|change_theme]], &lt;br /&gt;
[[InterfaceActionsWML#.5Bchat.5D|chat]],&lt;br /&gt;
[[OptionWML#checkbox|checkbox]],&lt;br /&gt;
[[OptionWML#choice|choice]],&lt;br /&gt;
[[ReplayWML#choose|choose]],&lt;br /&gt;
[[PersistenceWML#WML Syntax|clear_global_variable]],&lt;br /&gt;
[[InterfaceActionsWML#.5Bclear_menu_item.5D|clear_menu_item]],&lt;br /&gt;
[[InternalActionsWML#.5Bclear_variable.5D|clear_variable]],&lt;br /&gt;
[[InterfaceActionsWML#.5Bcolor_adjust.5D|color_adjust]],&lt;br /&gt;
[[GameConfigWML#Color_Palettes|color_palette]],&lt;br /&gt;
[[GameConfigWML#Color_Palettes|color_range]],&lt;br /&gt;
command&amp;amp;nbsp;([[ConditionalActionsWML#.5Bcommand.5D|action]], [[ReplayWML|replay]]),&lt;br /&gt;
[[InternalActionsWML#Flow_control_actions|continue]],&lt;br /&gt;
[[CoreWML|core]],&lt;br /&gt;
[[CreditsWML#.5Bcredits_group.5D|credits_group]],&lt;br /&gt;
[[AiWML#The_.5Bgoal.5D_Tag|criteria]];&lt;br /&gt;
|-&lt;br /&gt;
|''D:'' &lt;br /&gt;
[[AbilitiesWML#The_.5Bspecials.5D_tag|damage]],&lt;br /&gt;
[[AbilitiesWML#The_.5Bspecials.5D_tag|damage_type]], &lt;br /&gt;
[[AnimationWML#short-death|death]], &lt;br /&gt;
[[StatisticalScenarioWML#The_.5Bteam.5D_tag|deaths]],&lt;br /&gt;
[[Wesnoth_AI_Framework#The_.5Bai.5D_Tag_.E2.80.94_Aspects|default]], &lt;br /&gt;
[[AnimationWML#short-defend|defend]],&lt;br /&gt;
[[StatisticalScenarioWML#The_.5Bteam.5D_tag|defends]],&lt;br /&gt;
[[UnitsWML#defense|defense]],&lt;br /&gt;
[[InterfaceActionsWML#.5Bdelay.5D|delay]],&lt;br /&gt;
[[InterfaceActionsWML#.5Bdeprecated_message.5D|deprecated_message]],&lt;br /&gt;
[[ReplayWML#attack|destination]],&lt;br /&gt;
[[CampaignWML#difficulty|difficulty]],&lt;br /&gt;
[[AbilitiesWML#The_.5Bspecials.5D_tag|disable]],&lt;br /&gt;
[[DirectActionsWML#.5Bdisallow_end_turn.5D|disallow_end_turn]],&lt;br /&gt;
[[DirectActionsWML#.5Bdisallow_extra_recruit.5D|disallow_extra_recruit]],&lt;br /&gt;
[[DirectActionsWML#.5Bdisallow_recruit.5D|disallow_recruit]],&lt;br /&gt;
[[ConditionalActionsWML#.5Bwhile.5D|do]], &lt;br /&gt;
[[DirectActionsWML#.5Bdo_command.5D|do_command]],&lt;br /&gt;
[[AbilitiesWML#The_.5Bspecials.5D_tag|drains]], &lt;br /&gt;
[[AnimationWML#short-draw_weapon|draw_weapon_anim]];&lt;br /&gt;
|-&lt;br /&gt;
|''E:'' &lt;br /&gt;
[[EditorWML#The_.5Beditor_group.5D_tag|editor_group]],&lt;br /&gt;
[[EditorWML#The_.5Beditor_music.5D_tag|editor_music]],&lt;br /&gt;
[[EditorWML#The_.5Beditor_times.5D_tag|editor_times]],&lt;br /&gt;
[[EffectWML|effect]],&lt;br /&gt;
else&amp;amp;nbsp;([[ConditionalActionsWML#.5Bif.5D|action]], [[AnimationWML#Conditional Branches|animation]]), [[ConditionalActionsWML#.5Bif.5D|elseif]],&lt;br /&gt;
[[DirectActionsWML#.5Bendlevel.5D|endlevel]],&lt;br /&gt;
end_turn&amp;amp;nbsp;([[DirectActionsWML#.5Bend_turn.5D|action]], [[ReplayWML#end_turn|replay]]),&lt;br /&gt;
[[StandardSideFilter#enemy_of|enemy_of]], &lt;br /&gt;
[[Wesnoth_AI_Framework#The_.5Bai.5D_Tag_.E2.80.94_Engines|engine]], &lt;br /&gt;
entry&amp;amp;nbsp;([[CreditsWML#.5Bentry.5D|credits]], [[OptionWML#entry|options]]),&lt;br /&gt;
[[EraWML|era]],&lt;br /&gt;
[[EventWML|event]],&lt;br /&gt;
[[StandardUnitFilter#filter_ability|experimental_filter_ability]],&lt;br /&gt;
[[StandardUnitFilter#filter_ability_active|experimental_filter_ability_active]],&lt;br /&gt;
[[AbilitiesWML#filter_specials|experimental_filter_specials]],&lt;br /&gt;
[[AnimationWML#short-extra|extra_anim]];&lt;br /&gt;
|-&lt;br /&gt;
|''F:''&lt;br /&gt;
[[Wesnoth_AI_Framework#The_.5Bai.5D_Tag_.E2.80.94_Aspects|facet]],&lt;br /&gt;
[[InterfaceActionsWML#.5Banimate_unit.5D|facing]], &lt;br /&gt;
[[InterfaceActionsWML#.5Bmove_units_fake.5D|fake_unit]], &lt;br /&gt;
[[ConditionalActionsWML#.5Bfalse.5D|false]],&lt;br /&gt;
[[PblWML#.5Bfeedback.5D|feedback]],&lt;br /&gt;
[[UnitTypeWML#variation|female]], &lt;br /&gt;
filter ([[FilterWML|concept]], [[EventWML#.5Bfilter.5D|event]]),&lt;br /&gt;
[[StandardUnitFilter#filter_adjacent|filter_adjacent]], &lt;br /&gt;
[[StandardLocationFilter#filter_adjacent_location|filter_adjacent_location]], &lt;br /&gt;
[[FilterWML#Filtering_Weapons|filter_attack]],&lt;br /&gt;
[[AbilitiesWML#filter_attacker|filter_attacker]], &lt;br /&gt;
[[AbilitiesWML#filter_base_value|filter_base_value]], &lt;br /&gt;
[[EventWML#.5Bfilter_condition.5D|filter_condition]],&lt;br /&gt;
[[AbilitiesWML#filter_defender|filter_defender]], &lt;br /&gt;
[[AiWML#Filtering_Combat_with_the_attacks_Aspect|filter_enemy]],&lt;br /&gt;
[[StandardLocationFilter|filter_location]],&lt;br /&gt;
[[AbilitiesWML#filter_opponent|filter_opponent]], &lt;br /&gt;
[[AiWML#Filtering_Combat_with_the_attacks_Aspect|filter_own]],&lt;br /&gt;
[[StandardLocationFilter#filter_owner|filter_owner]], &lt;br /&gt;
[[StandardLocationFilter#filter_radius|filter_radius]], &lt;br /&gt;
[[SingleUnitWML#filter_recall|filter_recall]], &lt;br /&gt;
[[StandardUnitFilter|filter_second]],&lt;br /&gt;
[[FilterWML#Filtering_Weapons|filter_second_attack]],&lt;br /&gt;
[[AbilitiesWML#filter_self|filter_self]], &lt;br /&gt;
[[StandardSideFilter|filter_side]],&lt;br /&gt;
[[AbilitiesWML#filter_student|filter_student]], &lt;br /&gt;
[[FilterWML#Filtering_Vision|filter_vision]],&lt;br /&gt;
[[FilterWML#Filtering_Weapons|filter_weapon]], &lt;br /&gt;
[[FilterWML#Filtering_on_WML_data|filter_wml]],&lt;br /&gt;
[[InternalActionsWML#.5Bfind_path.5D|find_path]],&lt;br /&gt;
[[InternalActionsWML#.5Bfire_event.5D|fire_event]],&lt;br /&gt;
[[AbilitiesWML#The_.5Bspecials.5D_tag|firststrike]], &lt;br /&gt;
[[InterfaceActionsWML#.5Bfloating_text.5D|floating_text]],&lt;br /&gt;
[[FontsWML|fonts]],&lt;br /&gt;
[[ConditionalActionsWML#.5Bfor.5D|for]],&lt;br /&gt;
[[ConditionalActionsWML#.5Bforeach.5D|foreach]],&lt;br /&gt;
[[ConditionalActionsWML#.5Bfound_item.5D|found_item]],&lt;br /&gt;
[[AnimationWML#The .5Bframe.5D tag|frame]];&lt;br /&gt;
|-&lt;br /&gt;
|''G:'' &lt;br /&gt;
[[GameConfigWML|game_config]],&lt;br /&gt;
[[PersistenceWML#WML Syntax|get_global_variable]],&lt;br /&gt;
[[AiWML#The_.5Bgoal.5D_Tag|goal]],&lt;br /&gt;
[[DirectActionsWML#.5Bgold.5D|gold]],&lt;br /&gt;
[[InterfaceActionsWML#objectives-gold_carryover|gold_carryover]];&lt;br /&gt;
|-&lt;br /&gt;
|''H:'' &lt;br /&gt;
[[DirectActionsWML#.5Bharm_unit.5D|harm_unit]],&lt;br /&gt;
[[StandardSideFilter#has_ally|has_ally]], &lt;br /&gt;
[[StandardUnitFilter#has_attack|has_attack]],&lt;br /&gt;
[[StandardSideFilter#has_unit|has_unit]], &lt;br /&gt;
[[ConditionalActionsWML#.5Bhas_achievement.5D|has_achievement]],&lt;br /&gt;
[[ConditionalActionsWML#.5Bhave_location.5D|have_location]],&lt;br /&gt;
[[ConditionalActionsWML#.5Bhave_side.5D|have_side]],&lt;br /&gt;
[[ConditionalActionsWML#.5Bhave_unit.5D|have_unit]],&lt;br /&gt;
[[AbilitiesWML#The_.5Bspecials.5D_tag|heal_on_hit]], &lt;br /&gt;
[[DirectActionsWML#.5Bheal_unit.5D|heal_unit]],&lt;br /&gt;
[[AnimationWML#short-healed|healed_anim]], &lt;br /&gt;
[[AnimationWML#short-healing|healing_anim]], &lt;br /&gt;
[[AbilitiesWML#The_.5Babilities.5D_tag|heals]], &lt;br /&gt;
[[UnitsWML#.5Bhide_help.5D|hide_help]],&lt;br /&gt;
[[InterfaceActionsWML#.5Bhide_unit.5D|hide_unit]],&lt;br /&gt;
[[AbilitiesWML#The_.5Babilities.5D_tag|hides]];&lt;br /&gt;
|-&lt;br /&gt;
|''I:'' &lt;br /&gt;
[[AnimationWML#short-idle|idle_anim]], &lt;br /&gt;
if&amp;amp;nbsp;([[ConditionalActionsWML#.5Bif.5D|action]], [[AnimationWML#Conditional Branches|animation]], [[IntroWML|intro]]),&lt;br /&gt;
[[AbilitiesWML#The_.5Babilities.5D_tag|illuminates]], &lt;br /&gt;
image&amp;amp;nbsp;([[IntroWML#.5Bimage.5D|intro]], [[TerrainGraphicsWML#The_.5Bimage.5D_subtag|terrain]]),&lt;br /&gt;
[[ReplayWML#init_side|init_side]],&lt;br /&gt;
[[VariablesWML#.5Binsert_tag.5D|insert_tag]],&lt;br /&gt;
[[InterfaceActionsWML#.5Binspect.5D|inspect]],&lt;br /&gt;
[[InterfaceActionsWML#.5Bitem.5D|item]],&lt;br /&gt;
[[EditorWML#The_.5Bitem_group.5D_tag|item_group]];&lt;br /&gt;
|-&lt;br /&gt;
|''J:''&lt;br /&gt;
[[UnitsWML#jamming_costs|jamming_costs]],&lt;br /&gt;
[[InternalActionsWML#join|join]];&lt;br /&gt;
|-&lt;br /&gt;
|''K:'' &lt;br /&gt;
[[DirectActionsWML#.5Bkill.5D|kill]],&lt;br /&gt;
[[StatisticalScenarioWML#The_.5Bteam.5D_tag|killed]];&lt;br /&gt;
|-&lt;br /&gt;
|''L:'' &lt;br /&gt;
[[InterfaceActionsWML#.5Blabel.5D|label]],&lt;br /&gt;
[[LanguageWML|language]],&lt;br /&gt;
[[SideWML#leader|leader]],&lt;br /&gt;
[[AiWML#leader_goal|leader_goal]],&lt;br /&gt;
[[AbilitiesWML#The_.5Babilities.5D_tag|leadership]], &lt;br /&gt;
[[AnimationWML#short-leading|leading_anim]], &lt;br /&gt;
[[AnimationWML#short-levelin|levelin_anim]],&lt;br /&gt;
[[AnimationWML#short-levelout|levelout_anim]], &lt;br /&gt;
[[DirectActionsWML#.5Blift_fog.5D|lift_fog]],&lt;br /&gt;
[[AI_Recruitment#instructions-limit|limit]],&lt;br /&gt;
[[InternalActionsWML#set_variables-literal|literal]],&lt;br /&gt;
[[AddonsWML#load_resource|load_resource]],&lt;br /&gt;
[[LocaleWML|locale]],&lt;br /&gt;
[[InterfaceActionsWML#.5Block_view.5D|lock_view]],&lt;br /&gt;
[[LuaWML|lua]];&lt;br /&gt;
|-&lt;br /&gt;
|''M:'' &lt;br /&gt;
[[UnitTypeWML#variation|male]],&lt;br /&gt;
[[ReplayWML#map_data|map_data]], &lt;br /&gt;
[[SavefileWML|menu_item]], &lt;br /&gt;
[[InterfaceActionsWML#.5Bmessage.5D|message]],&lt;br /&gt;
[[Micro AIs|micro_ai]],&lt;br /&gt;
[[AnimationWML#The .5Bframe.5D tag|missile_frame]],&lt;br /&gt;
[[ModificationWML|modification]],&lt;br /&gt;
[[SingleUnitWML#modifications|modifications]],&lt;br /&gt;
[[DirectActionsWML#.5Bmodify_ai.5D|modify_ai]],&lt;br /&gt;
[[DirectActionsWML#.5Bmodify_side.5D|modify_side]],&lt;br /&gt;
[[DirectActionsWML#.5Bmodify_turns.5D|modify_turns]],&lt;br /&gt;
[[DirectActionsWML#.5Bmodify_unit.5D|modify_unit]],&lt;br /&gt;
[[AddonsWML#modify_unit_type|modify_unit_type]],&lt;br /&gt;
[[ReplayWML#move|move]],&lt;br /&gt;
[[DirectActionsWML#.5Bmove_unit.5D|move_unit]],&lt;br /&gt;
[[InterfaceActionsWML#.5Bmove_unit_fake.5D|move_unit_fake]],&lt;br /&gt;
[[InterfaceActionsWML#.5Bmove_units_fake.5D|move_units_fake]],&lt;br /&gt;
[[AnimationWML#short-movement|movement_anim]], &lt;br /&gt;
[[UnitsWML#movement_costs|movement costs]],&lt;br /&gt;
[[UnitsWML#.5Bmovetype.5D|movetype]],&lt;br /&gt;
[[ScenarioWML#The_.5Bmultiplayer.5D_tag|multiplayer]],&lt;br /&gt;
[[EraWML#Defining_Factions|multiplayer_side]],&lt;br /&gt;
[[MusicListWML#.5Bmusic.5D|music]];&lt;br /&gt;
|-&lt;br /&gt;
|''N:'' &lt;br /&gt;
[[ConditionalActionsWML#Meta-Condition_Tags|not]], &lt;br /&gt;
[[InterfaceActionsWML#objectives-note|note]];&lt;br /&gt;
|-&lt;br /&gt;
|''O:'' &lt;br /&gt;
[[DirectActionsWML#.5Bobject.5D|object]],&lt;br /&gt;
[[InterfaceActionsWML#objectives-objective|objective]],&lt;br /&gt;
[[InterfaceActionsWML#.5Bobjectives.5D|objectives]],&lt;br /&gt;
[[DirectActionsWML#.5Bon_undo.5D|on_undo]],&lt;br /&gt;
[[InterfaceActionsWML#.5Bopen_help.5D|open_help]],&lt;br /&gt;
[[InterfaceActionsWML#.5Bmessage.5D|option]],&lt;br /&gt;
[[OptionWML|options]],&lt;br /&gt;
[[ConditionalActionsWML#Meta-Condition_Tags|or]];&lt;br /&gt;
|-&lt;br /&gt;
|''P:'' &lt;br /&gt;
[[IntroWML#.5Bpart.5D|part]], &lt;br /&gt;
[[AbilitiesWML#The_.5Bspecials.5D_tag|petrifies]], &lt;br /&gt;
[[DirectActionsWML#.5Bpetrify.5D|petrify]], &lt;br /&gt;
[[DirectActionsWML#.5Bplace_shroud.5D|place_shroud]], &lt;br /&gt;
[[AbilitiesWML#The_.5Bspecials.5D_tag|plague]], &lt;br /&gt;
[[AbilitiesWML#The_.5Bspecials.5D_tag|poison]], &lt;br /&gt;
[[AnimationWML#short-post_movement|post_movement_anim]], &lt;br /&gt;
[[AnimationWML#short-pre_movement|pre_movement_anim]], &lt;br /&gt;
[[InternalActionsWML#.5Bfire_event.5D|primary_attack]], &lt;br /&gt;
[[InternalActionsWML#.5Bfire_event.5D|primary_unit]], &lt;br /&gt;
[[InterfaceActionsWML#.5Bprint.5D|print]], &lt;br /&gt;
[[DirectActionsWML#.5Bprogress_achievement.5D|progress_achievement]], &lt;br /&gt;
[[DirectActionsWML#.5Bput_to_recall_list.5D|put_to_recall_list]];&lt;br /&gt;
|-&lt;br /&gt;
|''R:'' &lt;br /&gt;
[[UnitsWML#.5Brace.5D|race]], &lt;br /&gt;
[[InternalActionsWML#.5Brandom_placement.5D|random_placement]], &lt;br /&gt;
recall&amp;amp;nbsp;([[DirectActionsWML#.5Brecall.5D|action]], [[ReplayWML#recall|replay]]), &lt;br /&gt;
[[StatisticalScenarioWML#The_.5Bteam.5D_tag|recalls]],&lt;br /&gt;
[[ReplayWML#recruit|recruit]], &lt;br /&gt;
[[AnimationWML#short-recruit|recruit_anim]], &lt;br /&gt;
[[AnimationWML#short-recruiting|recruiting_anim]], &lt;br /&gt;
[[StatisticalScenarioWML#The_.5Bteam.5D_tag|recruits]], &lt;br /&gt;
[[InterfaceActionsWML#.5Bredraw.5D|redraw]],&lt;br /&gt;
[[AbilitiesWML#The_.5Babilities.5D_tag|regenerate]],&lt;br /&gt;
[[InternalActionsWML#.5Bremove_event.5D|remove_event]],&lt;br /&gt;
[[InterfaceActionsWML#.5Bremove_item.5D|remove_item]], &lt;br /&gt;
[[DirectActionsWML#.5Bremove_object.5D|remove_object]], &lt;br /&gt;
[[DirectActionsWML#.5Bremove_shroud.5D|remove_shroud]], &lt;br /&gt;
[[InterfaceActionsWML#.5Bremove_sound_source.5D|remove_sound_source]], &lt;br /&gt;
[[DirectActionsWML#.5Bremove_time_area.5D|remove_time_area]], &lt;br /&gt;
[[DirectActionsWML#.5Bremove_trait.5D|remove_trait]],&lt;br /&gt;
[[InterfaceActionsWML#.5Bremove_unit_overlay.5D|remove_unit_overlay]],&lt;br /&gt;
[[ConditionalActionsWML#.5Brepeat.5D|repeat]],&lt;br /&gt;
[[DirectActionsWML#.5Breplace_map.5D|replace_map]], &lt;br /&gt;
[[DirectActionsWML#.5Breplace_schedule.5D|replace_schedule]], &lt;br /&gt;
[[ReplayWML|replay]], &lt;br /&gt;
[[SavefileWML|replay_start]],&lt;br /&gt;
[[DirectActionsWML#.5Breset_fog.5D|reset_fog]], &lt;br /&gt;
resistance&amp;amp;nbsp;([[AbilitiesWML#The_.5Babilities.5D_tag|ability]], [[UnitsWML#resistance|unit]]),&lt;br /&gt;
[[UnitsWML#.5Bresistance_defaults.5D|resistance_defaults]],&lt;br /&gt;
[[ThemeWML#The_toplevel_.5Btheme.5D_tag|resolution]],&lt;br /&gt;
[[ModificationWML#The_.5Bresource.5D_toplevel_tag|resource]],&lt;br /&gt;
[[InternalActionsWML#Flow_control_actions|return]],&lt;br /&gt;
[[InternalActionsWML#.5Brole.5D|role]], &lt;br /&gt;
[[TerrainMaskWML#rule|rule]];&lt;br /&gt;
|-&lt;br /&gt;
|''S:'' &lt;br /&gt;
[[SavefileWML|save]], &lt;br /&gt;
[[ScenarioWML#The_.5Bscenario.5D_tag|scenario]],&lt;br /&gt;
[[InterfaceActionsWML#.5Bscreen_fade.5D|screen_fade]], &lt;br /&gt;
[[InterfaceActionsWML#.5Bscroll.5D|scroll]], &lt;br /&gt;
[[InterfaceActionsWML#.5Bscroll_to.5D|scroll_to]],&lt;br /&gt;
[[InterfaceActionsWML#.5Bscroll_to_unit.5D|scroll_to_unit]], &lt;br /&gt;
[[InternalActionsWML#.5Bfire_event.5D|secondary_attack]], &lt;br /&gt;
[[InternalActionsWML#.5Bfire_event.5D|secondary_unit]], &lt;br /&gt;
[[HelpWML#section|section]], &lt;br /&gt;
[[InterfaceActionsWML#.5Bselect_unit.5D|select_unit]], &lt;br /&gt;
[[ReplayWML#sequence|sequence]], &lt;br /&gt;
[[DirectActionsWML#.5Bset_achievement.5D|set_achievement]],&lt;br /&gt;
[[DirectActionsWML#.5Bset_extra_recruit.5D|set_extra_recruit]],&lt;br /&gt;
[[PersistenceWML#WML_Syntax|set_global_variable]],&lt;br /&gt;
[[InterfaceActionsWML#.5Bset_menu_item.5D|set_menu_item]], &lt;br /&gt;
[[DirectActionsWML#.5Bset_recruit.5D|set_recruit]],&lt;br /&gt;
[[EffectWML#set_specials|set_specials]], &lt;br /&gt;
[[InternalActionsWML#.5Bset_variable.5D|set_variable]], &lt;br /&gt;
[[InternalActionsWML#.5Bset_variables.5D|set_variables]], &lt;br /&gt;
[[AnimationWML#short-sheath_weapon|sheath_weapon_anim]], &lt;br /&gt;
show_if&amp;amp;nbsp;([[InterfaceActionsWML#.5Bmessage.5D|message]], &lt;br /&gt;
[[InterfaceActionsWML#.5Bobjectives.5D|objective]], &lt;br /&gt;
[[InterfaceActionsWML#.5Bset_menu_item.5D|set_menu_item]]),&lt;br /&gt;
[[InterfaceActionsWML#.5Bshow_objectives.5D|show_objectives]],&lt;br /&gt;
[[SideWML|side]], &lt;br /&gt;
[[AbilitiesWML#The_.5Babilities.5D_tag|skirmisher]], &lt;br /&gt;
[[OptionWML#slider|slider]],&lt;br /&gt;
[[AbilitiesWML#The_.5Bspecials.5D_tag|slow]], &lt;br /&gt;
[[SavefileWML|snapshot]],&lt;br /&gt;
[[InterfaceActionsWML#.5Bsound.5D|sound]], &lt;br /&gt;
[[InterfaceActionsWML#.5Bsound_source.5D|sound_source]], &lt;br /&gt;
source&amp;amp;nbsp;([[ReplayWML#attack|replay]], [[DirectActionsWML#.5Btunnel.5D|teleport]]),&lt;br /&gt;
[[UnitTypeWML#Special Notes|special_note]],&lt;br /&gt;
[[AbilitiesWML#The_.5Bspecials.5D_tag|specials]], &lt;br /&gt;
[[InternalActionsWML#set_variables-split|split]],&lt;br /&gt;
[[Wesnoth_AI_Framework#The_.5Bai.5D_Tag_.E2.80.94_Stages|stage]], &lt;br /&gt;
[[AnimationWML#short-standing|standing_anim]], &lt;br /&gt;
[[StatisticalScenarioWML#The_.5Bstatistics.5D_tag|statistics]],&lt;br /&gt;
[[SingleUnitWML#status|status]], &lt;br /&gt;
[[InternalActionsWML#.5Bstore_gold.5D|store_gold]], &lt;br /&gt;
[[InternalActionsWML#.5Bstore_items.5D|store_items]], &lt;br /&gt;
[[InternalActionsWML#.5Bstore_locations.5D|store_locations]],&lt;br /&gt;
[[InternalActionsWML#.5Bstore_map_dimensions.5D|store_map_dimensions]],&lt;br /&gt;
[[InternalActionsWML#.5Bstore_reachable_locations.5D|store_reachable_locations]],&lt;br /&gt;
[[InternalActionsWML#.5Bstore_relative_direction.5D|store_relative_direction]],&lt;br /&gt;
[[InternalActionsWML#.5Bstore_side.5D|store_side]], &lt;br /&gt;
[[InternalActionsWML#.5Bstore_starting_location.5D|store_starting_location]], &lt;br /&gt;
[[InternalActionsWML#.5Bstore_time_of_day.5D|store_time_of_day]], &lt;br /&gt;
[[InternalActionsWML#.5Bstore_turns.5D|store_turns]], &lt;br /&gt;
[[InternalActionsWML#.5Bstore_unit.5D|store_unit]], &lt;br /&gt;
[[InternalActionsWML#.5Bstore_unit_defense.5D|store_unit_defense]], &lt;br /&gt;
[[InternalActionsWML#.5Bstore_unit_defense_on.5D|store_unit_defense_on]], &lt;br /&gt;
[[InternalActionsWML#.5Bstore_unit_type.5D|store_unit_type]], &lt;br /&gt;
[[InternalActionsWML#.5Bstore_unit_type_ids.5D|store_unit_type_ids]], &lt;br /&gt;
[[InternalActionsWML#.5Bstore_villages.5D|store_villages]], &lt;br /&gt;
[[IntroWML|story]], &lt;br /&gt;
[[AbilitiesWML#The_.5Bspecials.5D_tag|swarm]], &lt;br /&gt;
[[AchievementsWML#.5Bsub_achievement.5D|sub_achievement]],&lt;br /&gt;
[[ConditionalActionsWML#.5Bswitch.5D|switch]],&lt;br /&gt;
[[InternalActionsWML#.5Bsync_variable.5D|sync_variable]];&lt;br /&gt;
|-&lt;br /&gt;
|''T:'' &lt;br /&gt;
[[DirectActionsWML#.5Btunnel.5D|target]], &lt;br /&gt;
[[StatisticalScenarioWML#The_.5Bteam.5D_tag|team]],&lt;br /&gt;
teleport&amp;amp;nbsp;([[AbilitiesWML#Extra_tags_used_by_the_.5Bteleport.5D_ability|ability]], [[DirectActionsWML#.5Bteleport.5D|action]]),&lt;br /&gt;
[[AnimationWML#short-teleport|teleport_anim]],&lt;br /&gt;
[[DirectActionsWML#.5Bterrain.5D|terrain]], &lt;br /&gt;
[[UnitsWML#.5Bterrain_defaults.5D|terrain_defaults]],&lt;br /&gt;
[[TerrainGraphicsWML|terrain_graphics]], &lt;br /&gt;
[[TerrainMaskWML|terrain_mask]], &lt;br /&gt;
[[TerrainWML|terrain_type]], &lt;br /&gt;
[[ScenarioWML#The_.5Btest.5D_tag|test]],&lt;br /&gt;
[[InterfaceActionsWML#.5Btest_condition.5D|test_condition]],&lt;br /&gt;
[[TestWML#The_.5Btest_do_attack_by_id.5D_tag|test_do_attack_by_id]],&lt;br /&gt;
[[InterfaceActionsWML#message-text_input|text_input]], &lt;br /&gt;
[[GettextForWesnothDevelopers#The_textdomain_tag|textdomain]],&lt;br /&gt;
[[ThemeWML|theme]],&lt;br /&gt;
[[ConditionalActionsWML#.5Bif.5D|then]],&lt;br /&gt;
[[TerrainGraphicsWML#The_.5Btile.5D_subtag|tile]], &lt;br /&gt;
[[TimeWML|time]], &lt;br /&gt;
[[DirectActionsWML#.5Btime_area.5D|time_area]], &lt;br /&gt;
[[HelpWML#topic|topic]], &lt;br /&gt;
[[HelpWML#toplevel|toplevel]], &lt;br /&gt;
[[UnitsWML#.5Btrait.5D|trait]], &lt;br /&gt;
[[DirectActionsWML#.5Btransform_unit.5D|transform_unit]], &lt;br /&gt;
[[InternalActionsWML#.5Bfind_path.5D|traveler]], &lt;br /&gt;
[[ConditionalActionsWML#.5Btrue.5D|true]],&lt;br /&gt;
[[DirectActionsWML#.5Btunnel.5D|tunnel]];&lt;br /&gt;
|-&lt;br /&gt;
|''U:'' &lt;br /&gt;
[[InterfaceActionsWML#.5Bunhide_unit.5D|unhide_unit]], &lt;br /&gt;
unit&amp;amp;nbsp;([[DirectActionsWML#.5Bunit.5D|action]], [[SingleUnitWML|scenario]]), &lt;br /&gt;
[[InterfaceActionsWML#.5Bunit_overlay.5D|unit_overlay]], &lt;br /&gt;
[[UnitTypeWML|unit_type]], &lt;br /&gt;
[[InternalActionsWML#.5Bunit_worth.5D|unit_worth]], &lt;br /&gt;
[[UnitsWML|units]],&lt;br /&gt;
[[InterfaceActionsWML#.5Bunlock_view.5D|unlock_view]],&lt;br /&gt;
[[DirectActionsWML#.5Bunpetrify.5D|unpetrify]], &lt;br /&gt;
[[DirectActionsWML#.5Bunstore_unit.5D|unstore_unit]],&lt;br /&gt;
[[InternalActionsWML#.5Bunsynced.5D|unsynced]];&lt;br /&gt;
|-&lt;br /&gt;
| ''V:'' &lt;br /&gt;
[[InternalActionsWML#set_variables-value|value]], &lt;br /&gt;
[[ConditionalActionsWML#.5Bvariable.5D|variable]],&lt;br /&gt;
[[VariablesWML#The_.5Bvariables.5D_tag|variables]],&lt;br /&gt;
[[TerrainGraphicsWML#variant|variant]],&lt;br /&gt;
[[UnitTypeWML#variation|variation]], &lt;br /&gt;
[[AnimationWML#short-victory|victory_anim]], &lt;br /&gt;
[[SideWML#village|village]],&lt;br /&gt;
[[UnitsWML#vision_costs|vision_costs]],&lt;br /&gt;
[[InterfaceActionsWML#.5Bvolume.5D|volume]];&lt;br /&gt;
|-&lt;br /&gt;
| ''W:'' &lt;br /&gt;
[[ConditionalActionsWML#.5Bwhile.5D|while]],&lt;br /&gt;
[[InterfaceActionsWML#.5Bwml_message.5D|wml_message]],&lt;br /&gt;
[[SchemaWML|wml_schema]];&lt;br /&gt;
|-&lt;br /&gt;
| ''Z:''&lt;br /&gt;
[[InterfaceActionsWML#.5Bzoom.5D|zoom]];&lt;br /&gt;
|}&amp;lt;includeonly&amp;gt;[[Category:WML Reference]]&amp;lt;/includeonly&amp;gt;&amp;lt;noinclude&amp;gt;A box with all the WML tags, each one linking to the page and section they are described in. This box should be included in each of the [[ReferenceWML|WML reference]] pages.&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>Soliton</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.wesnoth.org/index.php?title=SideWML&amp;diff=74413</id>
		<title>SideWML</title>
		<link rel="alternate" type="text/html" href="https://wiki.wesnoth.org/index.php?title=SideWML&amp;diff=74413"/>
		<updated>2025-06-27T08:16:04Z</updated>

		<summary type="html">&lt;p&gt;Soliton: /* Common Keys */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{WML Tags}}&lt;br /&gt;
&lt;br /&gt;
The term &amp;quot;side&amp;quot; refers to a single player in the Wesnoth turn order, which can be controlled by either a human or an AI. Every [[ScenarioWML|scenario]] must have at least one side. There is no hard limit on the number of sides a single scenario can have.&lt;br /&gt;
&lt;br /&gt;
Usually the number of sides in a scenario is fixed. However, the Lua function [[LuaAPI/wesnoth/sides#wesnoth.sides.create|wesnoth.sides.create]] can be used to dynamically add new sides if required.&lt;br /&gt;
&lt;br /&gt;
Sides in a scenario are described by the '''[side]''' tag, which recognizes the following keys and tags.&lt;br /&gt;
&lt;br /&gt;
== Common Keys ==&lt;br /&gt;
&lt;br /&gt;
These keys are always permitted in a '''[side]''' tag.&lt;br /&gt;
&lt;br /&gt;
* '''side''': a number. The leader of this side is placed on the tile represented by this number (see [[BuildingMaps]]). When defining sides, they must be defined in order since the side number is checked against the number of sides seen so far. Currently, the Multiplayer server rejects entering a scenario with more than 9 sides, even if those extra sides are AI sides. {{DevFeature1.13|2}} The server doesn't limit the number of sides anymore.&lt;br /&gt;
&lt;br /&gt;
* {{anchor|controller|'''controller'''}} (required): how moves for this side should be inputted.&lt;br /&gt;
** '''ai''': the Wesnoth AI makes this side's moves.&lt;br /&gt;
** '''human''': a player controls this side's moves.&lt;br /&gt;
** '''null''': the side doesn't get a turn to move. Events that would usually occur on the side's turn will not take place. This includes healing (ability, villages and rest) and ''side turn'' events.&lt;br /&gt;
** '''a number''': gives this side's control to a side with '''side''' matching the number (multiplayer only). {{DevFeature1.13|2}} using a number is deprecated, use previous_save_id= instead.&lt;br /&gt;
** Note: in multiplayer, when reading the side's data with ''[store_side]'', the value may differ between clients and using it for conditional actions may cause OOS. Discussion in https://r.wesnoth.org/p643343&lt;br /&gt;
&lt;br /&gt;
* '''type''': if present, the keys describing a unit (including '''type''') which will begin on the side's keep will be the remainder of the '''[side]''' tag, See [[SingleUnitWML]]. Note that if the keys '''x''', '''y''' are included, the leader will begin there regardless of keep location. If this side has a recall list from a previous level, then the recall list will be searched for a leader (using ''canrecruit=yes'') and if one is found it will be used instead of the one described in the '''[side]''' tag. Typical keys used for defining the leader unit are ''id'', ''name'' and ''unrenamable=yes'', see [[SingleUnitWML]]. The unit will automatically be set to be able to recruit.&lt;br /&gt;
&lt;br /&gt;
* '''recruit''': a list of unit types. At the beginning of the scenario, the side gains recruitment of these units. Units in the side recruit list can always be recruited by a leader on this side, in addition to any units in the individual leader's '''extra_recruit''' list. {{DevFeature1.13|?}} in multiplayer, unless you specify ''faction=Custom'', this will be overwritten by the recruit list from the faction.&lt;br /&gt;
&lt;br /&gt;
* '''gold''': the starting gold for this side. Default: 100. (If gold is carried over from a previous scenario, this value is the minimum starting gold.)&lt;br /&gt;
&lt;br /&gt;
* '''income''': additional income for this side. Default: 0. This is added to '''[[GameConfigWML|[game_config]]]'''''base_income'' to determine the side's base income.&lt;br /&gt;
&lt;br /&gt;
* '''hidden''': if 'yes', side is not shown in status table.&lt;br /&gt;
&lt;br /&gt;
* '''fog''': if 'yes', this side cannot see any tiles it is not within vision of, except at the start. Please note that the AI currently ignores the fog.&lt;br /&gt;
&lt;br /&gt;
* '''fog_data''': describes the area which this team has de-fogged, using the same format as shroud_data. (This is not particularly useful when defining a side, though, as the game will recalculate fog as turns begin and end.) It is used in saved games.&lt;br /&gt;
&lt;br /&gt;
* {{anchor|fog_override|'''[fog_override]'''}}: With keys x= and y=, this records the hexes that have been cleared (multiturn) with {{tag|DirectActionsWML|lift_fog}}.&lt;br /&gt;
&lt;br /&gt;
* '''shroud''': if 'yes', this side cannot see any tiles it has not moved within sight of. Please note that the AI currently ignores the shroud. NOTE: with shroud=no, this team *ignores* shroud, so it is not possible to modify it using place_shroud and remove_shroud tags. If you want to do so, use &amp;quot;shroud=yes&amp;quot; and place_shroud/remove_shroud tags.&lt;br /&gt;
&lt;br /&gt;
* '''shroud_data''': describes the area which this team has de-shrouded. An example:&lt;br /&gt;
 |&lt;br /&gt;
 |00011111000&lt;br /&gt;
:This would leave the first column on the map unaltered and would change the second column for 11 tiles. A '0' means: shrouded, '1' means unshrouded. You can either call an external file using {@filename}  (see [[PreprocessorRef]]) or place the data in quotes. For making an external file see [[ShroudDataWML]].&lt;br /&gt;
&lt;br /&gt;
* '''persistent''': whether the side exists in any other scenarios. If 'yes', then ''save_id'' (see below) is used to identify the side in other scenarios. Defaults to 'yes' for sides with a human controller, and 'no' for ai controlled sides.&lt;br /&gt;
&lt;br /&gt;
* '''save_id''': defaults to the leader's ''id'' if available, 'Unknown' otherwise. The ID of the side with respect to the previous and next scenarios. Used to carry over the side's recall list (including the side's leader), recruitment list, and starting gold from scenario to scenario. Also used for the side's displayed name in the victory gold-calculation dialog.&lt;br /&gt;
&lt;br /&gt;
* '''previous_save_id''': {{DevFeature1.13|2}} defaults to ''save_id''. Only used in mp games, specially mp campaigns. This attribute specifies which user should play this side by default. For example if a side has previous_save_id=&amp;quot;Konrad&amp;quot; then the side will be assigned to that player who played the side with the save_id=&amp;quot;Konrad&amp;quot; in the previous level. If used in the first scenario, multiple sides with the same ''previous_save_id'' will be assigned to the same player.&lt;br /&gt;
&lt;br /&gt;
* '''team_name''': a non translatable string representing the team's description. Sides with the same team_name are allied. Default ''side''. ''team_name'' is now a comma-separated list of teams that the side is on.&lt;br /&gt;
&lt;br /&gt;
* '''user_team_name''': a translatable string representing the team's description. This has no effect on alliances. Default ''team_name''.&lt;br /&gt;
&lt;br /&gt;
* '''current_player''': a translatable string representing the player's or leader's name. Defaults to the leader's id; if the side's leader is a human player in multiplayer, the default is the player's username. {{DevFeature1.13|0}} This field is now always the player name (mp server nick) it impossible to change it with wml/lua. {{DevFeature1.13|5}} You can use ''side_name'' instead to specify the name for the side (which is then used in new turn dialogs, statisitc dialogs etc.)&lt;br /&gt;
&lt;br /&gt;
* '''side_name''': {{DevFeature1.13|5}} a translatable string representing the name of the side, used for example in the new turn dialog. Defaults to ''name'' if the side was inside a '''[scenario]''' and to the player's name if the side was inside a '''[multiplayer]'''.&lt;br /&gt;
&lt;br /&gt;
* '''color''': May be either a numeric color index or a color name (e.g. 'blue', 'purple', 'orange', etc.).  The numeric form is deprecated. The default list of numbers and corresponding colors can be found in data/core/team_colors.cfg. Can also be an inline color range (the rgb key from [[GameConfigWML#Color_Palettes]]).&lt;br /&gt;
&lt;br /&gt;
* '''flag''': a custom flag animation to use instead of the default one to mark captured villages. An automatic side-coloring is applied.&lt;br /&gt;
** Example animation that has three frames and loops every 750ms: ''flag=misc/myflag-[1~3].png:750''&lt;br /&gt;
&lt;br /&gt;
* '''flag_icon''': a custom flag icon to indicate the side playing in the statusbar (a size of 24x16 is recommended). An automatic side-coloring is applied.&lt;br /&gt;
&lt;br /&gt;
* '''village_gold''': the amount of gold given to this side per village it controls per turn. Default specified in ''village_income'', '''[game_config]''' ([[GameConfigWML]]).&lt;br /&gt;
&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. Default specified in ''village_support'', '''[game_config]''' ([[GameConfigWML]]).&lt;br /&gt;
&lt;br /&gt;
* '''recall_cost''': the amount of gold it costs to recall a unit. Default specified in ''recall_cost'', '''[game_config]''' ([[GameConfigWML]]). {{DevFeature1.15|0}} Units are now recalled for AI sides even if the recall_cost is larger than the unit's worth (essentially its cost, plus potentially a bonus for experience points). In 1.14 and earlier, units were not recalled by the AI in this case even if this was the only recall/recruit action possible to the AI.&lt;br /&gt;
&lt;br /&gt;
* '''share_maps''': whether sides allied with this side see all terrains that this side sees, if they are on shroud. {{DevFeature1.13|1}} This has been deprecated in favor of share_vision (see below).&lt;br /&gt;
&lt;br /&gt;
* '''share_view''': whether sides allied with this side see the units that this side sees, if they are on FoW (fog). {{DevFeature1.13|1}} This has been deprecated in favor of share_vision (see below).&lt;br /&gt;
&lt;br /&gt;
* '''share_vision''': {{DevFeature1.13|1}} all/shroud/none. If ''all'', both shroud and fog view will be shared by this side. If ''shroud'', only shroud view will be shared. If ''none'', the view is not shared.&lt;br /&gt;
&lt;br /&gt;
* '''scroll_to_leader''': optional. If 'no', scroll to the leader is not performed on the start of each turn. (default: yes)&lt;br /&gt;
&lt;br /&gt;
* '''suppress_end_turn_confirmation''': If &amp;quot;yes&amp;quot;, then the player will not be asked to confirm ending their turn even if they have not done anything. This is provided for some (probably few) user-made scenarios in which players often skip their turns. (default: no)&lt;br /&gt;
&lt;br /&gt;
* {{anchor|ai|'''[ai]'''}}: if '''controller=ai''', gives parameters to the AI. See [[AiWML]].&lt;br /&gt;
&lt;br /&gt;
* {{anchor|village|'''[village]'''}}: describes a village the side begins in control of.&lt;br /&gt;
** ''x'', ''y'' the location of the village. If the pair of coordinates is not a village or is duplicated in another '''[village]''' tag, behaviour is undefined. Recent game engine or wmllint should warn about these.&lt;br /&gt;
&lt;br /&gt;
* {{anchor|unit|'''[unit]'''}}: describes a unit which begins on the side. See [[SingleUnitWML]]. If the side has a recall list and the unit is not given a location, it will start on the recall list. Note that the ''side'' attribute under '''[unit]''' will be ignored, as the side will come from the ''side'' attribute of '''[side]'''.&lt;br /&gt;
&lt;br /&gt;
* {{anchor|leader|'''[leader]'''}}: describes the leader for the side, basically same as '''[unit]''' except that ''canrecruit'' will default to yes and current position to the side starting location if not specified. {{DevFeature1.17|17}} Furthermore, if left out, the '''name''' and '''save_id''' attributes in '''[side]''' will be set to the '''name''' and '''id''' attributes in the first '''[leader]''' tag.&lt;br /&gt;
&lt;br /&gt;
* {{anchor|variables|'''[variables]'''}}: {{DevFeature1.19|8}} Can be used to define side variables. When you use :inspect to see the variables, they will be listed under ''team''. This tag can also be placed in '''[unit]''' and '''[leader]''', where it will create variables as part of this unit. See [[VariablesWML#The_.5Bvariables.5D_tag|here]] for more info.&lt;br /&gt;
&lt;br /&gt;
* {{anchor|defeat_condition|'''defeat_condition'''}}: Specifies when a side is considered ''defeated'' this is checked ''for all sides'', after every player action and at the beginning of every turn.&lt;br /&gt;
** '''no_leader_left''': (default) The side is considered defeated if it has no units with canrecruit=yes&lt;br /&gt;
** '''no_units_left''': The side is defeated as soon as it has no units left.&lt;br /&gt;
** '''never''': The side is never considered defeated.&lt;br /&gt;
** '''always''': The side is always considered defeated.&lt;br /&gt;
&lt;br /&gt;
:  For the meaning and significance of ''defeated'', see [[ScenarioWML#Scenario_End_Conditions]]&lt;br /&gt;
&lt;br /&gt;
== Multiplayer Keys ==&lt;br /&gt;
&lt;br /&gt;
These keys are only permitted in a '''[side]''' tag for a '''[multiplayer]''' scenario.&lt;br /&gt;
&lt;br /&gt;
* '''allow_player''': if false then this side will not be allowed to be modified and will be hidden during game creation. False also prevents this side from being included in shuffle sides. Defaults to yes.&lt;br /&gt;
&lt;br /&gt;
* '''disallow_observers''': prevents observers from seeing this side turn. (default: no)&lt;br /&gt;
&lt;br /&gt;
* '''disallow_shuffle''': {{DevFeature1.13|0}} do not shuffle this side if the &amp;quot;shuffle sides&amp;quot; option is used. (Usually all playable sides are shuffled.) (default: no)&lt;br /&gt;
&lt;br /&gt;
* '''chose_random''': {{DevFeature1.13|0}} indicates if a side chose a random faction during creation &lt;br /&gt;
&lt;br /&gt;
* '''controller_lock''': if true then this side's controller (&amp;quot;Player/Type&amp;quot;) modification is limited. It is bound to the '''controller''' attribute in [[SideWML]].&lt;br /&gt;
&lt;br /&gt;
* '''team_lock''': if true then this side's team is not allowed to be modified.&lt;br /&gt;
&lt;br /&gt;
* '''color_lock''': if true then this side's color is not allowed to be modified.&lt;br /&gt;
&lt;br /&gt;
* '''gold_lock''': if true then this side's gold is not allowed to be modified. &lt;br /&gt;
&lt;br /&gt;
* '''income_lock''': if true then this side's income is not allowed to be modified.&lt;br /&gt;
&lt;br /&gt;
* '''faction_lock''': if true then this side's faction is not allowed to be modified.&lt;br /&gt;
&lt;br /&gt;
* '''no_leader''': if 'yes', prevents the engine from generating a leader from the multiplayer faction, basically an alias of '''leader_lock'''&lt;br /&gt;
&lt;br /&gt;
* '''leader_lock''': if true then this side's leader (type or gender) is not allowed to be modified. Note that if ''type='' key is missing, ''leader_lock=yes'' means the side will have no leader.&lt;br /&gt;
&lt;br /&gt;
* '''faction''': if a valid faction id is provided then this side's faction will default to it in the game setup screen. {{DevFeature1.13|?}} if this key isn't included in the ''[side]'' then a random faction will be chosen, and the side's recruit list set from the faction. To use a custom ''recruit'' list, you must also specify ''faction=Custom''.&lt;br /&gt;
&lt;br /&gt;
* '''faction_from_recruit''': if true then this side will be locked to the faction that matches the recruits better.&lt;br /&gt;
&lt;br /&gt;
N.B. the ''lock'' attributes use [[ScenarioWML]] '''force_lock_settings''' as their default value. I.e. if no value to ''lock'' was set, it will take '''force_lock_settings''' value.&lt;br /&gt;
&lt;br /&gt;
== See Also ==&lt;br /&gt;
* [[EraWML]]&lt;br /&gt;
* [[ScenarioWML]]&lt;br /&gt;
* [[ReferenceWML]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category: WML Reference]]&lt;/div&gt;</summary>
		<author><name>Soliton</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.wesnoth.org/index.php?title=AbilitiesWML&amp;diff=74405</id>
		<title>AbilitiesWML</title>
		<link rel="alternate" type="text/html" href="https://wiki.wesnoth.org/index.php?title=AbilitiesWML&amp;diff=74405"/>
		<updated>2025-06-20T20:15:09Z</updated>

		<summary type="html">&lt;p&gt;Soliton: Revert last 3 non-sensical edits&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{WML Tags}}&lt;br /&gt;
==  Abilities and their effects ==&lt;br /&gt;
&lt;br /&gt;
There are two types of abilities: ones that apply to units (called ''abilities'') and ones that only apply when using a particular attack (called ''specials'' or ''weapon specials'').  A unit may have multiple abilities and an attack can have multiple specials.&lt;br /&gt;
&lt;br /&gt;
Each ability or special defines an effect based on one to three units. Most abilities apply to a single unit, and '''[filter_self]''' can be used to determine when the ability is active. Weapon specials apply to two units, which can be filtered either as &amp;quot;attacker&amp;quot; and &amp;quot;defender&amp;quot; (with the obvious meaning) or as &amp;quot;self&amp;quot; and &amp;quot;other&amp;quot; – the unit that possesses the special, and that unit's opponent. When filtering on the &amp;quot;other&amp;quot; unit, you use '''[filter_opponent]'''.&lt;br /&gt;
&lt;br /&gt;
Leadership-style abilities are a more complex case, as they involve three units. Like a weapon special, there is an attacker and defender, but there is also a third unit that could be referred to as the &amp;quot;teacher&amp;quot;. The &amp;quot;teacher&amp;quot; is the unit that possesses the ability, so it is referred to as &amp;quot;self&amp;quot; in the ability. A leadership ability works by temporarily granting a weapon special to either the attacker or the defender. The unit that benefits from this is referred to as the &amp;quot;student&amp;quot;, while the unit that does not benefit is simply the &amp;quot;other&amp;quot; unit. When filtering on the &amp;quot;other&amp;quot; unit, you use '''[filter_opponent]''', while the student can be filtered with '''[filter_student]'''.&lt;br /&gt;
&lt;br /&gt;
== The ''[abilities]'' tag ==&lt;br /&gt;
&lt;br /&gt;
The following tags are used to describe an ability in WML:&lt;br /&gt;
&lt;br /&gt;
* '''[heals]''': modifies the hitpoints of a unit at the beginning of the healer's turn&lt;br /&gt;
* '''[regenerate]''': modifies the hitpoints of a unit at the beginning of the unit's turn&lt;br /&gt;
* '''[resistance]''': modifies the resistance of a unit to damage&lt;br /&gt;
* '''[leadership]''': modifies the damage of a unit&lt;br /&gt;
* '''[skirmisher]''': negates enemy zones of control&lt;br /&gt;
* '''[illuminates]''': modifies the time of day adjacent to the affected units&lt;br /&gt;
* '''[teleport]''': allows the unit to teleport&lt;br /&gt;
* '''[hides]''': renders the unit invisible to enemies&lt;br /&gt;
* {{DevFeature1.15|0}} All [[#The_.5Bspecials.5D_tag|weapon specials]] except for '''[plague]''', '''[heal_on_hit]''', and '''[swarm]''' can be placed in the '''[abilities]''' tag. These [[#Extra_tags_and_keys_used_by_weapon_specials_as_abilities|&amp;quot;weapon specials as abilities&amp;quot;]] will give the weapon special to all attacks the unit has.&lt;br /&gt;
* Any other tag is valid (for example '''[dummy]'''), but will result in an ability that does nothing but report it's there. '''Note:''' a dummy ability must have an id for the name and description to display.&lt;br /&gt;
* {{DevFeature1.15|3}} All the engine [[#The_.5Bspecials.5D_tag|weapon specials]] can be placed in the [abilities] tag now.&lt;br /&gt;
&lt;br /&gt;
=== Available formula variables in Abilities and Weapon Specials  ===&lt;br /&gt;
&lt;br /&gt;
{{DevFeature1.15|?}} When using formulas in abilities and weapon specials, the following formula variables are available:&lt;br /&gt;
* '''self''': (unit) the unit that has the ability&lt;br /&gt;
* '''student''': (unit) for leadership-like abilities this is the unit that is adjacent to the unit that has the ability; if affect_self=yes, this is also unit who has ability.&lt;br /&gt;
* '''attacker''': (unit) for attack-related abilities and weapon specials, this is the attacking unit during the attack.&lt;br /&gt;
* '''defender''': (unit) for attack-related abilities and weapon specials, this is the defending unit during the attack.&lt;br /&gt;
* '''other''': (unit) the unit whose stats get modified from the ability. For abilities without 'apply_to=opponent' this is always the same as 'student'.&lt;br /&gt;
&lt;br /&gt;
=== Common keys and tags for every ability ===&lt;br /&gt;
&lt;br /&gt;
{{DevFeature1.13|?}} All keys inside any ability that expects a numeric value will also accept formulas using &lt;br /&gt;
[[Wesnoth Formula Language]]. In order to use a formula in these keys, you must enclose it in parentheses. However, do '''not''' precede those parentheses with a dollar sign like &amp;lt;code&amp;gt;$(...)&amp;lt;/code&amp;gt;, since that will erase the &amp;lt;tt&amp;gt;self&amp;lt;/tt&amp;gt; variable.&lt;br /&gt;
&lt;br /&gt;
* '''name''': the (translatable) name of the ability. If omitted, the ability will be a hidden ability.&lt;br /&gt;
* '''female_name''': the (translatable) name of the ability when possessed by a female unit. Defaults to ''name'' if not specified.&lt;br /&gt;
* '''name_inactive''': the (translatable) name of the ability when inactive. Defaults to ''name'' if not specified; if the ability is supposed to be not displayed when inactive, you must explicitly set ''name_inactive'' to an empty string (nothing after the equals sign).&lt;br /&gt;
* '''female_name_inactive''': the (translatable) name of the ability when inactive and possessed by a female unit. Defaults to ''name_inactive'' if not specified. You should thus set ''female_name'' as well!&lt;br /&gt;
* '''description''': the (translatable) description of the ability.&lt;br /&gt;
* '''description_inactive''': the (translatable) description of the ability when inactive. Defaults to ''description'' if not specified.&lt;br /&gt;
* '''special_note''' {{DevFeature1.15|14}} Translatable string, which will be displayed in the unit’s help. See also [[UnitTypeWML#Special_Notes]].&lt;br /&gt;
* '''affect_self''': if equal to 'yes' (default), the ability will affect the unit that has it.&lt;br /&gt;
* '''affect_allies''': if equal to 'yes', the ability will affect units from the same and allied sides in the specified adjacent hexes. If set to 'no' it will not affect own or allied sides. If not set (default) it will affect units on the same side but not from allied sides.&lt;br /&gt;
* '''affect_enemies''': if equal to 'yes' (default is 'no'), the ability will affect enemies in the specified adjacent hexes.&lt;br /&gt;
* '''cumulative''': if set to 'yes', this ability will be cumulative with the base value for this ability. ''Beware of the bug with cumulative leadership in 1.16 https://github.com/wesnoth/wesnoth/issues/6466 , more info see below, in &amp;quot;Extra keys used by the ''leadership'' ability&amp;quot; section''. {{DevFeature1.17|5}}, bug fixed.&lt;br /&gt;
* '''id''': this ability will not be cumulative with other abilities using this id. Must be present if cumulative is anything other than 'yes'.&lt;br /&gt;
* '''halo_image''': {{DevFeature1.17|22}} if used, the halo specified showed on unit affected by ability.&lt;br /&gt;
* '''overlay_image''': {{DevFeature1.17|22}} if used, the overlay specified showed on unit affected by ability.&lt;br /&gt;
* '''halo_image_self''': {{DevFeature1.17|22}} if used, the halo specified showed on unit who has ability when active.&lt;br /&gt;
* '''overlay_image_self''': {{DevFeature1.17|22}} if used, the overlay specified showed on unit who has ability when active.&lt;br /&gt;
* '''[filter]''': [[StandardUnitFilter]] If the unit owning the ability does not match this filter, the ability will be inactive.&lt;br /&gt;
* {{anchor|affect_adjacent|'''[affect_adjacent]'''}}: an adjacent unit that does not match this filter will not receive its effects. There can be multiple [affect_adjacent] tags in a single ability; a unit needs to match any one of these to receive the effects. The side requirement of matching units is defined by the '''affect_allies''' and '''affect_enemies''' keys. If there are no [affect_adjacent] tags, then no adjacent units will receive the effects.&lt;br /&gt;
** '''adjacent''': a comma separated list of any combination of these directions: '''n''','''ne''','''se''','''s''','''sw''','''nw'''. (See [[StandardLocationFilter#Directions|notes]])&lt;br /&gt;
** '''[filter]''': a [[StandardUnitFilter]]. {{DevFeature1.13|2}} The variable $other_unit refers to the unit owning the ability.&lt;br /&gt;
** '''radius''': {{DevFeature1.19|13}} set to 1 by default, it determines the range within which units can be affected beyond immediately adjacent units, if the value is equal to 'full-map', the area is the entire map.&lt;br /&gt;
* '''[filter_self]''': if the owner of the ability does not match this filter, it will not receive the effects of the ability. [filter_self] takes a [[StandardUnitFilter]] as argument.&lt;br /&gt;
* '''[filter_adjacent]''': if an adjacent unit does not match this filter, the ability will not be active and no-one will receive its affects. Takes extra keys ''adjacent'', ''count'', ''is_enemy'', just like in a [[StandardUnitFilter]], with the one difference that, in the absence of a specified ''count'', all listed directions must match (so, with two directiones eg ''adjacent=n,s'', the default is ''count=2''). In fact, it's really a shorthand for a [filter_adjacent] nested within [filter]. The variables $this_unit and {{DevFeature1.13|2}} $other_unit both work as you'd expect. Multiple [filter_adjacent] can be provided, all of which must pass for the ability to activate.&lt;br /&gt;
* '''[filter_adjacent_location]''': like [filter_adjacent], but filters on locations instead of units. This is a shorthand for [filter][filter_location][filter_adjacent_location].&lt;br /&gt;
* {{anchor|filter_base_value|'''[filter_base_value]'''}}: filters on the value before any modifications; uses the keys '''equals''', '''not_equals''', etc. If several keys are used all have to match.&lt;br /&gt;
* '''[event]''': [[EventWML]]. {{DevFeature1.19|4}} An [event] to be included into any scenario where a unit with this ability appears in. Note that such events get included when a unit with this ability first appears in the scenario, not automatically when the scenario begins (meaning that ''name=prestart'' events, for example, would usually never trigger). See [[WML_Abilities|WML Abilities]]. Shortcut of [unit_type][event].&lt;br /&gt;
&lt;br /&gt;
=== Extra keys used by the ''[heals]'' ability ===&lt;br /&gt;
&lt;br /&gt;
* '''value''': the amount healed.&lt;br /&gt;
* '''poison''': can be one of ''slowed'' or ''cured''. ''slowed'' means poison will not take effect for adjacent units (it's not related to the weapon special &amp;quot;slows&amp;quot;).&lt;br /&gt;
&lt;br /&gt;
=== Extra keys used by the ''[regenerate]'' ability ===&lt;br /&gt;
&lt;br /&gt;
* '''value''': the amount healed.&lt;br /&gt;
* '''poison''': can be one of ''slowed'' or ''cured''.&lt;br /&gt;
&lt;br /&gt;
=== Extra keys and tags used by the ''[resistance]'' ability ===&lt;br /&gt;
&lt;br /&gt;
* '''value''': set resistance to this value.&lt;br /&gt;
* '''max_value''': maximum resistance value. Default: 0%. {{DevFeature1.17|24}} Default: no limit.&lt;br /&gt;
* '''min_value''': {{DevFeature1.19|0}} minimum resistance value. Default: no limit.&lt;br /&gt;
* '''add''': adds to resistance. Note the interaction with '''sub''' in [[#Common_calculations]].&lt;br /&gt;
* '''sub''': subtracts from resistance.&lt;br /&gt;
* '''multiply''': multiplies resistance value. &lt;br /&gt;
* '''divide''': divides resistance value.&lt;br /&gt;
* '''apply_to''': a list of damage types; if left out, the ability applies to all types.&lt;br /&gt;
* '''active_on''': one of 'defense' or 'offense'; if left out, the ability is active on both.&lt;br /&gt;
These keys affect the actual resistance (e.g. -20%), not the damage modifier normally used in [resistance] (e.g. 120).&lt;br /&gt;
* '''[filter_weapon]''': {{DevFeature1.15|0}} If present, the resistance ability only takes effect when the owner of the ability uses a matching weapon.&lt;br /&gt;
* '''[filter_second_weapon]''': {{DevFeature1.15|0}} If present, the resistance ability only takes effect when the opponent uses a matching weapon.&lt;br /&gt;
&lt;br /&gt;
=== Extra keys used by the ''[leadership]'' ability ===&lt;br /&gt;
&lt;br /&gt;
* '''value''': the percentage bonus to damage.&lt;br /&gt;
* '''add''': the cumulative percentage bonus to damage. Note the interaction with '''sub''' in [[#Common_calculations]].&lt;br /&gt;
* '''sub''': the cumulative percentage bonus subtracted to damage.&lt;br /&gt;
* '''multiply''': multiplies resistance value. &lt;br /&gt;
* '''divide''': divides resistance value.&lt;br /&gt;
''Note:'' cumulative leadership with '''cumulative=yes''' and '''value=''' doesn't work in 1.16 (but fixed in 1.17.12 and later). To work around use '''add=''' or '''sub=''' key (it doesn't require cumulative) (https://github.com/wesnoth/wesnoth/issues/6466 ). If you want each instance of a ''[leadership]'' with the same id to be added you will be able to reuse '''cumulative=yes''' in 1.17.12 and later, otherwise, if you want to add the value of another ''[leadership]'' only once even with the same id in several copies, use '''add'''.&lt;br /&gt;
* '''[filter_weapon]''': {{DevFeature1.15|0}} If present, the leadership ability only takes effect when the owner of the ability uses a matching weapon.&lt;br /&gt;
* '''[filter_second_weapon]''': {{DevFeature1.15|0}} If present, the leadership ability only takes effect when the opponent uses a matching weapon.&lt;br /&gt;
&lt;br /&gt;
=== Extra keys used by the ''[illuminates]'' ability ===&lt;br /&gt;
&lt;br /&gt;
Because this ability changes the terrain instead of units on it, affect_self, affect_allies, affect_enemies and [filter_adjacent] have no effect.&lt;br /&gt;
* '''value''': the percentage bonus to lawful units. Units with '''alignment=lawful''' do +''value'' % damage when under the influence of a unit with this ability. Units with '''alignment=chaotic''' do -''value'' % damage. Units with '''alignment=neutral''' are unaffected by this ability. Units with '''alignment=liminal''' do -(abs(''value'')) % damage. ''value'' can be a negative number; this is useful if you want to give Chaotic units an advantage instead of Lawful ones. &lt;br /&gt;
* '''add''': the cumulative percentage bonus to damage. Note the interaction with '''sub''' in [[#Common_calculations]].&lt;br /&gt;
* '''sub''': the cumulative percentage bonus subtracted to damage.&lt;br /&gt;
* '''multiply''': multiplies resistance value. &lt;br /&gt;
* '''divide''': divides resistance value.&lt;br /&gt;
* '''max_value''': the maximum percentage bonus given. Cannot be less than 0. Defaults to 0 if not present.&lt;br /&gt;
* '''min_value''': the minimum percentage bonus given. Cannot be greater than 0. Defaults to 0 if not present.&lt;br /&gt;
&lt;br /&gt;
=== Extra keys used by the ''[hides]'' ability ===&lt;br /&gt;
&lt;br /&gt;
* '''alert''': the displayed text when the unit is discovered. Default &amp;quot;Ambushed!&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
=== Extra tags used by the ''[teleport]'' ability ===&lt;br /&gt;
&lt;br /&gt;
* '''[tunnel]''' - a [[DirectActionsWML#.5Btunnel.5D|tunnel tag]] (without the remove key) defining the tunneling source and target hexes, and maybe other conditions. (It automatically applies only to the unit with the ability.)  You may use $teleport_unit inside the [tunnel][source] and [tunnel][target] tag for filtering purposes.&lt;br /&gt;
&lt;br /&gt;
=== Extra tags and keys used by weapon specials as abilities ===&lt;br /&gt;
&lt;br /&gt;
* {{anchor|filter_student|'''[filter_student]'''}}: {{DevFeature1.15|0}} If present, only the unit matching this filter, either the possessor of the ability if affect_self=yes, or an adjacent unit matching '''[filter_adjacent]''' will be affected. '''Replaces''' '''[filter_self]''' of normal weapon specials.&lt;br /&gt;
* '''overwrite_specials''': {{DevFeature1.15|13}} If present, allows a special abilities weapon with a numerical value to impose its value and ignore values of abilities or specials of the same type. If '''overwrite_specials=one_side''', the specials and abilities used by the opponent of the unit affected by the ability with this key and applied to it will not be affected. If '''overwrite_specials=both_sides''', all non-key-carrying abilities and all specials of the same type affecting the recipient unit will be affected, even if used by the opponent (used in the macro FORCE_CHANCE_TO_HIT).&lt;br /&gt;
* {{anchor|overwrite|'''[overwrite]'''}}: {{DevFeature1.17|22}} Part of '''overwrite_specials'''. Allows more flexibility in determining which specials should take priority over other specials of the same type.&lt;br /&gt;
** '''priority''': A numeric value to use when determining which special should be used if multiple specials of the same type have the '''overwrite_specials''' attribute. Default is 0.&lt;br /&gt;
** {{anchor|filter_specials|'''[experimental_filter_specials]'''}}: [[StandardAbilityFilter]] Further attributes to filter specials by to determine if it should take priority over other specials. Accepts the same attributes as [experimental_filter_ability].&lt;br /&gt;
* Other keys and tags appropriate to the specific weapon special.&lt;br /&gt;
&lt;br /&gt;
=== Macros for common abilities ===&lt;br /&gt;
&lt;br /&gt;
[https://www.wesnoth.org/macro-reference.html#file:abilities.cfg macro reference]&lt;br /&gt;
* ABILITY_AMBUSH&lt;br /&gt;
* ABILITY_CURES&lt;br /&gt;
* ABILITY_HEALS&lt;br /&gt;
* ABILITY_ILLUMINATES&lt;br /&gt;
* ABILITY_LEADERSHIP_LEVEL_1 to ABILITY_LEADERSHIP_LEVEL_5&lt;br /&gt;
* {{DevFeature1.13|2}} ABILITY_LEADERSHIP (replaces the above leadership macros, which are now deprecated)&lt;br /&gt;
* ABILITY_NIGHTSTALK&lt;br /&gt;
* ABILITY_REGENERATES&lt;br /&gt;
* ABILITY_SKIRMISHER&lt;br /&gt;
* ABILITY_STEADFAST&lt;br /&gt;
* ABILITY_SUBMERGE&lt;br /&gt;
* ABILITY_TELEPORT&lt;br /&gt;
&lt;br /&gt;
== The ''[specials]'' tag ==&lt;br /&gt;
&lt;br /&gt;
The '''[specials]''' tag goes inside the '''[attack]''' tag. It can contain the following tags:&lt;br /&gt;
&lt;br /&gt;
* '''[attacks]''': modifies the number of attacks of a weapon, in using '''value''', '''add''', '''sub''', '''multiply''' or '''divide''' attributes&lt;br /&gt;
* '''[berserk]''': pushes the attack for more than one combat round, using '''value''' attribute, '''value''' is 1 by default&lt;br /&gt;
* '''[chance_to_hit]''': modifies the chance to hit of a weapon, using same standard numerical attributes as '''[attacks]'''&lt;br /&gt;
* '''[damage]''': modifies the damage of a weapon, using same attributes as '''[attacks]''' and '''[chance_to_hit]'''&lt;br /&gt;
* '''[damage_type]''' {{DevFeature1.17|23}}: changes the damage type of a weapon&lt;br /&gt;
* '''[disable]''': disables the weapon&lt;br /&gt;
* '''[drains]''': heals the attacker half of the damage dealt, using same attributes as '''[attacks]''' and '''[chance_to_hit]''', '''value''' is 50% by default&lt;br /&gt;
* '''[firststrike]''': forces the weapon to always strike first&lt;br /&gt;
* '''[heal_on_hit]''': heals the attacker when an attack connects, using same attributes as '''[attacks]''' and '''[chance_to_hit]''', '''value''' is 0 by default&lt;br /&gt;
* '''[petrifies]''': turns the target to stone&lt;br /&gt;
* '''[plague]''': when used to kill an enemy, a friendly unit takes its place&lt;br /&gt;
* '''[poison]''': poisons the target&lt;br /&gt;
* '''[slow]''': slows the target&lt;br /&gt;
* '''[swarm]''': number of strikes decreases as the unit loses hitpoints&lt;br /&gt;
Any other tag is valid, but will result in a special that does nothing but report it is there.&lt;br /&gt;
&lt;br /&gt;
=== Common keys and tags for every weapon special ===&lt;br /&gt;
&lt;br /&gt;
{{DevFeature1.13|?}} All keys inside any weapon special that expects a numeric value will also accept formulas using [[Wesnoth Formula Language]]. In order to use a formula in these keys, you must enclose it in parentheses.&lt;br /&gt;
&lt;br /&gt;
* '''name''': the (translatable) name of the special. If omitted, the special will be hidden from the player.&lt;br /&gt;
* '''name_inactive''': the (translatable) name of the special when inactive. Defaults to ''name'' if not specified; if the special is supposed to be not displayed when inactive, you must explicitly set ''name_inactive'' to an empty string (nothing after the equals sign).&lt;br /&gt;
* '''description''': the (translatable) description of the special.&lt;br /&gt;
* '''description_inactive''': the (translatable) description of the special when inactive. Defaults to ''description'' if not specified.&lt;br /&gt;
* '''special_note''' {{DevFeature1.15|14}} Translatable string, which will be displayed in the unit’s help. See also [[UnitTypeWML#Special_Notes]].&lt;br /&gt;
* '''id''': this ability will not be cumulative with other specials using this id.&lt;br /&gt;
* '''active_on''': one of '''defense''' or '''offense'''; if left out, the special is active on both.&lt;br /&gt;
* '''apply_to''': one of '''self''','''opponent''','''attacker''','''defender''','''both''' (default: ''self''). Determines who the effects of this special are applied to.&lt;br /&gt;
* '''[filter_adjacent]''': if an adjacent unit does not match this filter, the special will not be active and no-one will receive its effects. Takes extra keys ''adjacent'', ''count'', ''is_enemy'', just like in a [[StandardUnitFilter]]. In fact, it's really a shorthand for a [filter_adjacent] nested within [filter_self], with the one difference that, in the absence of a specified ''count'', all listed directions must match (so, with two directiones eg ''adjacent=n,s'', the default is ''count=2''). The variables $this_unit and {{DevFeature1.13|2}} $other_unit both work as you'd expect. Multiple [filter_adjacent] can be provided, all of which must pass for the ability to activate. &lt;br /&gt;
* '''[filter_adjacent_location]''': like [filter_adjacent], but filters on locations instead of units. This is a shorthand for [filter_self][filter_location][filter_adjacent_location].&lt;br /&gt;
* {{anchor|filter_self|'''[filter_self]'''}}: the special will only be active if the owner matches this [[StandardUnitFilter]] (SUF).&lt;br /&gt;
** '''[filter_weapon]''': a [[FilterWML#Filtering_Weapons|standard weapon filter]], including special=.&lt;br /&gt;
** '''$other_unit''': {{DevFeature1.13|2}} The special variable $other_unit refers to the opponent.&lt;br /&gt;
* {{anchor|filter_opponent|'''[filter_opponent]'''}}: the special will only be active if the opponent matches this SUF.&lt;br /&gt;
** '''[filter_weapon]''': a [[FilterWML#Filtering_Weapons|standard weapon filter]], including special=.&lt;br /&gt;
** '''$other_unit''': {{DevFeature1.13|2}} The special variable $other_unit refers to the unit that owns the weapon.&lt;br /&gt;
* {{anchor|filter_attacker|'''[filter_attacker]'''}}: the special will only be active if the attacker matches this SUF.&lt;br /&gt;
** '''[filter_weapon]''': a [[FilterWML#Filtering_Weapons|standard weapon filter]], including special=.&lt;br /&gt;
** '''$other_unit''': {{DevFeature1.13|2}} The special variable $other_unit refers to the defender.&lt;br /&gt;
* {{anchor|filter_defender|'''[filter_defender]'''}} the special will only be active if the defender matches this SUF.&lt;br /&gt;
** '''[filter_weapon]''': a [[FilterWML#Filtering_Weapons|standard weapon filter]], including special=.&lt;br /&gt;
** '''$other_unit''': {{DevFeature1.13|2}} The special variable $other_unit refers to the attacker.&lt;br /&gt;
* '''overwrite_specials''': if equal to 'one_side', then only this unit's specials are evaluated. If equal to 'both_sides', then both this unit's specials and any of the opponent's weapon specials that affect this unit are evaluated. If a special with this attribute is active, it will take precedence over any other specials of the same type that do not have this attribute. Don't applied to boolean weapon special like [poison] ,[slow], [firststrike] or [petrifies].&lt;br /&gt;
* '''[overwrite]''': {{DevFeature1.17|22}} Allows more flexibility in determining which specials should take priority over other specials of the same type.&lt;br /&gt;
** '''priority''': A numeric value to use when determining which special should be used if multiple specials of the same type have the '''overwrite_specials''' attribute. Default is 0.&lt;br /&gt;
** '''[experimental_filter_specials]''': [[StandardAbilityFilter]] Further attributes to filter specials by to determine if it should take priority over other specials. Accepts the same attributes as [experimental_filter_ability], {{DevFeature1.19|5}} [experimental_filter_specials] deprecated, use [filter_specials] instead.&lt;br /&gt;
* '''[event]''': [[EventWML]]. {{DevFeature1.19|4}} An [event] to be included into any scenario where a unit with this weapon special appears in. Note that such events get included when a unit with this weapon special first appears in the scenario, not automatically when the scenario begins (meaning that ''name=prestart'' events, for example, would usually never trigger). See [[WML_Abilities|WML Abilities]]. Shortcut of [unit_type][event].&lt;br /&gt;
&lt;br /&gt;
=== Common keys and tags for specials with a value ===&lt;br /&gt;
&lt;br /&gt;
The '''[damage]''', '''[attacks]''', and '''[chance_to_hit]''' specials take values that specify how those specials modify their respective base values. The '''[drains]''' special takes a value specifying the percentage of damage drained (default 50) and '''[heal_on_hit]''' takes the amount to heal (default 0; negative values will harm the attacker, but not kill). &lt;br /&gt;
&lt;br /&gt;
* '''value''': the value to be used. &lt;br /&gt;
* '''add''': the number to add to the base value. Note the interaction with '''sub''' in [[#Common_calculations]].&lt;br /&gt;
* '''sub''': the number to subtract from the base value.&lt;br /&gt;
* '''multiply''': this multiplies the base value.&lt;br /&gt;
* '''divide''': this divides the base value.&lt;br /&gt;
* '''cumulative''': if set to 'yes', this special will be cumulative with the base value.&lt;br /&gt;
* '''backstab''': if set to 'yes', this special will only apply to the attacker, and only when there is an enemy on the target's opposite side (i.e. when the standard backstab special applies). {{DevFeature1.13|2}} This is now deprecated. The same functionality can be achieved with a [filter_adjacent] in [filter_opponent]; see the implementation of the default backstab special for details.&lt;br /&gt;
* '''[filter_base_value]''': filters on the value before any modifications; uses the keys '''equals''', '''not_equals''', '''less_than''', '''greater_than''', '''less_than_equal_to''', '''greater_than_equal_to'''.&lt;br /&gt;
&lt;br /&gt;
==== Common calculations ====&lt;br /&gt;
&lt;br /&gt;
Several abilities and weapon specials take the keys '''add''', '''sub''', '''multiply''' and '''divide'''.&lt;br /&gt;
&lt;br /&gt;
{{DevFeature1.19|4}} '''add''' and '''sub''' work independently.&lt;br /&gt;
&lt;br /&gt;
Prior to 1.19.4:&lt;br /&gt;
&lt;br /&gt;
* If '''add''' and '''sub''' are used in the same ability, the '''add''' is ignored&lt;br /&gt;
* If '''add''' and '''sub''' are used in separate abilities with the same id, or with the default id that's used when no id is specified, then the order in which the abilities are encountered controls the calculation, which may change depending on units' positions on the map.&lt;br /&gt;
&lt;br /&gt;
=== Extra keys used by the ''[damage_type]'' special ===&lt;br /&gt;
&lt;br /&gt;
{{DevFeature1.17|23}}&lt;br /&gt;
&lt;br /&gt;
* '''replacement_type''': replaces the attack type with the specified type when [damage_type] is active.&lt;br /&gt;
* '''alternative_type''': add a second type of attack to the existing type, it is always the one of the two which will do the most damage to the opponent which will be used.&lt;br /&gt;
&lt;br /&gt;
'''Note:''' In 1.18, alternative_type may be stronger than expected, as the damage calculations sometimes ignore [resistance] abilities. This is a known bug, which occurs deterministically and will be left unfixed in 1.18.x to prevent Out Of Sync errors.&lt;br /&gt;
&lt;br /&gt;
'''Note:''' If a [damage_type] special includes a [filter_weapon]type=, that filter is tested against the base type of the weapon, ignoring all [damage_type] specials.&lt;br /&gt;
&lt;br /&gt;
=== Extra keys used by the ''[berserk]'' special ===&lt;br /&gt;
&lt;br /&gt;
* '''value''': the maximum number of combat rounds (default 1).&lt;br /&gt;
* '''cumulative''': if set to 'yes', this special will be cumulative with other active berserk specials (on the current combatant, not with an opponent's berserk).&lt;br /&gt;
&lt;br /&gt;
=== Extra keys used by the ''[plague]'' special ===&lt;br /&gt;
&lt;br /&gt;
* '''type''': the unit type to be spawned on kill. When not specified, the default is the unit type of the unit doing the plaguing.&lt;br /&gt;
&lt;br /&gt;
=== Extra keys used by the ''[swarm]'' special ===&lt;br /&gt;
&lt;br /&gt;
* '''swarm_attacks_max''': the maximum number of attacks for the swarm. Defaults to the base number of attacks modified by any applicable [attacks] specials. If this is specified, then the base number of attacks is ignored.&lt;br /&gt;
* '''swarm_attacks_min''': the minimum number of attacks for the swarm. Defaults to zero. This can be set higher than swarm_attacks_max to cause a unit to gain attacks as health decreases.&lt;br /&gt;
The ratio of the unit's current to maximum hit points will be used to scale the number of attacks between these two values.&lt;br /&gt;
&lt;br /&gt;
Prior to version 1.11, a [swarm] special will cause [attacks] specials to be ignored. In 1.11 and later, [attacks] specials are applied before [swarm].&lt;br /&gt;
&lt;br /&gt;
=== Macros for common weapon specials ===&lt;br /&gt;
&lt;br /&gt;
[https://www.wesnoth.org/macro-reference.html#file:weapon_specials.cfg macro reference]&lt;br /&gt;
* WEAPON_SPECIAL_BACKSTAB&lt;br /&gt;
* WEAPON_SPECIAL_BERSERK&lt;br /&gt;
* WEAPON_SPECIAL_CHARGE&lt;br /&gt;
* WEAPON_SPECIAL_DRAIN&lt;br /&gt;
* WEAPON_SPECIAL_FIRSTSTRIKE&lt;br /&gt;
* WEAPON_SPECIAL_MAGICAL&lt;br /&gt;
* WEAPON_SPECIAL_MARKSMAN&lt;br /&gt;
* WEAPON_SPECIAL_PLAGUE&lt;br /&gt;
* WEAPON_SPECIAL_PLAGUE_TYPE TYPE&lt;br /&gt;
* WEAPON_SPECIAL_POISON&lt;br /&gt;
* WEAPON_SPECIAL_SLOW&lt;br /&gt;
* WEAPON_SPECIAL_STONE&lt;br /&gt;
* WEAPON_SPECIAL_SWARM&lt;br /&gt;
&lt;br /&gt;
== See Also ==&lt;br /&gt;
&lt;br /&gt;
* [[UnitTypeWML]]&lt;br /&gt;
* [[SingleUnitWML]]&lt;br /&gt;
* [[ReferenceWML]]&lt;br /&gt;
&lt;br /&gt;
[[Category:WML Reference]]&lt;/div&gt;</summary>
		<author><name>Soliton</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.wesnoth.org/index.php?title=StandardLocationFilter&amp;diff=74404</id>
		<title>StandardLocationFilter</title>
		<link rel="alternate" type="text/html" href="https://wiki.wesnoth.org/index.php?title=StandardLocationFilter&amp;diff=74404"/>
		<updated>2025-06-17T09:23:12Z</updated>

		<summary type="html">&lt;p&gt;Soliton: /* Attributes */&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.  This key can be set in the map editor or with the [terrain] tag.&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]]]&amp;lt;nowiki/&amp;gt;gives_income= parameter was set to yes (which means a side can own that hex).&lt;br /&gt;
* '''gives_income''': {{DevFeature1.15|11}} Matches whether or not a hex gives income, based on its terrain_type settings.&lt;br /&gt;
* {{anchor|filter_vision|'''[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;
* {{anchor|filter_owner|'''[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. Expects containers to contain '''x''','''y''' pairs, not '''location_id''' names.&lt;br /&gt;
* '''radius''': matches if any location within the radius matches this filter ([[StandardLocationFilter#Notes_about_Radius_Usage|notes]])&lt;br /&gt;
* {{anchor|filter_radius|'''[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;
* {{anchor|filter_adjacent_location|'''[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)]]. Do not surround the formula in &amp;lt;code&amp;gt;$(...)&amp;lt;/code&amp;gt;, since that will erase the &amp;lt;tt&amp;gt;self&amp;lt;/tt&amp;gt; variable.&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 context object is a '''terrain hex object''' with the following properties:&lt;br /&gt;
&lt;br /&gt;
* '''x''', '''y''', '''loc''': the latter is a '''location object''' such as what would be returned by [[Wesnoth_Formula_Language#loc|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_side'''&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;
Some location formulas also have access to a '''teleport_unit''' variable, which is a '''[[StandardUnitFilter#Wesnoth_Formula_Language|unit object]]'''.&lt;br /&gt;
&lt;br /&gt;
== Tutorial ==&lt;br /&gt;
* [[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>Soliton</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.wesnoth.org/index.php?title=TerrainCodesWML&amp;diff=74379</id>
		<title>TerrainCodesWML</title>
		<link rel="alternate" type="text/html" href="https://wiki.wesnoth.org/index.php?title=TerrainCodesWML&amp;diff=74379"/>
		<updated>2025-06-05T15:39:51Z</updated>

		<summary type="html">&lt;p&gt;Soliton: /* Terrain codes in map data */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{WML Tags}}&lt;br /&gt;
&lt;br /&gt;
Note: the old (1.2) terrain system is no longer documented here. If you have 1.2 maps you will need to convert them using [[Maintenance_tools|wmllint]].&lt;br /&gt;
&lt;br /&gt;
== Terrain strings ==&lt;br /&gt;
&lt;br /&gt;
The following rules hold for terrain strings. Note most of these rules are not validated since it would slow down Wesnoth; not following these rules might break Wesnoth.&lt;br /&gt;
&lt;br /&gt;
* terrain strings are composed from one or two terrain codes of 2 to 4 characters (bytes) each, separated by ^.&lt;br /&gt;
* terrain codes start with a capital letter and the following letters are lower case&lt;br /&gt;
* terrain strings can only contain letters, the symbols /|\ which are meant for directional items like bridges and the symbol ^&lt;br /&gt;
* the underscore is used as a leader for internal terrain codes&lt;br /&gt;
* the star '*' can be used for wildcards in some places where a terrain code is required for matching&lt;br /&gt;
* the symbol ^ indicates that a terrain is created with layers, for example Gs^Fp means Semi-dry Grass(&amp;lt;b&amp;gt;Gs&amp;lt;/b&amp;gt;) with a Forest(&amp;lt;b&amp;gt;Fp&amp;lt;/b&amp;gt;) overlay.&lt;br /&gt;
&lt;br /&gt;
Starting positions are defined by a number followed by 1 space and then the terrain string.&lt;br /&gt;
&lt;br /&gt;
The letters Y,y,Z,z are reserved for UMC and mainline campaigns, so any string containing any of these letters is a custom terrain. Other undefined terrain strings are reserved for future expansion within Wesnoth.&lt;br /&gt;
&lt;br /&gt;
=== Terrain Table ===&lt;br /&gt;
&lt;br /&gt;
The list of terrains can be found at [[TerrainCodeTableWML]]. Since most overlays can be combined with most bases the list is not complete.&lt;br /&gt;
&lt;br /&gt;
== Adding terrains ==&lt;br /&gt;
When adding terrains make sure the following files are also checked:&lt;br /&gt;
&lt;br /&gt;
data/multiplayer/factions/* contains favorite positions for the different factions, this is only used for the random map generator at the moment so it is not very important.&lt;br /&gt;
&lt;br /&gt;
data/core/macros/abilities.cfg contains the definition of ''submerge'' and ''ambush'' so depending on the change these need to be updated.&lt;br /&gt;
&lt;br /&gt;
== Decoding the Terrain Codes ==&lt;br /&gt;
The initial letters of each terrain code have a standard meaning, though some are not obvious.&lt;br /&gt;
* A = “Arctic”  i.e. frozen &lt;br /&gt;
* B = “Bridge”&lt;br /&gt;
* C = “Castle”&lt;br /&gt;
* D = “Desert” &lt;br /&gt;
* E = &amp;quot;Embellishment&amp;quot;&lt;br /&gt;
* F = “Forest”&lt;br /&gt;
* G = “Grass” i.e. flat&lt;br /&gt;
* H = “Hills”&lt;br /&gt;
* I = &amp;quot;Interior&amp;quot; (possible future use)&lt;br /&gt;
* J = ''testing''&lt;br /&gt;
* K = “Keep”&lt;br /&gt;
* L&lt;br /&gt;
* M = “Mountains”&lt;br /&gt;
* N&lt;br /&gt;
* O&lt;br /&gt;
* P = “Portal” i.e. doors, gates&lt;br /&gt;
* Q = &amp;quot;Un-walkable&amp;quot;, {{DevFeature1.17|7}} also used for elevation overlays&lt;br /&gt;
* R = “Road”, also used for “Rails”&lt;br /&gt;
* S = “Swamp”&lt;br /&gt;
* T = {{DevFeature1.15|2}} “Toadstool” i.e. fungus&lt;br /&gt;
* U = “Underground”&lt;br /&gt;
* V = “Village”&lt;br /&gt;
* W = “Water”&lt;br /&gt;
* X = &amp;quot;Impassable&amp;quot;&lt;br /&gt;
* Y = ''Reserved for UMC''&lt;br /&gt;
* Z = ''Reserved for UMC''&lt;br /&gt;
* _ = &amp;quot;special system stuff&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Additional letters do not always follow the same meaning, but are as consistent as possible.&lt;br /&gt;
&lt;br /&gt;
* \, |, / = for indicating the direction of bridges&lt;br /&gt;
* a =&lt;br /&gt;
* b =&lt;br /&gt;
* c = &amp;quot;city&amp;quot;&lt;br /&gt;
* d = &amp;quot;dry or desert, deciduous&amp;quot;&lt;br /&gt;
* e = &amp;quot;encampment&amp;quot;&lt;br /&gt;
* f = &amp;quot;flowers, fall&amp;quot;&lt;br /&gt;
* g&lt;br /&gt;
* h = &amp;quot;human&amp;quot;&lt;br /&gt;
* i = &amp;quot;ice&amp;quot;&lt;br /&gt;
* j&lt;br /&gt;
* k&lt;br /&gt;
* l = &amp;quot;lava&amp;quot;&lt;br /&gt;
* m = &amp;quot;mixed&amp;quot;&lt;br /&gt;
* n&lt;br /&gt;
* o = &amp;quot;orc&amp;quot;&lt;br /&gt;
* p = &amp;quot;pine&amp;quot;&lt;br /&gt;
* q&lt;br /&gt;
* r&lt;br /&gt;
* s = &amp;quot;simple&amp;quot;&lt;br /&gt;
* t = &amp;quot;archetype&amp;quot;, a hidden terrain used only as a base for other terrains&lt;br /&gt;
* u = &amp;quot;underground&amp;quot;&lt;br /&gt;
* v = &amp;quot;elvish&amp;quot;&lt;br /&gt;
* w&lt;br /&gt;
* x = &amp;quot;chasm&amp;quot;&lt;br /&gt;
* y = ''Reserved for UMC''&lt;br /&gt;
* z = ''Reserved for UMC''&lt;br /&gt;
&lt;br /&gt;
== Terrain codes in map data ==&lt;br /&gt;
&lt;br /&gt;
This is not the Matrix. You normally don't need to look at encoded maps. However, it can be beneficial and useful for more advanced users to understand the usage of terrain strings in raw map file.&lt;br /&gt;
&lt;br /&gt;
The encoding for maps has a specific format in Wesnoth:&lt;br /&gt;
&lt;br /&gt;
* A map starts with a header with the following keys &lt;br /&gt;
** '''usage''', this should be 'map' for a map and 'mask' for an overlay mask&lt;br /&gt;
** '''border_size''', the size of the border, should be 1 for map and 0 for mask. When the border_size is 1 the map border is part of the map data, this means the user can define the border instead of the game taking a guess.&lt;br /&gt;
** {{DevFeature1.13|12}} These keys are now deprecated and will be ignored if present. The blank line mentioned below is not required if these keys are absent.&lt;br /&gt;
* Between the header and the data should be 1 empty line&lt;br /&gt;
* A map data file consists of any number of lines, each with the same number of terrain codes.&lt;br /&gt;
* Each string may be padded with spaces or tabs and must be separated with a comma, except for the last string on a line this one may not have a comma.&lt;br /&gt;
* When the file is interpreted, each terrain code will be replaced by the terrain it refers to.&lt;br /&gt;
* Empty lines are allowed before, after and between lines of characters, between lines is not advised.&lt;br /&gt;
* Terrains may be prefixed with a number followed by one space, these indicate the starting position for side ''n''.&lt;br /&gt;
** For Wesnoth 1.12.6, ''n'' = 1, 2, 3, ... 9, and the multiplayer server will refuse maps with more than 9 sides.&lt;br /&gt;
** For Wesnoth 1.14, more than 9 sides can work, discussion https://r.wesnoth.org/t48129 and https://r.wesnoth.org/t48082&lt;br /&gt;
* {{DevFeature1.13|12}} In addition to side numbers, terrains may be prefixed by any number of strings (which should consist of alphanumeric characters only, including underscores). All names and side numbers must be delimited by spaces and are separated from the actual terrain code by an additional space.&lt;br /&gt;
** &amp;lt;s&amp;gt;This is broken according to https://r.wesnoth.org/p627595&amp;lt;/s&amp;gt; I don't see how this is broken. The editor (as of 1.19.12) only displays a single string per hex though.&lt;br /&gt;
&lt;br /&gt;
Since text file tiles are squares while game tiles are hexes, some tiles must be shifted.&lt;br /&gt;
Tiles in even-numbered columns are shifted down 1/2 of a tile.&lt;br /&gt;
For example, to have a road of connected dirt ('Re') tiles, the map data would look like this:&lt;br /&gt;
&lt;br /&gt;
 usage=map&lt;br /&gt;
 border_size=1&lt;br /&gt;
 &lt;br /&gt;
 Re, Re, Gg, Gg, Gg, Gg, Gg, Gg&lt;br /&gt;
 Gg, Gg, Re, Re, Gg, Gg, Gg, Gg&lt;br /&gt;
 Gg, Gg, Gg, Gg, Re, Re, Gg, Gg&lt;br /&gt;
 Gg, Gg, Gg, Gg, Gg, Gg, Re, Re&lt;br /&gt;
&lt;br /&gt;
== See Also ==&lt;br /&gt;
* [[TerrainWML]]&lt;br /&gt;
* [[TerrainCodeTableWML]]&lt;br /&gt;
* [[ReferenceWML]]&lt;br /&gt;
&lt;br /&gt;
[[Category: WML Reference]]&lt;/div&gt;</summary>
		<author><name>Soliton</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.wesnoth.org/index.php?title=UsefulLinks&amp;diff=74293</id>
		<title>UsefulLinks</title>
		<link rel="alternate" type="text/html" href="https://wiki.wesnoth.org/index.php?title=UsefulLinks&amp;diff=74293"/>
		<updated>2025-05-22T16:43:16Z</updated>

		<summary type="html">&lt;p&gt;Soliton: /* Battle for Wesnoth */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
!colspan=2 style='text-align:left'|&lt;br /&gt;
=== Battle for Wesnoth ===&lt;br /&gt;
|-&lt;br /&gt;
|Home Page || https://www.wesnoth.org/&lt;br /&gt;
|-&lt;br /&gt;
|GitHub Project Page || https://github.com/wesnoth/&lt;br /&gt;
|-&lt;br /&gt;
|SPI project page || https://www.spi-inc.org/projects/wesnoth/&lt;br /&gt;
|-&lt;br /&gt;
|Changelog || https://changelog.wesnoth.org/ [http://stable-changelog.wesnoth.org stable]&lt;br /&gt;
|-&lt;br /&gt;
|This wiki || [[StartingPoints|https://wiki.wesnoth.org/]]&lt;br /&gt;
|-&lt;br /&gt;
|The manual || https://manual.wesnoth.org/&lt;br /&gt;
|-&lt;br /&gt;
|Translation statistics || https://gettext.wesnoth.org/&lt;br /&gt;
|-&lt;br /&gt;
|Add-on server web interface || https://addons.wesnoth.org/ [http://stable-addons.wesnoth.org stable] [http://dev-addons.wesnoth.org dev]&lt;br /&gt;
|-&lt;br /&gt;
|Code and Content Copyright || https://wiki.wesnoth.org/Wesnoth:Copyrights&lt;br /&gt;
|-&lt;br /&gt;
|Multiplayer server statistics || https://wesnothd.wesnoth.org/&lt;br /&gt;
|-&lt;br /&gt;
|Multiplayer statistics || https://replays.wesnoth.org/dashboard/&lt;br /&gt;
|-&lt;br /&gt;
|Multiplayer replays || https://replays.wesnoth.org&lt;br /&gt;
|-&lt;br /&gt;
|Unit advancement tree || https://units.wesnoth.org/&lt;br /&gt;
|-&lt;br /&gt;
|SteamDB || https://steamdb.info/app/599390/&lt;br /&gt;
|-&lt;br /&gt;
|Forum for users and developers || https://forums.wesnoth.org/ [https://forums.wesnoth.org/search.php?search_id=newposts new posts]&lt;br /&gt;
|-&lt;br /&gt;
|List of Frequently Proposed Ideas || https://forums.wesnoth.org/viewtopic.php?f=12&amp;amp;t=34904&lt;br /&gt;
|-&lt;br /&gt;
|IRC channel (Libera.Chat) || ircs://irc.libera.chat/#wesnoth&lt;br /&gt;
|-&lt;br /&gt;
|Discord server || https://discord.gg/battleforwesnoth&lt;br /&gt;
|-&lt;br /&gt;
|IRC logs || https://wesnoth.org/irclogs/&lt;br /&gt;
|-&lt;br /&gt;
|Mastodon Account || https://fosstodon.org/@wesnoth&lt;br /&gt;
|-&lt;br /&gt;
|Project statistics || https://openhub.net/p/wesnoth&lt;br /&gt;
|-&lt;br /&gt;
!colspan=2 style='text-align:left'|&lt;br /&gt;
&lt;br /&gt;
=== Developers ===&lt;br /&gt;
|-|Git web interface || https://github.com/wesnoth/wesnoth&lt;br /&gt;
|-&lt;br /&gt;
|Git homepage || https://git-scm.com/&lt;br /&gt;
|-&lt;br /&gt;
|Git documentation || https://git-scm.com/documentation&lt;br /&gt;
|-&lt;br /&gt;
|Code documentation || https://devdocs.wesnoth.org/&lt;br /&gt;
|-&lt;br /&gt;
|GUI(2) documentation || https://wiki.wesnoth.org/GUIToolkit&lt;br /&gt;
|-&lt;br /&gt;
|Lua documentation || https://wiki.wesnoth.org/LuaAPI&lt;br /&gt;
|-&lt;br /&gt;
|WML documentation || https://wiki.wesnoth.org/WML&lt;br /&gt;
|-&lt;br /&gt;
|WFL documentation || https://wiki.wesnoth.org/WFL&lt;br /&gt;
|-&lt;br /&gt;
|Mailing lists || https://listengine.tuxfamily.org/wesnoth.org/ (old: https://mailman.wesnoth.org/)&lt;br /&gt;
|-&lt;br /&gt;
|Bug/Feature tracker || https://bugs.wesnoth.org/&lt;br /&gt;
|-&lt;br /&gt;
|Patch tracker || https://patches.wesnoth.org/&lt;br /&gt;
|-&lt;br /&gt;
|wesnoth.org server stats || https://collectd.wesnoth.org&lt;br /&gt;
|-&lt;br /&gt;
|IRC channel (Libera.Chat) || ircs://irc.libera.chat/wesnoth-dev&lt;br /&gt;
|-&lt;br /&gt;
!colspan=2 style='text-align:left'|&lt;br /&gt;
&lt;br /&gt;
=== Other Links ===&lt;br /&gt;
|-&lt;br /&gt;
|1vs1 Wesnoth ladder || https://wesnoth.gamingladder.info/&lt;br /&gt;
|-&lt;br /&gt;
|Wesnoth matches with commentary || http://www.youtube.com/user/NekisBrutalWesnoth&lt;br /&gt;
|-&lt;br /&gt;
|Wesnoth campaign with commentary in german || https://www.youtube.com/playlist?list=PLc3DmuDuA2imW1vg9xXMNjGHm8VaXvEaz&lt;br /&gt;
|-&lt;br /&gt;
|WSNPP || [[WSNPP|http://wiki.wesnoth.org/WSNPP]]&lt;br /&gt;
|-&lt;br /&gt;
|Run Wesnoth online (Windows) || http://spoon.net/the-battle-for-wesnoth&lt;br /&gt;
|-&lt;br /&gt;
!colspan=2 style='text-align:left'|&lt;br /&gt;
=== Multilingual Players' Sites ===&lt;br /&gt;
|-&lt;br /&gt;
|Community in China || http://wesnoth.cn/&lt;br /&gt;
|-&lt;br /&gt;
|Polish Community || https://www.wesnoth.com.pl/forum/index.php&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
[[Category:Wesnoth Wiki]]&lt;/div&gt;</summary>
		<author><name>Soliton</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.wesnoth.org/index.php?title=Wesnoth_Formula_Language&amp;diff=74288</id>
		<title>Wesnoth Formula Language</title>
		<link rel="alternate" type="text/html" href="https://wiki.wesnoth.org/index.php?title=Wesnoth_Formula_Language&amp;diff=74288"/>
		<updated>2025-05-12T09:40:35Z</updated>

		<summary type="html">&lt;p&gt;Soliton: /* Numbers */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;div class=&amp;quot;tright&amp;quot;&amp;gt; __TOC__ &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The Wesnoth Formula Language is a functional language used to evaluate expressions within the game engine. It allows performing calculations that would not otherwise be possible using only WML. For example, to have an event trigger when a unit has less than half its hitpoints, you could write the following as the event's filter:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=wml&amp;gt;&lt;br /&gt;
[filter]&lt;br /&gt;
    formula = &amp;quot;(hitpoints &amp;lt; max_hitpoints / 2)&amp;quot;&lt;br /&gt;
[/filter]&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The '''formula''' key is a part of [[StandardUnitFilter]] that accepts a condition written as WFL. The part inside the quotes is the WFL formula. This example will evaluate to true if the unit's '''hitpoints''' are less than half its '''max_hitpoints'''.&lt;br /&gt;
&lt;br /&gt;
== Data Types and Operators ==&lt;br /&gt;
&lt;br /&gt;
Wesnoth Formula Language has seven basic data types – [[#Numbers|integers]], [[#Numbers|real numbers]] (usually called &amp;quot;decimals&amp;quot;), [[#Strings|strings]], [[#Lists|lists]], [[#Maps|maps]], [[#Objects|objects]], and [[#Other Types and Operators|null]].&lt;br /&gt;
&lt;br /&gt;
=== Numbers ===&lt;br /&gt;
&lt;br /&gt;
The most common use of WFL is for simple calculations involving numbers. For this, the standard arithmetic operators (&amp;lt;code&amp;gt;+ - * / %&amp;lt;/code&amp;gt;) work as you would expect, performing addition, subtraction, multiplication, division, and remainder. {{DevFeature1.13|5}} The remainder operator even works on decimal numbers, producing the integer remainder of the division.&lt;br /&gt;
&lt;br /&gt;
The only caveat to watch out for is that &amp;lt;code&amp;gt;/&amp;lt;/code&amp;gt; rounds down when used on integers. For example, &amp;lt;syntaxhighlight lang='wfl' inline&amp;gt;5 / 2&amp;lt;/syntaxhighlight&amp;gt; will evaluate to &amp;lt;code&amp;gt;2&amp;lt;/code&amp;gt;. To avoid this, make sure at least one of the numbers includes a decimal point (or use as_decimal if variables are involved) - &amp;lt;syntaxhighlight lang='wfl' inline&amp;gt;5.0 / 2&amp;lt;/syntaxhighlight&amp;gt; will evaluate to &amp;lt;code&amp;gt;2.5&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Note that WFL supports only three decimal places of precision for decimal numbers; beyond that it will still be rounded down. (So &amp;lt;syntaxhighlight lang='wfl' inline&amp;gt;1.0 / 16&amp;lt;/syntaxhighlight&amp;gt; will evaluate to &amp;lt;code&amp;gt;0.062&amp;lt;/code&amp;gt; instead of &amp;lt;code&amp;gt;0.0625&amp;lt;/code&amp;gt;.) The &amp;lt;code&amp;gt;^&amp;lt;/code&amp;gt; operator performs exponentiation (raising to a power) - for example, &amp;lt;syntaxhighlight lang='wfl' inline&amp;gt;2 ^ 3&amp;lt;/syntaxhighlight&amp;gt; evaluates to &amp;lt;code&amp;gt;8&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can also use the standard comparison operators (&amp;lt;code&amp;gt;= != &amp;lt; &amp;lt;= &amp;gt; &amp;gt;=&amp;lt;/code&amp;gt;) on numbers. This is often useful in unit filters - for example, a formula of &amp;lt;syntaxhighlight lang='wfl' inline&amp;gt;hitpoints &amp;lt; max_hitpoints / 2&amp;lt;/syntaxhighlight&amp;gt; will match only if the unit is at less than half health. Comparison operators return 1 for true and 0 for false; there is no boolean type. Comparing values of different types will always return 0, with one exception – comparing an integer and decimal number will work as expected.&lt;br /&gt;
&lt;br /&gt;
One final numeric operator exists - the dice roll. The syntax &amp;lt;syntaxhighlight lang='wfl' inline&amp;gt;3d12&amp;lt;/syntaxhighlight&amp;gt; will roll three 12-sided dice and return the sum of the results. Note however that this is not multiplayer-safe, so using it can and will produce OOS errors. {{DevFeature1.13|5}} The dice operator is now synced and should be safe for use in multiplayer contexts.&lt;br /&gt;
&lt;br /&gt;
'''Note:''' {{DevFeature1.13|5}} Some numeric operations will return null instead of a number. This usually involves the exponentiation operator - for example, &amp;lt;syntaxhighlight lang='wfl' inline&amp;gt;(-2) ^ 0.5&amp;lt;/syntaxhighlight&amp;gt; attempts to take the square root of -2, which doesn't exist, so it returns null to indicate this. Dividing by zero also returns null, as well as certain [[#Numeric Functions|math functions]] in appropriate circumstances.&lt;br /&gt;
&lt;br /&gt;
=== Strings ===&lt;br /&gt;
&lt;br /&gt;
WFL also supports strings, which must be enclosed in single quotes (&amp;lt;syntaxhighlight lang='wfl' inline&amp;gt;'like this'&amp;lt;/syntaxhighlight&amp;gt;). The comparison operators (&amp;lt;code&amp;gt;= != &amp;lt; &amp;lt;= &amp;gt; &amp;gt;=&amp;lt;/code&amp;gt;) also work on strings, performing lexicographical comparison (ie, alphabetical order). The comparison is case sensitive.&lt;br /&gt;
&lt;br /&gt;
{{DevFeature1.13|5}}&lt;br /&gt;
&lt;br /&gt;
Strings can be concatenated with the concatenation operator &amp;lt;code&amp;gt;..&amp;lt;/code&amp;gt;. They also support interpolations enclosed in square brackets, the contents of which can be any valid formula. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang='wfl'&amp;gt;&lt;br /&gt;
'Some text: [a + b]' where a = 12, b = 10&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
results in the string &amp;lt;code&amp;gt;Some text: 22&amp;lt;/code&amp;gt;. (The &amp;lt;code&amp;gt;where&amp;lt;/code&amp;gt; operator is explained [[#Variables|below]].)&lt;br /&gt;
&lt;br /&gt;
If you need to include a literal square bracket in a string, write &amp;lt;code&amp;gt;[(]&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;[)]&amp;lt;/code&amp;gt;. For a literal single quote, you can write &amp;lt;code&amp;gt;[']&amp;lt;/code&amp;gt;. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang='wfl'&amp;gt;&lt;br /&gt;
'[(]It[']s bracketed![)]'&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
results in the string &amp;lt;code&amp;gt;[It's bracketed!]&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
You can index the characters or words of a string with the following syntax:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang='wfl'&amp;gt;&lt;br /&gt;
'Hello World'.char[4]&lt;br /&gt;
'Hello World'.word[1]&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These return &amp;lt;code&amp;gt;o&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;World&amp;lt;/code&amp;gt;, respectively. A third option is also available, &amp;lt;code&amp;gt;item&amp;lt;/code&amp;gt;, which splits the string on commas but allows parentheses to prevent a portion of the string from being split up. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang='wfl'&amp;gt;&lt;br /&gt;
'First Item,Second Item,Third Item'.item[1]&lt;br /&gt;
'a,b,(c,d,e),f,g'.item[2]&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These return &amp;lt;code&amp;gt;Second Item&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;(c,d,e)&amp;lt;/code&amp;gt;, respectively. When not providing index, list is returned.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang='wfl'&amp;gt;&lt;br /&gt;
'Hello World'.char = ['H', 'e', 'l', 'l', 'o', ' ', 'W', 'o', 'r', 'l', 'd']&lt;br /&gt;
'Hello World'.word = ['Hello', 'World']&lt;br /&gt;
'a,b,(c,d,e),f,g'.item = ['a', 'b', '(c,d,e)', 'f', 'g']&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Lists ===&lt;br /&gt;
&lt;br /&gt;
A list is a sequence of values represented as square brackets, [], surrounding a comma-separated list. For instance:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang='wfl'&amp;gt;&lt;br /&gt;
[ 1, 5, 'abc' ]&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The comparison operators work on lists, performing lexicographical comparison. A specific list index can be obtained with the indexing operator, like this: &amp;lt;syntaxhighlight lang='wfl' inline&amp;gt;my_list[index]&amp;lt;/syntaxhighlight&amp;gt;. The first element of a list is numbered 0.&lt;br /&gt;
&lt;br /&gt;
There are four ''vector operators'' (&amp;lt;code&amp;gt;.+ .- .* ./&amp;lt;/code&amp;gt;) that perform entrywise operations on lists. For example, &amp;lt;syntaxhighlight lang='wfl' inline&amp;gt;[1,2,3] .+ [12,2,8]&amp;lt;/syntaxhighlight&amp;gt; produces &amp;lt;code&amp;gt;[13,4,11]&amp;lt;/code&amp;gt;. Both lists must be of the same length to use these operators, and of course, they must contain only numbers.&lt;br /&gt;
&lt;br /&gt;
{{DevFeature1.13|5}}&lt;br /&gt;
&lt;br /&gt;
A negative list index now counts from the end of the list - &amp;lt;code&amp;gt;-1&amp;lt;/code&amp;gt; refers to the last element. You can check if an element exists in a list using the &amp;lt;code&amp;gt;in&amp;lt;/code&amp;gt; operator. Lists can also be joined with the concatenation operator &amp;lt;code&amp;gt;..&amp;lt;/code&amp;gt;, and sliced using the range operator &amp;lt;code&amp;gt;~&amp;lt;/code&amp;gt;. In fact, the range operator produces a list of consecutive numbers, and in fact any list of numbers can be used to index a list - the result is to take the elements at the requested indices, in order. Some examples:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang='wfl'&amp;gt;&lt;br /&gt;
[1, 7, 'abc', 2.5, 'foobar', 127][1~3]&lt;br /&gt;
(10~20)[[0,-1]]&lt;br /&gt;
[1, 7, 'abc', 2.5, 'foobar', 127][[2,4]]&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These result in the following lists:&lt;br /&gt;
&lt;br /&gt;
 [7, 'abc', 2.5]&lt;br /&gt;
 [10,20]&lt;br /&gt;
 ['abc', 'foobar']&lt;br /&gt;
&lt;br /&gt;
=== Maps ===&lt;br /&gt;
&lt;br /&gt;
A map is a sequence of key-value pairs. For example: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang='wfl'&amp;gt;&lt;br /&gt;
[12 -&amp;gt; 'Hello', [1,2] -&amp;gt; 9, 'abc' -&amp;gt; 1.5]&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The comparison operators work on maps. A specific element of a map can be obtained with the indexing operation. In the above example, the following conditions are all true (assuming the map is in a variable called &amp;lt;code&amp;gt;self&amp;lt;/code&amp;gt;):&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;syntaxhighlight lang='wfl' inline&amp;gt;self[12] = 'Hello'&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
* &amp;lt;syntaxhighlight lang='wfl' inline&amp;gt;self[[1,2]] = 9&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
* &amp;lt;syntaxhighlight lang='wfl' inline&amp;gt;self['abc'] = 1.5&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{DevFeature1.13|5}}&lt;br /&gt;
&lt;br /&gt;
You can now use the &amp;lt;code&amp;gt;in&amp;lt;/code&amp;gt; operator to test if a key exists in the map. You can also access string keys using the dot operator &amp;lt;code&amp;gt;.&amp;lt;/code&amp;gt; as long as they are valid identifiers. (Valid identifiers contain letters and underscores only; no digits are permitted.)&lt;br /&gt;
&lt;br /&gt;
Note that the selection indexing that lists use is ''not'' valid for maps - a list can be used as a key, after all.&lt;br /&gt;
&lt;br /&gt;
=== Objects ===&lt;br /&gt;
&lt;br /&gt;
An object is a container containing additional variables (see [[#Variables|below]] for further explanation of variables) which are not in the global scope. The ''dot operator'' can be used to evaluate a formula in the object's scope. For example, suppose ''u'' is a unit object referring to your leader, who is an Elvish Ranger who has taken 12 damage (thus has 30 hit points). Then &amp;lt;syntaxhighlight lang='wfl' inline&amp;gt;u.hitpoints&amp;lt;/syntaxhighlight&amp;gt; will evaluate to the number 30. For a more advanced example, &amp;lt;syntaxhighlight lang='wfl' inline&amp;gt;u . (hitpoints &amp;lt; max_hitpoints - 10)&amp;lt;/syntaxhighlight&amp;gt; will evaluate to true if the unit has taken more than 10 damage, which in this example, it has. (This could also be written &amp;lt;syntaxhighlight lang='wfl' inline&amp;gt;u.hitpoints &amp;lt; u.max_hitpoints - 10&amp;lt;/syntaxhighlight&amp;gt; if you prefer; this enters the scope twice, instead of once, but the result is identical.)&lt;br /&gt;
&lt;br /&gt;
Objects generally cannot be created directly by the code - they are created for you by the game when formulas are called in certain contexts. However, there are two types of object that ''can'' be created by your code. The first is the location object, which has variables ''x'' and ''y''; it can be created by the [[#loc|&amp;lt;code&amp;gt;loc()&amp;lt;/code&amp;gt;]] function. The second is the map pair object, which is returned (or used internally) by several of the built-in functions and has variables ''key'' and ''value''.&lt;br /&gt;
&lt;br /&gt;
==== Documentation of some common objects ====&lt;br /&gt;
&lt;br /&gt;
There are a number of common objects that are given as the context object for formulas throughout the engine. Not all of these will be available in all formulas, but many of them are available in more than one formula. To learn what objects are available in a given location, see the WML documentation of that location.&lt;br /&gt;
&lt;br /&gt;
* [[StandardUnitFilter#Wesnoth_Formula_Language|unit objects]]&lt;br /&gt;
* [[FilterWML#Filtering_Weapons|weapon objects]]&lt;br /&gt;
* [[StandardLocationFilter#Wesnoth_Formula_Language|terrain objects]]&lt;br /&gt;
* [[StandardSideFilter#Wesnoth_Formula_Language|side objects]]&lt;br /&gt;
* [[ImagePathFunctions#CHAN:_General function|pixel objects]]&lt;br /&gt;
* [[ConditionalActionsWML#.5Bvariable.5D|WML objects]]&lt;br /&gt;
* [[EventWML#filter_formula|game state objects]]&lt;br /&gt;
&lt;br /&gt;
=== Other Types and Operators ===&lt;br /&gt;
&lt;br /&gt;
There is one other basic type in WFL - the null type, which is used to mean &amp;quot;no value&amp;quot;. It will be returned if you attempt to perform an invalid operation, such as dividing a string. It is also returned by the built-in &amp;lt;code&amp;gt;null()&amp;lt;/code&amp;gt; function, which allows you to test if a value is null by writing &amp;lt;syntaxhighlight lang='wfl' inline&amp;gt;value = null()&amp;lt;/syntaxhighlight&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The logical operators &amp;lt;code&amp;gt;and&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;or&amp;lt;/code&amp;gt; can be used to connect conditional expressions, and the unary operator &amp;lt;code&amp;gt;not&amp;lt;/code&amp;gt; negates them. Note that &amp;lt;code&amp;gt;or&amp;lt;/code&amp;gt; is inclusive - &amp;lt;syntaxhighlight lang='wfl' inline&amp;gt;A or B&amp;lt;/syntaxhighlight&amp;gt; is false only if both ''A'' and ''B'' are false. These operators consider &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt; or null to be false, while all other values count as true. The [[#if|&amp;lt;code&amp;gt;if()&amp;lt;/code&amp;gt;]] function also follows the same rules to determine whether a value is true or false.&lt;br /&gt;
&lt;br /&gt;
'''Note:''' Programmers familiar with other languages may occasionally be surprised by the fact that &amp;lt;code&amp;gt;and&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;or&amp;lt;/code&amp;gt; do not short-circuit (which would mean that they will never evaluate their second argument if they can know their result solely from the first argument). This should not be a problem in general formula usage, since functions do not have side-effects, but it could make a difference when using the debug functions.&lt;br /&gt;
&lt;br /&gt;
=== Operator Precedence ===&lt;br /&gt;
&lt;br /&gt;
The precedence of various operators is, more or less, what you'd expect - you can write something like &amp;lt;syntaxhighlight lang='wfl' inline&amp;gt;a + b * 2 &amp;lt;= 5 and n - m / 4 &amp;gt; 7&amp;lt;/syntaxhighlight&amp;gt; and the engine will do what you expect - first multiplication and division, then addition and subtraction, then comparison, and finally logical conjunction. The only thing to watch out for is when chaining exponentiation - all operators are left associative, so &amp;lt;syntaxhighlight lang='wfl' inline&amp;gt;a ^ b ^ c&amp;lt;/syntaxhighlight&amp;gt; will be evaluated as &amp;lt;syntaxhighlight lang='wfl' inline&amp;gt;(a ^ b) ^ c&amp;lt;/syntaxhighlight&amp;gt; instead of &amp;lt;syntaxhighlight lang='wfl' inline&amp;gt;a ^ (b ^ c)&amp;lt;/syntaxhighlight&amp;gt; like you would expect. {{DevFeature1.13|5}} This has been fixed - exponentiation is now right-associative.&lt;br /&gt;
&lt;br /&gt;
The full precedence list is as follows, from lowest to highest; operators on the same line have equal precedence.&lt;br /&gt;
&lt;br /&gt;
# &amp;lt;code&amp;gt;not&amp;lt;/code&amp;gt;&lt;br /&gt;
# &amp;lt;code&amp;gt;where&amp;lt;/code&amp;gt; clauses&lt;br /&gt;
# &amp;lt;code&amp;gt;or&amp;lt;/code&amp;gt;&lt;br /&gt;
# &amp;lt;code&amp;gt;and&amp;lt;/code&amp;gt;&lt;br /&gt;
# Comparison operators &amp;lt;code&amp;gt;= != &amp;lt; &amp;lt;= &amp;gt; &amp;gt;= in&amp;lt;/code&amp;gt;&lt;br /&gt;
# Range-generating operator &amp;lt;code&amp;gt;~&amp;lt;/code&amp;gt;&lt;br /&gt;
# Additive operators &amp;lt;code&amp;gt;+ - ..&amp;lt;/code&amp;gt;&lt;br /&gt;
# Multiplicative operators &amp;lt;code&amp;gt;* /&amp;lt;/code&amp;gt;&lt;br /&gt;
# Modulus &amp;lt;code&amp;gt;%&amp;lt;/code&amp;gt;&lt;br /&gt;
# Exponentiation &amp;lt;code&amp;gt;^&amp;lt;/code&amp;gt;&lt;br /&gt;
# Dice operator &amp;lt;code&amp;gt;d&amp;lt;/code&amp;gt;&lt;br /&gt;
# Dot operator &amp;lt;code&amp;gt;.&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Functions ==&lt;br /&gt;
&lt;br /&gt;
WFL is a ''functional'' language, so of course it has functions. There is a large library of [[#Core Functions|built-in functions]], and you can also [[#Defining Functions|define your own]].&lt;br /&gt;
&lt;br /&gt;
Calling a function is simple, and works exactly how you would expect if you've worked with functions in a mathematical context: &amp;lt;syntaxhighlight lang=wfl inline&amp;gt;clamp(value, 0, 21)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Being a functional language, WFL does not have conditional or looping statements. Instead, these are provided by functions. For a simple conditional, you can use the &amp;lt;tt&amp;gt;if&amp;lt;/tt&amp;gt; function, as in the following example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=wfl&amp;gt;&lt;br /&gt;
if(hitpoints &amp;gt; 37,&lt;br /&gt;
    max_hitpoints / 2,&lt;br /&gt;
    hitpoints - 3&lt;br /&gt;
)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Similarly, looping is done via functions. There are several built-in higher-order functions that can be used to iterate over lists and maps, such as &amp;lt;tt&amp;gt;filter&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;choose&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;map&amp;lt;/tt&amp;gt;, and &amp;lt;tt&amp;gt;reduce&amp;lt;/tt&amp;gt;. See the corresponding function definitions for more information.&lt;br /&gt;
&lt;br /&gt;
== Variables ==&lt;br /&gt;
&lt;br /&gt;
Formulas may have a variety of variables, depending on the context in which they are evaluated. A string substitution formula like &amp;lt;code&amp;gt;$(3 + 5)&amp;lt;/code&amp;gt; has no variables, but a [[StandardUnitFilter|unit filter]] formula has variables such as &amp;lt;code&amp;gt;hitpoints&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;max_hitpoints&amp;lt;/code&amp;gt; which contain various properties of the unit being tested (the same unit which is also referred to in variable substitution as &amp;lt;code&amp;gt;$this_unit&amp;lt;/code&amp;gt;). The special variable &amp;lt;code&amp;gt;self&amp;lt;/code&amp;gt; typically refers to the &amp;quot;global context&amp;quot; - in the case of a unit filter formula, the unit itself. This means for example that &amp;lt;code&amp;gt;self.hitpoints&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;hitpoints&amp;lt;/code&amp;gt; are equivalent when used in a unit filter formula. In a string substitution formula (the &amp;lt;code&amp;gt;$(formula)&amp;lt;/code&amp;gt; syntax), &amp;lt;code&amp;gt;self&amp;lt;/code&amp;gt; is null. Because of this, you should prefer not to use the substitution syntax in places where formulas are specifically supported.&lt;br /&gt;
&lt;br /&gt;
A formula may declare additional variables using a &amp;lt;code&amp;gt;where&amp;lt;/code&amp;gt; clause. This assigns a meaning to any unknown variables in the preceding formula. The general syntax is:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;formula&amp;gt; where &amp;lt;variable&amp;gt; = &amp;lt;value&amp;gt; [, &amp;lt;variable&amp;gt; = value ...]&lt;br /&gt;
&lt;br /&gt;
This functions similarly to an operator, so if desired, you could have multiple where clauses in a single formula. Note that all variables in WFL are read-only - they are variables because they may have different values depending on the context in which the formula is evaluated, but for a given context, they are constant. A variable that has not been assigned a value is considered to have a value of null. Variables are lazily-evaluated - if a where clause declares a variable that is never used, the expression assigned to it will never be evaluated. (This only really matters if it contains a call to a debug function.)&lt;br /&gt;
&lt;br /&gt;
Variable names can contain letters and underscores only. In particular, they cannot contain digits. Also, names are case-sensitive, so ''y'' and ''Y'' refer to two different variables. The following names are reserved and cannot be used for the name of a variable or function:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;tt&amp;gt;d&amp;lt;/tt&amp;gt; - dice operator&lt;br /&gt;
* &amp;lt;tt&amp;gt;or&amp;lt;/tt&amp;gt; - logical operator&lt;br /&gt;
* &amp;lt;tt&amp;gt;in&amp;lt;/tt&amp;gt; - containment operator&lt;br /&gt;
* &amp;lt;tt&amp;gt;def&amp;lt;/tt&amp;gt; - defines a function&lt;br /&gt;
* &amp;lt;tt&amp;gt;and&amp;lt;/tt&amp;gt; - logical operator&lt;br /&gt;
* &amp;lt;tt&amp;gt;not&amp;lt;/tt&amp;gt; - logical operator&lt;br /&gt;
* &amp;lt;tt&amp;gt;fai&amp;lt;/tt&amp;gt; - deprecated synonym of &amp;lt;tt&amp;gt;wfl&amp;lt;/tt&amp;gt;&lt;br /&gt;
* &amp;lt;tt&amp;gt;wfl&amp;lt;/tt&amp;gt; - declares filename&lt;br /&gt;
* &amp;lt;tt&amp;gt;where&amp;lt;/tt&amp;gt; - declares variables&lt;br /&gt;
* &amp;lt;tt&amp;gt;faiend&amp;lt;/tt&amp;gt; - deprecated synonym of &amp;lt;tt&amp;gt;wflend&amp;lt;/tt&amp;gt;&lt;br /&gt;
* &amp;lt;tt&amp;gt;wflend&amp;lt;/tt&amp;gt; - closes file scope&lt;br /&gt;
* &amp;lt;tt&amp;gt;functions&amp;lt;/tt&amp;gt; - lists all defined functions&lt;br /&gt;
&lt;br /&gt;
== Comments ==&lt;br /&gt;
&lt;br /&gt;
Sometimes with particularly complicated formulas, it may be useful to document what's going on inline. Of course, you can use WML comments to do this, but in some cases it may be useful to put some comments in the middle of the formula. This is easily done - simply enclose them in &amp;lt;code&amp;gt;#&amp;lt;/code&amp;gt; characters, like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang='wfl'&amp;gt;&lt;br /&gt;
#This is a Wesnoth Formula Language comment.#&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note the final &amp;lt;code&amp;gt;#&amp;lt;/code&amp;gt; - unlike WML, WFL requires this to indicate where the comment ends.&lt;br /&gt;
&lt;br /&gt;
== Defining Functions ==&lt;br /&gt;
&lt;br /&gt;
There are several predefined functions in the Wesnoth Formula Language, and if these are not enough, it is possible to define your own functions. The special variable &amp;lt;syntaxhighlight lang='wfl' inline&amp;gt;functions&amp;lt;/syntaxhighlight&amp;gt; always evaluates to a list of all known function names. This is mainly useful only as a debugging tool, though.&lt;br /&gt;
&lt;br /&gt;
To define a function, you use the &amp;lt;code&amp;gt;def&amp;lt;/code&amp;gt; keyword. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang='wfl'&amp;gt;&lt;br /&gt;
def sgn(x) if(x &amp;lt; 0, -1, x &amp;gt; 0, 1, 0);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This defines a function called &amp;lt;code&amp;gt;sgn&amp;lt;/code&amp;gt; which returns the sign of the input number. The semicolon marks the end of the function. It's optional if there's nothing else following the function, but in practice this will very rarely be the case.&lt;br /&gt;
&lt;br /&gt;
Function names have the same limitation as variable names – they can contain only letters and underscores, and cannot contain digits.&lt;br /&gt;
&lt;br /&gt;
You can select one of the function's arguments to be the &amp;quot;default&amp;quot; argument. If an object is passed to the default argument, then any attributes of that object are directly accessible in the global scope. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang='wfl'&amp;gt;&lt;br /&gt;
def is_badly_wounded(u*) hitpoints &amp;lt; max_hitpoints / 2;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This function takes a unit and returns 1 if it is at less than half hitpoints. The &amp;lt;code&amp;gt;*&amp;lt;/code&amp;gt; indicates the default argument, without which it would instead have to be defined like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang='wfl'&amp;gt;&lt;br /&gt;
def is_badly_wounded(u) u.hitpoints &amp;lt; u.max_hitpoints / 2;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It's important to remember that the function body has access to no variables other than its parameters. For example, the following function would not work (in an AI context) even though the my_leader variable is defined:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang='wfl'&amp;gt;&lt;br /&gt;
def endangers_leader(u) distance_between(u.loc, my_leader.loc) &amp;lt; u.moves;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is because the body of the function can't see the my_leader variable. To make this work, you would need to pass in my_leader as an additional parameter.&lt;br /&gt;
&lt;br /&gt;
'''Note: Prior to 1.14, function definitions only work in AI code and GUI2 code.'''&lt;br /&gt;
&lt;br /&gt;
== Where to Use Formulas ==&lt;br /&gt;
&lt;br /&gt;
Formulas can only be used in specific attributes in WML. The documentation of a WML tag will note which keys can have a formula placed in them. Some common examples include [[FilterWML|filters]], [[GUIToolkit|GUI2 dialogs]], and [[AbilitiesWML|unit abilities]]. Another example is the [[VariablesWML#Variable_Substitution|&amp;lt;code&amp;gt;$(formula)&amp;lt;/code&amp;gt; substitution]] syntax, which allows the use of formulas wherever variables are parsed.&lt;br /&gt;
&lt;br /&gt;
When using a formula in WML (other than in a substitution, which is usually part of a longer already-quoted passage), it is highly recommended to place double quotes around the formula, to avoid ambiguity between the WML and WFL parsers. The double angle quotes are also acceptable for this purpose. If you don't quote your formulas, there are two issues you could run into:&lt;br /&gt;
&lt;br /&gt;
# WML uses the &amp;lt;code&amp;gt;+&amp;lt;/code&amp;gt; operator to represent concatenation of strings, as well as line continuation. Because of this, an unquoted &amp;lt;code&amp;gt;+&amp;lt;/code&amp;gt; will be ''removed'', likely causing the WFL formula to fail to compile.&lt;br /&gt;
# Unquoted WML text has the whitespace collapsed. If using WFL strings where whitespace is significant, this can result in surprises. For example, the formula &amp;lt;syntaxhighlight lang=wfl inline&amp;gt;length('One    Two    Three')&amp;lt;/syntaxhighlight&amp;gt; would return 13 instead of the expected 19 if double quotes are not placed around the formula.&lt;br /&gt;
&lt;br /&gt;
Some attributes in WML ''require'' a formula, which means that anything placed in the attribute will always be considered to be a formula. In this case, the formula doesn't need to be enclosed in parentheses – just the double quotes will suffice. However, there are also attributes that take an ''optional'' formula. These are most common in GUI2, but are also found in other places. In such attributes, the formula ''must'' be enclosed in parentheses. Failure to do so will result in it being parsed as just a straight value. As a general guideline, if the attribute key contains the word &amp;quot;formula&amp;quot;, it is usually required to be a formula, whereas attributes with optional formulas do ''not'' contain the word &amp;quot;formula&amp;quot; in the key.&lt;br /&gt;
&lt;br /&gt;
'''Note''': Do ''not'' use a &amp;lt;code&amp;gt;$&amp;lt;/code&amp;gt; to introduce a formula. The &amp;lt;code&amp;gt;$&amp;lt;/code&amp;gt; is not part of WFL syntax. It introduces a ''substitution'', a concept which is covered in more detail at [[VariablesWML#Variable Substitution]]. Although WFL can be used ''inside'' a substitution, a substitution itself is not WFL, and you should ''never'' use a &amp;lt;code&amp;gt;$&amp;lt;/code&amp;gt; in WFL. However, in practice, substitutions and WFL are often used together – as substitution is processed first, you may see WFL formulas that appear to contain a &amp;lt;code&amp;gt;$&amp;lt;/code&amp;gt; inside them. This is ''not'' part of the WFL – it is more like a macro substitution to be carried out before the formula runs. So, of course, it will only work in places that support ''both'' WFL and substitution.&lt;br /&gt;
&lt;br /&gt;
== Files ==&lt;br /&gt;
&lt;br /&gt;
{{DevFeature1.13|5}}&lt;br /&gt;
&lt;br /&gt;
On occasion, you may find yourself working with formulas complex enough to split them out into a separate file. The formula engine normally assumes that it is executing inline code and reports errors accordingly, but you can tell it to enter a file scope using the special &amp;lt;code&amp;gt;wfl&amp;lt;/code&amp;gt; keyword. The convention is to frame your code, so that any file looks like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang='wfl'&amp;gt;&lt;br /&gt;
wfl 'filename.wfl'&lt;br /&gt;
&lt;br /&gt;
# Put whatever code you need here, possibly including function definitions. #&lt;br /&gt;
&lt;br /&gt;
wflend&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The matching &amp;lt;code&amp;gt;wflend&amp;lt;/code&amp;gt; is required.&lt;br /&gt;
&lt;br /&gt;
'''Note:''' This functionality was available prior to 1.13.5 using keywords &amp;lt;code&amp;gt;fai&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;faiend&amp;lt;/code&amp;gt;. These keywords are now deprecated, but still work.&lt;br /&gt;
&lt;br /&gt;
These directives have no effect on the formula code itself. They only change how error messages are reported if something goes wrong. Files using these directives are usually included using the WML preprocessor, though they could also be loaded in Lua with [[LuaAPI/filesystem#filesystem.read_file|filesystem.read_file]].&lt;br /&gt;
&lt;br /&gt;
== Core Functions ==&lt;br /&gt;
&lt;br /&gt;
Many of the core functions exhibit two features that (as of 1.13.4) cannot be used in user-defined functions. The first is the ability to accept a varying number of arguments - some core functions accept any number of arguments, while others have a few optional arguments. The second is that arguments are lazily-evaluated, and in some cases some arguments will not be evaluated at all, while others may be evaluated multiple times with different variable values. The description of each function will explain how and when its arguments are evaluated.&lt;br /&gt;
&lt;br /&gt;
Most of the core functions can be used from any formula. However, there are some that are only available in formulas that have access to the game state. The following formulas have access to the game state and can use those functions:&lt;br /&gt;
&lt;br /&gt;
* Formulas used in [[FilterWML]]&lt;br /&gt;
* Formulas used in [[AbilitiesWML]]&lt;br /&gt;
* &amp;lt;tt&amp;gt;filter_formula&amp;lt;/tt&amp;gt; in [[EventWML#filter_formula|EventWML]]&lt;br /&gt;
* Formulas evaluated from the formula console (accessed by pressing F)&lt;br /&gt;
&lt;br /&gt;
The following formulas do not have access to the game state and cannot use those functions:&lt;br /&gt;
&lt;br /&gt;
* Formulas used in [[GUI2]]&lt;br /&gt;
* [[SyntaxWML#formula_substitution|Substitution]] formulas using &amp;lt;tt&amp;gt;$(...)&amp;lt;/tt&amp;gt;&lt;br /&gt;
* [[ImagePathFunctions#CHAN: General function|IPF]] formulas used in &amp;lt;tt&amp;gt;~CHAN()&amp;lt;/tt&amp;gt; or &amp;lt;tt&amp;gt;~ALPHA()&amp;lt;/tt&amp;gt;&lt;br /&gt;
* Formulas compiled from [[LuaAPI/wesnoth#wesnoth.compile_formula|Lua]]&lt;br /&gt;
&lt;br /&gt;
=== Conditional Functions ===&lt;br /&gt;
&lt;br /&gt;
There are two functions which return one of their input values based on some condition - the &amp;lt;code&amp;gt;if&amp;lt;/code&amp;gt; function, and the &amp;lt;code&amp;gt;switch&amp;lt;/code&amp;gt; function. Both evaluate only as many parameters as is needed to determine which value to return. In particular, parameters that are neither returned nor part of the condition will never be evaluated.&lt;br /&gt;
&lt;br /&gt;
==== if ====&lt;br /&gt;
&lt;br /&gt;
* if(''condition'', ''if true'' [, ''condition 2'', ''if true 2'', ...] [, ''otherwise''])&lt;br /&gt;
&lt;br /&gt;
This function first evaluates the ''condition'', which is a formula. If it evaluates to true, then the function evaluates and returns the ''if true'' parameter; otherwise, it tries the next condition (if any) with the same result. If none of the conditions evaluate to true, then it returns the ''otherwise'' parameter if present, or &amp;lt;code&amp;gt;null()&amp;lt;/code&amp;gt; otherwise.&lt;br /&gt;
&lt;br /&gt;
For instance, an AI that recruits Wolf Riders on the first turn, and Orcish Grunts thereafter might look like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang='wfl'&amp;gt;&lt;br /&gt;
if(turn = 1, recruit('Wolf Rider'), recruit('Orcish Grunt'))&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== switch ====&lt;br /&gt;
&lt;br /&gt;
* switch(''formula'', ''value 1'', ''outcome 1'' [, ... , ''value N'', ''outcome N''] [, ''default outcome''])&lt;br /&gt;
&lt;br /&gt;
The switch function first evaluates the input ''formula'', and then checks if it is equal to any of the specified ''values''. If matching value is found, the ''outcome'' assigned to it is returned; if not, then function returns either ''default outcome'' (if specified) or null.&lt;br /&gt;
&lt;br /&gt;
=== Numeric Functions ===&lt;br /&gt;
&lt;br /&gt;
Several basic math functions are available. These generally work equally on integer and decimal values.&lt;br /&gt;
&lt;br /&gt;
==== abs ====&lt;br /&gt;
&lt;br /&gt;
* abs(''number'')&lt;br /&gt;
&lt;br /&gt;
Returns the absolute value of an input number; for example&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang='wfl'&amp;gt;&lt;br /&gt;
abs( -5 )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
will return 5.&lt;br /&gt;
&lt;br /&gt;
{{DevFeature1.13|5}} This now works on decimals as well as integers.&lt;br /&gt;
&lt;br /&gt;
==== acos ====&lt;br /&gt;
&lt;br /&gt;
{{DevFeature1.13|5}}&lt;br /&gt;
&lt;br /&gt;
* acos(''number'')&lt;br /&gt;
&lt;br /&gt;
Returns the arccosine of the input number, in degrees.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== asin ====&lt;br /&gt;
&lt;br /&gt;
{{DevFeature1.13|5}}&lt;br /&gt;
&lt;br /&gt;
* asin(''number'')&lt;br /&gt;
&lt;br /&gt;
Returns the arcsine of the input number, in degrees.&lt;br /&gt;
&lt;br /&gt;
==== atan ====&lt;br /&gt;
&lt;br /&gt;
{{DevFeature1.13|5}}&lt;br /&gt;
&lt;br /&gt;
* atan(''number'')&lt;br /&gt;
&lt;br /&gt;
Returns the arctangent of the input number, in degrees.&lt;br /&gt;
==== as_decimal ====&lt;br /&gt;
&lt;br /&gt;
* as_decimal(''number'')&lt;br /&gt;
&lt;br /&gt;
Ensures that the number is a decimal rather than an integer; useful if you're dividing two unknown values and want to ensure that the result is a decimal.&lt;br /&gt;
&lt;br /&gt;
==== cbrt ====&lt;br /&gt;
&lt;br /&gt;
{{DevFeature1.13|5}}&lt;br /&gt;
&lt;br /&gt;
* cbrt(''number'')&lt;br /&gt;
&lt;br /&gt;
Returns the cube root of the input number. This is better than using the exponentiation operator, because it will give the correct result for negative numbers.&lt;br /&gt;
&lt;br /&gt;
==== ceil ====&lt;br /&gt;
&lt;br /&gt;
* ceil(''number'')&lt;br /&gt;
&lt;br /&gt;
Returns the ceiling of the specified number, ie rounding it up to the nearest integer.&lt;br /&gt;
&lt;br /&gt;
==== clamp ====&lt;br /&gt;
&lt;br /&gt;
{{DevFeature1.17|0}}&lt;br /&gt;
&lt;br /&gt;
* clamp(''number'', ''min'', ''max'')&lt;br /&gt;
&lt;br /&gt;
Combines min and max into a single call. If ''number'' is less than ''min'', returns ''min''; if it's greater than ''max'', returns ''max''. Otherwise, returns ''number''.&lt;br /&gt;
&lt;br /&gt;
==== cos ====&lt;br /&gt;
&lt;br /&gt;
* cos(''angle'')&lt;br /&gt;
&lt;br /&gt;
Returns the cosine of the given angle, which is specified in degrees.&lt;br /&gt;
&lt;br /&gt;
==== exp ====&lt;br /&gt;
&lt;br /&gt;
{{DevFeature1.13|5}}&lt;br /&gt;
&lt;br /&gt;
* exp(''number'')&lt;br /&gt;
&lt;br /&gt;
Returns the exponential of the input number, which is the constant ''e'' raised to the specified power.&lt;br /&gt;
&lt;br /&gt;
==== floor ====&lt;br /&gt;
&lt;br /&gt;
* floor(''number'')&lt;br /&gt;
&lt;br /&gt;
Returns the floor of the specified number, ie rounding it down to the nearest integer.&lt;br /&gt;
&lt;br /&gt;
==== frac ====&lt;br /&gt;
&lt;br /&gt;
{{DevFeature1.13|5}}&lt;br /&gt;
&lt;br /&gt;
* frac(''number'')&lt;br /&gt;
&lt;br /&gt;
Returns the fractional part of the specified number.&lt;br /&gt;
&lt;br /&gt;
==== hypot ====&lt;br /&gt;
&lt;br /&gt;
{{DevFeature1.13|5}}&lt;br /&gt;
&lt;br /&gt;
* hypot(''x'', ''y'')&lt;br /&gt;
&lt;br /&gt;
Returns the hypoteneuse length of a triangle with sides ''x'' and ''y''.&lt;br /&gt;
&lt;br /&gt;
==== lerp ====&lt;br /&gt;
&lt;br /&gt;
{{DevFeature1.17|0}}&lt;br /&gt;
&lt;br /&gt;
* lerp(''min'', ''max'', ''fraction'')&lt;br /&gt;
&lt;br /&gt;
Returns a linear interpolation between ''min'' and ''max'' according to the specified ''fraction''.&lt;br /&gt;
&lt;br /&gt;
==== lerp_index ====&lt;br /&gt;
&lt;br /&gt;
{{DevFeature1.19|4}}&lt;br /&gt;
&lt;br /&gt;
* lerp_index(''list'', ''ratio'')&lt;br /&gt;
&lt;br /&gt;
Returns the element of the list that is closest to being at the specified ratio of the list's length.&lt;br /&gt;
&lt;br /&gt;
'''Example''': &amp;lt;syntaxhighlight lang=wfl inline&amp;gt;lerp_index([1, 12, 32, 10], 0.26])&amp;lt;/syntaxhighlight&amp;gt; returns 12.&lt;br /&gt;
&lt;br /&gt;
==== log ====&lt;br /&gt;
&lt;br /&gt;
{{DevFeature1.13|5}}&lt;br /&gt;
&lt;br /&gt;
* log(''number'', [, ''base''])&lt;br /&gt;
&lt;br /&gt;
Returns the logarithm of the input number. If ''base'' is omitted, it returns the natural logarithm; otherwise, the logarithm to the specified base.&lt;br /&gt;
&lt;br /&gt;
==== max ====&lt;br /&gt;
&lt;br /&gt;
* max(''list of numbers'')&lt;br /&gt;
&lt;br /&gt;
Returns the largest number from the list. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang='wfl'&amp;gt;&lt;br /&gt;
max([2, 8, -10, 3])&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
will return &amp;lt;code&amp;gt;8&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
{{DevFeature1.13|5}} This now works on decimals as well as integers.&lt;br /&gt;
&lt;br /&gt;
==== min ====&lt;br /&gt;
&lt;br /&gt;
* min(''list of numbers'')&lt;br /&gt;
&lt;br /&gt;
Returns the smallest number from the list. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang='wfl'&amp;gt;&lt;br /&gt;
min( [ 3, 7, -2, 6] )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
will return &amp;lt;code&amp;gt;-2&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
{{DevFeature1.13|5}} This now works on decimals as well as integers.&lt;br /&gt;
&lt;br /&gt;
==== pi ====&lt;br /&gt;
&lt;br /&gt;
{{DevFeature1.13|5}}&lt;br /&gt;
&lt;br /&gt;
* pi()&lt;br /&gt;
&lt;br /&gt;
Returns pi.&lt;br /&gt;
&lt;br /&gt;
==== root ====&lt;br /&gt;
&lt;br /&gt;
{{DevFeature1.13|5}}&lt;br /&gt;
&lt;br /&gt;
* root(''number'', ''base'')&lt;br /&gt;
&lt;br /&gt;
Returns the root of the input number, to the specified base. This is better than using the exponentiation operator, because it will give the correct result for negative numbers and odd bases (for example, the fifth root of -32, which is -2).&lt;br /&gt;
&lt;br /&gt;
==== round ====&lt;br /&gt;
&lt;br /&gt;
* round(''number'')&lt;br /&gt;
&lt;br /&gt;
Returns the specified number rounded to the nearest integer.&lt;br /&gt;
&lt;br /&gt;
==== sgn ====&lt;br /&gt;
&lt;br /&gt;
{{DevFeature1.13|5}}&lt;br /&gt;
&lt;br /&gt;
* sgn(''number'')&lt;br /&gt;
&lt;br /&gt;
Returns the sign of the number, ie -1 if it is negative, 1 if it is positive, and 0 if it is zero.&lt;br /&gt;
&lt;br /&gt;
==== sin ====&lt;br /&gt;
&lt;br /&gt;
* sin(''angle'')&lt;br /&gt;
&lt;br /&gt;
Returns the sine of the given angle, which is specified in degrees.&lt;br /&gt;
&lt;br /&gt;
==== sqrt ====&lt;br /&gt;
&lt;br /&gt;
{{DevFeature1.13|5}}&lt;br /&gt;
&lt;br /&gt;
* sqrt(''number'')&lt;br /&gt;
&lt;br /&gt;
Returns the square root of the input number.&lt;br /&gt;
&lt;br /&gt;
==== sum ====&lt;br /&gt;
&lt;br /&gt;
* sum(''list of numbers'')&lt;br /&gt;
&lt;br /&gt;
This function evaluates to the sum of the numbers in the ''list of numbers''. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang='wfl'&amp;gt;&lt;br /&gt;
sum([ 2, 5, 8])&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
returns &amp;lt;code&amp;gt;15&amp;lt;/code&amp;gt;, and:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang='wfl'&amp;gt;&lt;br /&gt;
sum(map(my_units, max_hitpoints - hitpoints))&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
finds the total damage your units have taken.&lt;br /&gt;
&lt;br /&gt;
==== tan ====&lt;br /&gt;
&lt;br /&gt;
{{DevFeature1.13|5}}&lt;br /&gt;
&lt;br /&gt;
* tan(''number'')&lt;br /&gt;
&lt;br /&gt;
Returns the tangent of the given angle, which is specified in degrees.&lt;br /&gt;
&lt;br /&gt;
==== trunc ====&lt;br /&gt;
&lt;br /&gt;
{{DevFeature1.13|5}}&lt;br /&gt;
&lt;br /&gt;
* trunc(''number'')&lt;br /&gt;
&lt;br /&gt;
Returns the truncation of the specified number, ie rounding it towards zero. This is different from floor when applied to negative numbers - floor(-7.5) gives -8, but trunc(-7.5) gives -7.&lt;br /&gt;
&lt;br /&gt;
==== wave ====&lt;br /&gt;
&lt;br /&gt;
* wave(''number'')&lt;br /&gt;
&lt;br /&gt;
Given a numeric value V, this returns:&lt;br /&gt;
&lt;br /&gt;
  sin(2*pi*V)&lt;br /&gt;
&lt;br /&gt;
=== String Functions ===&lt;br /&gt;
&lt;br /&gt;
There are a few useful functions for manipulating strings.&lt;br /&gt;
&lt;br /&gt;
==== concatenate ====&lt;br /&gt;
&lt;br /&gt;
* concatenate(''value1''[, ''value2'', ...])&lt;br /&gt;
&lt;br /&gt;
Converts each of its arguments to a string, and concatenates the result together into a single string.&lt;br /&gt;
&lt;br /&gt;
==== contains_string ====&lt;br /&gt;
&lt;br /&gt;
* contains_string(''string'', ''search_string'')&lt;br /&gt;
&lt;br /&gt;
Returns 1 if ''search_string'' can be found within ''string'' (as a substring), 0 otherwise. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang='wfl'&amp;gt;&lt;br /&gt;
contains_string( 'Testing', 'ing' )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
returns &amp;lt;code&amp;gt;1&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==== length ====&lt;br /&gt;
&lt;br /&gt;
* length(''string'')&lt;br /&gt;
&lt;br /&gt;
Returns the length of the input string.&lt;br /&gt;
&lt;br /&gt;
==== ends_with ====&lt;br /&gt;
&lt;br /&gt;
{{DevFeature1.19|4}}&lt;br /&gt;
&lt;br /&gt;
* ends_with(''string'', ''suffix'')&lt;br /&gt;
&lt;br /&gt;
Determines whether the ''string'' ends with the specified ''suffix''.&lt;br /&gt;
&lt;br /&gt;
==== find_string ====&lt;br /&gt;
&lt;br /&gt;
{{DevFeature1.13|5}}&lt;br /&gt;
&lt;br /&gt;
* find_string(''string'', ''search_string'')&lt;br /&gt;
&lt;br /&gt;
Returns the index at which ''search_string'' starts within ''string'' (as a substring), or -1 if it is not found. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang='wfl'&amp;gt;&lt;br /&gt;
find_string( 'Testing', 'ing' )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
returns &amp;lt;code&amp;gt;4&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==== replace ====&lt;br /&gt;
&lt;br /&gt;
{{DevFeature1.13|5}}&lt;br /&gt;
&lt;br /&gt;
* replace(''string'', ''offset'', [''size'',] ''replacement'')&lt;br /&gt;
&lt;br /&gt;
Returns a new string obtained by replacing a portion of the input ''string'' with the contents of the ''replacement'' string. The ''offset'' and ''size'' work the same as for &amp;lt;code&amp;gt;substring&amp;lt;/code&amp;gt;. Examples:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang='wfl'&amp;gt;&lt;br /&gt;
replace('The quick brown fox jumps over the lazy dog!', 4, 5, 'dumb')&lt;br /&gt;
replace('The quick brown fox jumps over the lazy dog!', -9, 4, 'sleeping')&lt;br /&gt;
replace('The quick brown fox jumps over the lazy dog!', -9, 'brook!')&lt;br /&gt;
replace('The quick brown fox jumps over the lazy dog!', -6, -4, 'yellow')&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
return the following strings:&lt;br /&gt;
&lt;br /&gt;
 'The dumb brown fox jumps over the lazy dog!'&lt;br /&gt;
 'The quick brown fox jumps over the sleeping dog!'&lt;br /&gt;
 'The quick brown fox jumps over the brook!'&lt;br /&gt;
 'The quick brown fox jumps over the yellow dog!'&lt;br /&gt;
&lt;br /&gt;
==== replace_all ====&lt;br /&gt;
&lt;br /&gt;
{{DevFeature1.19|4}}&lt;br /&gt;
&lt;br /&gt;
* replace_all(''string'', ''match'', ''replacement'')&lt;br /&gt;
&lt;br /&gt;
Returns a copy of ''string'' with all occurrences of ''match'' replaced by ''replacement''.&lt;br /&gt;
&lt;br /&gt;
==== starts_with ====&lt;br /&gt;
&lt;br /&gt;
{{DevFeature1.19|4}}&lt;br /&gt;
&lt;br /&gt;
* starts_with(''string'', ''prefix'')&lt;br /&gt;
&lt;br /&gt;
Determines whether the ''string'' begins with the specified ''prefix''.&lt;br /&gt;
&lt;br /&gt;
==== substring ====&lt;br /&gt;
&lt;br /&gt;
* substring(''string'', ''offset''[, ''size''])&lt;br /&gt;
&lt;br /&gt;
Extracts a substring from the given input string. The ''offset'' specifies the first character to extract; the first character is &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt;, and negative values count from the end, so the last character is &amp;lt;code&amp;gt;-1&amp;lt;/code&amp;gt;. If specified, the ''size'' indicates the total number of characters to extract; it cannot be negative. If omitted, all characters from the ''offset'' to the end of the string are returned. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang='wfl'&amp;gt;&lt;br /&gt;
substring('The quick brown fox jumps over the lazy dog!', 4, 5)&lt;br /&gt;
substring('The quick brown fox jumps over the lazy dog!', -9, 4)&lt;br /&gt;
substring('The quick brown fox jumps over the lazy dog!', -9)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
return &amp;lt;code&amp;gt;'quick'&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;'lazy'&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;'lazy dog!'&amp;lt;/code&amp;gt; respectively.&lt;br /&gt;
&lt;br /&gt;
{{DevFeature1.13|5}} The ''size'' can now be negative. This means to count backwards from the given ''offset'' (but always including the given offset, so a ''size'' of -1 gives the same result as 1). For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang='wfl'&amp;gt;&lt;br /&gt;
substring('The quick brown fox jumps over the lazy dog!', -6, -4)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
returns &amp;lt;code&amp;gt;'lazy'&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== List and Map Functions ===&lt;br /&gt;
&lt;br /&gt;
This section contains functions that directly manipulate a map or list.&lt;br /&gt;
&lt;br /&gt;
==== head ====&lt;br /&gt;
&lt;br /&gt;
* head(''list'' [, ''count''])&lt;br /&gt;
&lt;br /&gt;
Returns the first item from the ''list''; for example&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang='wfl'&amp;gt;&lt;br /&gt;
head([5, 7, 9])&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
returns &amp;lt;code&amp;gt;5&amp;lt;/code&amp;gt;, and&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang='wfl'&amp;gt;&lt;br /&gt;
head( [ 'Orc', 'Human' ] )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
returns &amp;lt;code&amp;gt;'Orc'&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
{{DevFeature1.13|5}} If a second argument is given, it returns a list containing the first ''count'' elements from the ''list''. Note that &amp;lt;syntaxhighlight lang='wfl' inline&amp;gt;head(L)&amp;lt;/syntaxhighlight&amp;gt; is different from &amp;lt;syntaxhighlight lang='wfl' inline&amp;gt;head(L,1)&amp;lt;/syntaxhighlight&amp;gt; - the former returns the first element, while the latter returns a list containing only the first element.&lt;br /&gt;
&lt;br /&gt;
==== index_of ====&lt;br /&gt;
&lt;br /&gt;
* index_of(''value'', ''list'')&lt;br /&gt;
&lt;br /&gt;
This function will return the first index where ''value'' can be found in the input ''list''. It will return -1 if the value is not found in the ''list'.&lt;br /&gt;
&lt;br /&gt;
==== keys ====&lt;br /&gt;
&lt;br /&gt;
* keys(''map'')&lt;br /&gt;
&lt;br /&gt;
Extracts the key values from an input ''map'' and returns them as a list. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang='wfl'&amp;gt;&lt;br /&gt;
keys(['Elvish Fighter' -&amp;gt; 50, 'Elvish Archer' -&amp;gt; 60])&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
returns&lt;br /&gt;
&lt;br /&gt;
 ['Elvish Fighter', 'Elvish Archer']&lt;br /&gt;
&lt;br /&gt;
==== size ====&lt;br /&gt;
&lt;br /&gt;
* size(''list'')&lt;br /&gt;
&lt;br /&gt;
This function returns the number of elements in the ''list''.&lt;br /&gt;
&lt;br /&gt;
For example, &amp;lt;syntaxhighlight lang='wfl' inline&amp;gt;size([5, 7, 9])&amp;lt;/syntaxhighlight&amp;gt; returns &amp;lt;code&amp;gt;3&amp;lt;/code&amp;gt; and &amp;lt;syntaxhighlight lang='wfl' inline&amp;gt;size(['Archer', 'Fighter'])&amp;lt;/syntaxhighlight&amp;gt; returns &amp;lt;code&amp;gt;2&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==== sort ====&lt;br /&gt;
&lt;br /&gt;
* sort(''list'', ''formula'')&lt;br /&gt;
&lt;br /&gt;
This function evaluates to a result list sorted according to the comparison ''formula'' for each item &amp;lt;code&amp;gt;a&amp;lt;/code&amp;gt; and its successor &amp;lt;code&amp;gt;b&amp;lt;/code&amp;gt;. For instance, sorting units according to hitpoints would be done by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang='wfl'&amp;gt;&lt;br /&gt;
sort(my_units, a.hitpoints &amp;gt; b.hitpoints)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To sort them in the reverse order, simply use &amp;lt;code&amp;gt;&amp;amp;lt;&amp;lt;/code&amp;gt; instead of &amp;lt;code&amp;gt;&amp;amp;gt;&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==== tail ====&lt;br /&gt;
&lt;br /&gt;
{{DevFeature1.13|5}}&lt;br /&gt;
&lt;br /&gt;
* tail(''list'' [, ''count''])&lt;br /&gt;
&lt;br /&gt;
Returns the last item from the ''list''; for example&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang='wfl'&amp;gt;&lt;br /&gt;
tail([5, 7, 9])&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
returns &amp;lt;code&amp;gt;9&amp;lt;/code&amp;gt;, and&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang='wfl'&amp;gt;&lt;br /&gt;
tail( [ 'Orc', 'Human' ] )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
returns &amp;lt;code&amp;gt;'Human'&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
If a second argument is given, it returns a list containing the last ''count'' elements from the ''list''. Note that &amp;lt;syntaxhighlight lang='wfl' inline&amp;gt;tail(L)&amp;lt;/syntaxhighlight&amp;gt; is different from &amp;lt;syntaxhighlight lang='wfl' inline&amp;gt;tail(L,1)&amp;lt;/syntaxhighlight&amp;gt; - the former returns the last element, while the latter returns a list containing only the last element.&lt;br /&gt;
&lt;br /&gt;
==== tolist ====&lt;br /&gt;
&lt;br /&gt;
* tolist(''map'')&lt;br /&gt;
&lt;br /&gt;
This function takes a map and return a list of key-value pair objects. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang='wfl'&amp;gt;&lt;br /&gt;
tolist(['Elf' -&amp;gt; 10, 'Dwarf' -&amp;gt; 20])&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
will return:&lt;br /&gt;
&lt;br /&gt;
 [{key-&amp;gt;'Elf',value-&amp;gt;10}, {key-&amp;gt;'Dwarf',value-&amp;gt;20}]&lt;br /&gt;
&lt;br /&gt;
==== tomap ====&lt;br /&gt;
&lt;br /&gt;
* tomap(''list A'' [, ''list B''])&lt;br /&gt;
&lt;br /&gt;
This function takes one or two ''lists'' as input and returns a map. If only one list is specified, then the function will evaluate this list, count how many similar elements are found within the list, and return a map with keys being these elements, and values being a number representing how many of them the list contains. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang='wfl'&amp;gt;&lt;br /&gt;
tomap(['elf', 'dwarf', 'elf', 'elf', 'human', 'human'])&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
will return:&lt;br /&gt;
&lt;br /&gt;
 ['elf' -&amp;gt; 3, 'dwarf' -&amp;gt; 1, 'human' -&amp;gt; 2]&lt;br /&gt;
&lt;br /&gt;
{{DevFeature1.13|5}} However, if all the elements are key-value pairs such as those created by ''pair'' or ''tolist'', then this function will invert the effect of ''tolist'' and return the original map which would have produced the input list as output when passed to ''tolist''. If only some elements are key-value pairs, those elements will be directly converted into key-value pairs in the resulting map, while other values will be treated as described above.&lt;br /&gt;
&lt;br /&gt;
If two lists are specified, then the elements of the first one will be used as a keys, and the elements of the second one as a values, when creating an output map. Note that these input lists must be of the same length. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang='wfl'&amp;gt;&lt;br /&gt;
tomap(['elf', 'dwarf' ], [10, 20])&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
will result in:&lt;br /&gt;
&lt;br /&gt;
 ['elf' -&amp;gt; 10, 'dwarf' -&amp;gt; 20]&lt;br /&gt;
&lt;br /&gt;
==== values ====&lt;br /&gt;
&lt;br /&gt;
* values(''map'')&lt;br /&gt;
&lt;br /&gt;
Extracts the values assigned to keys from an input ''map'' and returns them as a list. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang='wfl'&amp;gt;&lt;br /&gt;
values(['Elvish Fighter' -&amp;gt; 50, 'Elvish Archer' -&amp;gt; 60])&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
returns&lt;br /&gt;
&lt;br /&gt;
 [50, 60]&lt;br /&gt;
&lt;br /&gt;
=== List-processing Functions ===&lt;br /&gt;
&lt;br /&gt;
This section covers functions that operate on maps or lists by applying one or more formulas in succession to each element. Most return another map or list, &amp;lt;code&amp;gt;reduce&amp;lt;/code&amp;gt; instead combines all the elements into a single result.&lt;br /&gt;
&lt;br /&gt;
==== choose ====&lt;br /&gt;
&lt;br /&gt;
* choose(''input'', [''self_name'',] ''formula'')&lt;br /&gt;
&lt;br /&gt;
This function evaluates ''formula'' for each item in the ''input'' (which can be a list or a map). It will return the first item to which ''formula'' gave the highest value. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang='wfl'&amp;gt;&lt;br /&gt;
choose(my_units, level)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
gives back the unit with the highest level.&lt;br /&gt;
&lt;br /&gt;
The implicit input when evaluating a mapping/filtering function's ''formula'' component will be that specific item under evaluation (in this example one of &amp;quot;my_units&amp;quot;), and it can be explicitly referenced as &amp;lt;code&amp;gt;self&amp;lt;/code&amp;gt; when necessary. The optional &amp;lt;self_name&amp;gt; parameter can be used to give a different name to the &amp;lt;code&amp;gt;self&amp;lt;/code&amp;gt; variable.&lt;br /&gt;
&lt;br /&gt;
When evaluating a map, we can reference each key by &amp;lt;code&amp;gt;key&amp;lt;/code&amp;gt; and each value by &amp;lt;code&amp;gt;value&amp;lt;/code&amp;gt;. In this case, the &amp;lt;code&amp;gt;self&amp;lt;/code&amp;gt; variable is this key-value pair. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang='wfl'&amp;gt;&lt;br /&gt;
choose(['elf' -&amp;gt; 10, 'dwarf' -&amp;gt; 20 ], value)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
will return a key-value pair &lt;br /&gt;
&lt;br /&gt;
 {key-&amp;gt;'dwarf', value-&amp;gt;20}&lt;br /&gt;
&lt;br /&gt;
The curly braces are used in output to indicate that this is an object, not a map. It is not valid WFL syntax.&lt;br /&gt;
&lt;br /&gt;
==== filter ====&lt;br /&gt;
&lt;br /&gt;
* filter(''input'', [''self_name'',] ''formula'')&lt;br /&gt;
&lt;br /&gt;
This function will run the ''formula'' on each item in the ''input'' (which can be a list or a map). It will evaluate to a list or map which only contains items that the ''formula'' was true for. The optional &amp;lt;self_name&amp;gt; parameter can be used to give a different name to the &amp;lt;code&amp;gt;self&amp;lt;/code&amp;gt; variable.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang='wfl'&amp;gt;&lt;br /&gt;
filter(my_units, hitpoints &amp;lt; max_hitpoints)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
will return all of your units which have less than maximum hitpoints. For instance this could be used if looking for candidates for healing.&lt;br /&gt;
&lt;br /&gt;
==== find ====&lt;br /&gt;
 &lt;br /&gt;
* find(''input'', [''self_name'',] ''formula'')&lt;br /&gt;
&lt;br /&gt;
This function will run &amp;lt;formula&amp;gt; on each item in the &amp;lt;input&amp;gt; (which can be a list or a map) and will return the first item for which &amp;lt;formula&amp;gt; was true. The optional &amp;lt;self_name&amp;gt; parameter can be used to give a different name to the &amp;lt;code&amp;gt;self&amp;lt;/code&amp;gt; variable. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang='wfl'&amp;gt;&lt;br /&gt;
find(units, type = 'Elvish Archer' )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
will return the first unit of type 'Elvish Archer'.&lt;br /&gt;
&lt;br /&gt;
==== map ====&lt;br /&gt;
&lt;br /&gt;
* map(''input'', [''self_name'',] ''formula'')&lt;br /&gt;
&lt;br /&gt;
This function will run the ''formula'' on each item in the ''input'' (which can be a list or a map), and evaluate to a new list or map or a map, which contains the same number of items as in ''input'', with the formulas run on each item. The optional &amp;lt;self_name&amp;gt; parameter can be used to give a different name to the &amp;lt;code&amp;gt;self&amp;lt;/code&amp;gt; variable. When run on a map, the resulting map has the same keys as the input map, but with the values updated to the results of the ''formula''. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang='wfl'&amp;gt;&lt;br /&gt;
map([10,20], self*self)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and &lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang='wfl'&amp;gt;&lt;br /&gt;
map([10,20], 'value', value*value)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
will both result in [100, 400]. The formula:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang='wfl'&amp;gt;&lt;br /&gt;
map(my_units, hitpoints)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
will give a list back with the number of hitpoints each unit has. This is more useful in conjunction with other functions.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang='wfl'&amp;gt;&lt;br /&gt;
map(['elf' -&amp;gt; 10, 'dwarf' -&amp;gt; 20 ], value*2)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The above will produce ['elf' -&amp;gt; 20, 'dwarf' -&amp;gt; 40]. Note that in case of a map data type, the &amp;lt;code&amp;gt;map&amp;lt;/code&amp;gt; function can only modify the value.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang='wfl'&amp;gt;&lt;br /&gt;
map(tomap([3,5,8,8]), value+key*100)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The above will produce &amp;lt;code&amp;gt;[3 -&amp;gt; 301, 5 -&amp;gt; 502, 8 -&amp;gt; 801]&amp;lt;/code&amp;gt;. This can be used to take a list and make a map containing pairs &amp;lt;code&amp;gt;[element_from_that_list -&amp;gt; f(element_from_that_list,number_of_repetitions_of_that_element_in_that_list)]&amp;lt;/code&amp;gt; where &amp;lt;code&amp;gt;f&amp;lt;/code&amp;gt; is an arbitrary function.&lt;br /&gt;
&lt;br /&gt;
==== reduce ====&lt;br /&gt;
&lt;br /&gt;
* reduce(''list'', [''identity'', ] ''formula'')&lt;br /&gt;
&lt;br /&gt;
This function will run the ''formula'' on the first and second members of the ''list'', then on the result and the third member and so on until the list is depleted. The final result is then returned. The two variables used in the ''formula'' are always 'a' and 'b'.&lt;br /&gt;
&lt;br /&gt;
For example, &amp;lt;syntaxhighlight lang='wfl' inline&amp;gt;reduce([1,2,3,4], a+b)&amp;lt;/syntaxhighlight&amp;gt; returns &amp;lt;code&amp;gt;10&amp;lt;/code&amp;gt; and &amp;lt;syntaxhighlight lang='wfl' inline&amp;gt;reduce([9,4,8,2], 10*a+b)&amp;lt;/syntaxhighlight&amp;gt; returns &amp;lt;code&amp;gt;9482&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
{{DevFeature1.13|5}} The new ''identity'' argument specifies the starting value (which is null or 0 by default). If ''list'' is empty, then ''identity'' is returned. Otherwise, the list will be considered as if ''identity'' were an extra first element. For example, to calculate the product of a list of numbers, you might do something like this:&lt;br /&gt;
&amp;lt;syntaxhighlight lang='wfl'&amp;gt;&lt;br /&gt;
reduce(your_list, 1, a * b)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This will return 1 if the list is empty, as expected - the product of no numbers is 1. If the list is not empty, adding 1 to the list will have no effect, since it is the multiplicative identity.&lt;br /&gt;
&lt;br /&gt;
==== take_while ====&lt;br /&gt;
&lt;br /&gt;
{{DevFeature1.13|5}}&lt;br /&gt;
&lt;br /&gt;
* take_while(''list'', ''formula'')&lt;br /&gt;
&lt;br /&gt;
Evaluates the ''formula'' for each element of the ''list'' until it finds one for which it evaluates to false, then returns a list of all elements up to but not including that element. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang='wfl'&amp;gt;&lt;br /&gt;
take_while([1,5,3,6,3,7,9,5,6,4,12,2,53,2,1], self &amp;lt; 10)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
returns the list &amp;lt;code&amp;gt;[1,5,3,6,3,7,9,5,6,4]&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==== zip ====&lt;br /&gt;
&lt;br /&gt;
{{DevFeature1.13|5}}&lt;br /&gt;
&lt;br /&gt;
* zip(''list1'', ... , ''listN'')&lt;br /&gt;
* zip(''list of lists'')&lt;br /&gt;
&lt;br /&gt;
Takes a list of lists and generates a new list of lists such that list ''n'' contains element ''n'' of each of the original lists, in order. If the lists are not all of the same length, it treats them as if they were padded on the end with null values so that they are all the length of the longest list.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang='wfl'&amp;gt;&lt;br /&gt;
zip([1,2,3],[4,5,6])&lt;br /&gt;
zip([1,4],[2,5],[3,6])&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
return &amp;lt;code&amp;gt;[[1,4],[2,5],[3,6]]&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;[[1,2,3],[4,5,6]]&amp;lt;/code&amp;gt;, respectively.&lt;br /&gt;
&lt;br /&gt;
=== Location Functions ===&lt;br /&gt;
&lt;br /&gt;
Functions for working with locations on a hex map.&lt;br /&gt;
&lt;br /&gt;
==== adjacent_locs ====&lt;br /&gt;
&lt;br /&gt;
{{DevFeature1.13|9}}&lt;br /&gt;
&lt;br /&gt;
* adjacent_locs(''center'')&lt;br /&gt;
&lt;br /&gt;
Returns a list of all locations adjacent to the specified location. When called from a formula with access to the game state, it automatically excludes locations that don't exist on the map. Otherwise, it operates as if on an infinite map. This means you should generally not expect the returned list to contain exactly 6 elements.&lt;br /&gt;
&lt;br /&gt;
==== are_adjacent ====&lt;br /&gt;
&lt;br /&gt;
{{DevFeature1.13|9}}&lt;br /&gt;
&lt;br /&gt;
* are_adjacent(''loc1'', ''loc2'')&lt;br /&gt;
&lt;br /&gt;
Check if two locations are adjacent. Returns 1 (true) or 0 (false).&lt;br /&gt;
&lt;br /&gt;
==== direction_from ====&lt;br /&gt;
&lt;br /&gt;
{{DevFeature1.13|9}}&lt;br /&gt;
&lt;br /&gt;
* direction_from(''start'', ''direction'', [''distance''])&lt;br /&gt;
&lt;br /&gt;
Returns the hex reached by travelling in the specified direction from a starting hex for a certain distance (default 1 hex).&lt;br /&gt;
&lt;br /&gt;
==== distance_between ====&lt;br /&gt;
&lt;br /&gt;
{{DevFeature1.13|5}}&lt;br /&gt;
&lt;br /&gt;
* distance_between(''start'', ''end'')&lt;br /&gt;
&lt;br /&gt;
Returns the distance between the locations ''start'' and ''end'', which must be location objects such as those created by &amp;lt;code&amp;gt;loc()&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
'''Note:''' This function was already available in FormulaAI prior to 1.13.5; however, from 1.13.5 onward it is available to all formulas.&lt;br /&gt;
&lt;br /&gt;
==== loc ====&lt;br /&gt;
&lt;br /&gt;
* loc(''x'', ''y'')&lt;br /&gt;
&lt;br /&gt;
Creates and returns a location object with the specified coordinates. If assigned to a variable ''pos'' (eg with a &amp;lt;code&amp;gt;where&amp;lt;/code&amp;gt; clause), the individual coordinates can be accessed as &amp;lt;code&amp;gt;pos.x&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;pos.y&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==== locations_in_radius ====&lt;br /&gt;
&lt;br /&gt;
{{DevFeature1.13|9}}&lt;br /&gt;
&lt;br /&gt;
* locations_in_radius(''center'', ''radius'')&lt;br /&gt;
&lt;br /&gt;
Returns a list of all locations within a given radius of the specified center hex.&lt;br /&gt;
Only locations on the map will be returned.&lt;br /&gt;
&lt;br /&gt;
==== relative_dir ====&lt;br /&gt;
&lt;br /&gt;
{{DevFeature1.13|9}}&lt;br /&gt;
&lt;br /&gt;
* relative_dir(''loc1'', ''loc2'')&lt;br /&gt;
&lt;br /&gt;
Returns the direction you need to travel to progress from one location to another. The returned location is one of the six possible directions on the Wesnoth hex map, or an empty string if both locations are the same.&lt;br /&gt;
&lt;br /&gt;
==== rotate_loc_around ====&lt;br /&gt;
&lt;br /&gt;
{{DevFeature1.13|9}} but returns wrong result until {{DevFeature1.19|2}}&lt;br /&gt;
&lt;br /&gt;
* rotate_loc_around(''center'', ''loc'', ''angle'')&lt;br /&gt;
&lt;br /&gt;
Rotates a location around a given center to produce a new location. The angle is an integer between -6 and 6, which can be understood as a multiple of 60 degrees.&lt;br /&gt;
&lt;br /&gt;
=== Miscellaneous Functions ===&lt;br /&gt;
&lt;br /&gt;
Some functions really don't fit into any category. They are all listed here.&lt;br /&gt;
&lt;br /&gt;
==== null ====&lt;br /&gt;
&lt;br /&gt;
* null([''arguments''])&lt;br /&gt;
&lt;br /&gt;
Evaluates each of its arguments (if any) in order, then returns null. Since formulas generally do not have side-effects, there is little point in specifying any arguments unless you are writing AI code (where several functions do have side-effects).&lt;br /&gt;
&lt;br /&gt;
==== pair ====&lt;br /&gt;
&lt;br /&gt;
{{DevFeature1.13|5}}&lt;br /&gt;
&lt;br /&gt;
* pair(''key'', ''value'')&lt;br /&gt;
&lt;br /&gt;
Creates a key-value pair object, the same as those created by the ''tolist'' function.&lt;br /&gt;
&lt;br /&gt;
==== reverse ====&lt;br /&gt;
&lt;br /&gt;
{{DevFeature1.13|5}}&lt;br /&gt;
&lt;br /&gt;
* reverse(''string or list'')&lt;br /&gt;
&lt;br /&gt;
Returns the input string or list backwards.&lt;br /&gt;
&lt;br /&gt;
==== type ====&lt;br /&gt;
&lt;br /&gt;
{{DevFeature1.13|5}}&lt;br /&gt;
&lt;br /&gt;
* type(''anything'')&lt;br /&gt;
&lt;br /&gt;
Returns the type of its input as a string. Possible results are:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;'integer'&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;'decimal'&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;'string'&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;'list'&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;'map'&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;'null'&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;'object'&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== get_palette ====&lt;br /&gt;
&lt;br /&gt;
{{DevFeature1.19|4}}&lt;br /&gt;
&lt;br /&gt;
* get_palette(''name'')&lt;br /&gt;
&lt;br /&gt;
Returns a list of colours that make up the named palette. Palettes are defined by a '''[color_palette]''' tag, usually in the [[GameConfigWML#Color_Palettes|game config]]. The palettes defined in core Wesnoth are '''magenta''', '''flag_green''', and '''ellipse_red'''. In addition to defined palettes, several hard-coded palettes are available by name. They are '''red_green_scale''', '''red_green_scale_text''', '''blue_white_scale''', and '''blue_white_scale_text'''. These are also defined in the game config, but not with a '''[color_palette]''' tag.&lt;br /&gt;
&lt;br /&gt;
=== Debugging Functions ===&lt;br /&gt;
&lt;br /&gt;
There are also a few functions that can be useful for debugging formulas, for example by displaying intermediate results to the screen. Note that this breaks the general rule that functions do not have side-effects.&lt;br /&gt;
&lt;br /&gt;
==== debug ====&lt;br /&gt;
&lt;br /&gt;
* debug([''formula''])&lt;br /&gt;
&lt;br /&gt;
Starts a GUI formula AI debugger when evaluating a formula. It takes a formula, evaluates it and returns the result unchanged. '''Note:''' this does not appear to work in 1.13.3.&lt;br /&gt;
&lt;br /&gt;
{{DevFeature1.13|5}} The formula allows you to step through the formula one operation at a time, viewing the current stack and execution trace. As of 1.13.5, you need to enable [[CommandMode|debug mode]] to use the debugger; otherwise, it will simply be skipped.&lt;br /&gt;
&lt;br /&gt;
==== debug_print ====&lt;br /&gt;
&lt;br /&gt;
'''you need to enable formula log (--log-info='scripting/formula') to see the result of this call'''&lt;br /&gt;
&lt;br /&gt;
* debug_print([''explanation'' ,] ''formula'' )&lt;br /&gt;
&lt;br /&gt;
This function can be used for debugging a formula. It takes a ''formula'', writes its result to the console, and returns it unchanged. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang='wfl'&amp;gt;&lt;br /&gt;
debug_print([1, 2, 3])&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
will result in printing to the console&lt;br /&gt;
&lt;br /&gt;
 [1, 2, 3]&lt;br /&gt;
&lt;br /&gt;
and returning the same.&lt;br /&gt;
&lt;br /&gt;
We can specify an optional parameter ''explanation'' that helps to distinguish between multiple ''debug_print'' calls in the same formula:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang='wfl'&amp;gt;&lt;br /&gt;
debug_print('My array: ', [1, 2, 3])&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
will write in the console:&lt;br /&gt;
&lt;br /&gt;
 My array: [1, 2, 3]&lt;br /&gt;
&lt;br /&gt;
and return&lt;br /&gt;
&lt;br /&gt;
 [1, 2, 3]&lt;br /&gt;
&lt;br /&gt;
==== debug_profile ====&lt;br /&gt;
&lt;br /&gt;
* debug_profile(''formula'' [, ''explanation''])&lt;br /&gt;
&lt;br /&gt;
Evaluates the formula 1000 times and prints (as with debug_print) a number indicating the average time required to evaluate the formula. Mainly intended for internal testing, but could occasionally be useful for people working with complicated formulas. The optional ''explanation'' argument is used in the same way as in debug_print.&lt;br /&gt;
&lt;br /&gt;
==== debug_float ====&lt;br /&gt;
&lt;br /&gt;
* debug_float(''location'', [''explanation'',] ''formula'' )&lt;br /&gt;
&lt;br /&gt;
This function can be used for debugging a formula. It takes a formula, floats a label containing the result on the hex specified (in the same way damage is displayed) and returns it unchanged. Note that the ''location'' here is an object type; it can be created with the &amp;lt;code&amp;gt;[[#loc|loc()]]&amp;lt;/code&amp;gt; function. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang='wfl'&amp;gt;&lt;br /&gt;
debug_float(me.loc, me.id)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
will make a label containing the id of the unit ''me'' float over the unit.&lt;br /&gt;
&lt;br /&gt;
Return value is also the unit id.&lt;br /&gt;
&lt;br /&gt;
We can specify an optional parameter ''explanation'' that helps to distinguish between multiple ''debug_float'' calls in the same formula:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang='wfl'&amp;gt;&lt;br /&gt;
debug_float( me.loc, 'id: ', me.id )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
will float the following label&lt;br /&gt;
&lt;br /&gt;
 id: unit_id&lt;br /&gt;
&lt;br /&gt;
and return the unit id.&lt;br /&gt;
&lt;br /&gt;
==== dir ====&lt;br /&gt;
&lt;br /&gt;
* dir(''object'')&lt;br /&gt;
&lt;br /&gt;
This function return a list of all attributes in ''object''. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang='wfl'&amp;gt;&lt;br /&gt;
dir(my_leader)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
will result in the following output:&lt;br /&gt;
&lt;br /&gt;
 [ 'x', 'y', 'loc', 'id', 'type', 'name', 'leader', 'undead', 'traits', 'attacks', 'abilities', 'hitpoints',&lt;br /&gt;
 'max_hitpoints', 'experience', 'max_experience', 'level', 'total_movement', 'movement_left', 'attacks_left',&lt;br /&gt;
 'side', 'states', 'cost', 'usage', 'vars']&lt;br /&gt;
&lt;br /&gt;
This command is useful in the formula command line, to get information about the attributes of different types of data.&lt;br /&gt;
&lt;br /&gt;
=== Game State Functions ===&lt;br /&gt;
&lt;br /&gt;
These are functions that access the game state. Therefore, they are not available in all formulas, as described above.&lt;br /&gt;
&lt;br /&gt;
==== base_tod_bonus ====&lt;br /&gt;
&lt;br /&gt;
* base_tod_bonus([''loc'', [''turn'']])&lt;br /&gt;
&lt;br /&gt;
Evaluates the base time-of-day bonus, excluding the effect of illumination from abilities or terrain. If no turn is specified, the current turn is used. If no location is specified, the bonus is calculated for the global schedule without taking any time areas into account, but if a location is specified, it will account for any time areas that might affect that location.&lt;br /&gt;
&lt;br /&gt;
==== chance_to_hit ====&lt;br /&gt;
&lt;br /&gt;
* chance_to_hit(''unit'', ''location or terrain'')&lt;br /&gt;
&lt;br /&gt;
Calculates the base chance for the unit to be hit if it moved to the given location or terrain. This is essentially the inverse of its defense. It is returned as an integer between 0 and 100.&lt;br /&gt;
&lt;br /&gt;
==== defense_on ====&lt;br /&gt;
&lt;br /&gt;
* defense_on(''unit'', ''location or terrain'')&lt;br /&gt;
&lt;br /&gt;
Calculates the defense that the unit would have if it moved to the given location or terrain. It is returned as an integer between 0 and 100.&lt;br /&gt;
&lt;br /&gt;
==== enemy_of ====&lt;br /&gt;
&lt;br /&gt;
* enemy_of(''self'', ''other'')&lt;br /&gt;
&lt;br /&gt;
Determines whether two units are enemies. Returns 1 (true) or 0 (false).&lt;br /&gt;
&lt;br /&gt;
==== get_unit_type ====&lt;br /&gt;
&lt;br /&gt;
* get_unit_type(''id'')&lt;br /&gt;
&lt;br /&gt;
Returns an object describing the specified unit type, or null if no such unit type exists. A unit type object has many of the same keys as a unit, excluding those that are expected to change over time such as &amp;lt;tt&amp;gt;hitpoints&amp;lt;/tt&amp;gt; or &amp;lt;tt&amp;gt;name&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==== jamming_cost ====&lt;br /&gt;
&lt;br /&gt;
* jamming_cost(''unit or unit type'', ''location or terrain'')&lt;br /&gt;
&lt;br /&gt;
Calculates the jamming cost for the unit to block vision on the given location terrain.&lt;br /&gt;
&lt;br /&gt;
==== movement_cost ====&lt;br /&gt;
&lt;br /&gt;
* movement_cost(''unit or unit type'', ''location or terrain'')&lt;br /&gt;
&lt;br /&gt;
Calculates the movement cost for the unit to enter the given location or terrain.&lt;br /&gt;
&lt;br /&gt;
==== resistance_on ====&lt;br /&gt;
&lt;br /&gt;
* resistance_on(''unit'', ''location'', ''type'', [''attacker''])&lt;br /&gt;
&lt;br /&gt;
Calculates the unit's resistance to the given damage type when standing on the specified location. If specified, the ''attacker'' parameter should be 1 to indicate that the unit is the attacker, or 0 to indicate that it is the defender, as this status can affect resistances. By default, it is assumed to be the defender.&lt;br /&gt;
&lt;br /&gt;
This is returned not as the raw resistance set in WML, but the actual resistance that the player sees, so it ranges between -100 and 100.&lt;br /&gt;
&lt;br /&gt;
==== tod_bonus ====&lt;br /&gt;
&lt;br /&gt;
* tod_bonus([''loc'', [''turn'']])&lt;br /&gt;
&lt;br /&gt;
Evaluates the final time-of-day bonus, accounting for the effect of illumination from abilities or terrain. If no turn is specified, the current turn is used. If no location is specified, the bonus is calculated for the global schedule without taking any time areas into account, but if a location is specified, it will account for any time areas that might affect that location.&lt;br /&gt;
&lt;br /&gt;
==== unit_at ====&lt;br /&gt;
&lt;br /&gt;
* unit_at(''location'')&lt;br /&gt;
&lt;br /&gt;
Returns the unit on the given location, or null if there is no unit there.&lt;br /&gt;
&lt;br /&gt;
==== vision_cost ====&lt;br /&gt;
&lt;br /&gt;
* vision_cost(''unit or unit type'', ''location or terrain'')&lt;br /&gt;
&lt;br /&gt;
Calculates the vision cost for the unit to see through the given location or terrain.&lt;/div&gt;</summary>
		<author><name>Soliton</name></author>
		
	</entry>
</feed>