<?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-06-06T02:50:09Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.31.16</generator>
	<entry>
		<id>https://wiki.wesnoth.org/index.php?title=CompatibilityBreakingChanges&amp;diff=75260</id>
		<title>CompatibilityBreakingChanges</title>
		<link rel="alternate" type="text/html" href="https://wiki.wesnoth.org/index.php?title=CompatibilityBreakingChanges&amp;diff=75260"/>
		<updated>2026-05-31T12:36:26Z</updated>

		<summary type="html">&lt;p&gt;Soliton: /* Compatibility breaking (requires updates to work) */ See https://github.com/wesnoth/wesnoth/commit/1187a9c72b54f87a209c09cbb2681f7bfd27cec6&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This lists removed WML functionality and helpful hints for avoiding pitfalls.&lt;br /&gt;
&lt;br /&gt;
The previous list is available [https://forums.wesnoth.org/viewtopic.php?t=58532 here].&lt;br /&gt;
&lt;br /&gt;
== Compatibility breaking changes between 1.18 and 1.19/1.20 ==&lt;br /&gt;
&lt;br /&gt;
=== Compatibility breaking (requires updates to work) ===&lt;br /&gt;
&lt;br /&gt;
* '''[kill]''' now reduces target unit hitpoints to 0 before triggering '''last_breath, die''' events. This affects mentioned events that rely on [have_unit] conditions.&lt;br /&gt;
* WFL Removed properties '''unit.side''' and '''terrain.owner'''. Use '''unit.side_number''' and '''terrain.owner_side''' instead. They return 1-indexed side, removed properties returned 0-indexed side.&lt;br /&gt;
* Abilities with both '''add''' and '''sub''' now calculate value differently&lt;br /&gt;
* rotate_loc_around formula now works&lt;br /&gt;
* [era] with id=era_dunefolk does not exist anymore&lt;br /&gt;
* [side]'s leader attribute has been removed&lt;br /&gt;
* [side]'s [variables] tag is now used to set side variables. Use [side]'s [leader] tag to set a unit variable.&lt;br /&gt;
* Setting gold to decimal value fails with error. Previously it was converted to int automatically. As of 1.19.21, automatic conversion is only done in [gold], but not in Lua or [modify_side].&lt;br /&gt;
* The following macros were removed ([https://github.com/wesnoth/wesnoth/pull/11126 #11126])&lt;br /&gt;
** EARLY_FINISH_BONUS_NOTE&lt;br /&gt;
** NO_EARLY_FINISH_BONUS_NOTE&lt;br /&gt;
** NO_GOLD_CARRYOVER_NOTE&lt;br /&gt;
** NEW_GOLD_CARRYOVER_NOTE_100&lt;br /&gt;
** NEW_GOLD_CARRYOVER_NOTE_40&lt;br /&gt;
** NEW_GOLD_CARRYOVER_NOTE_20&lt;br /&gt;
** MISSILE_FRAME_FIREBALL&lt;br /&gt;
** MESSAGE&lt;br /&gt;
** STORY_PART_SPEECH&lt;br /&gt;
** LOYAL_UNDEAD_UNIT&lt;br /&gt;
** ON_SIGHTING&lt;br /&gt;
** MAKE_AI_SIDE_PERSISTENT&lt;br /&gt;
** DRAKE_FLYING_ANIM&lt;br /&gt;
** NO_INTERRUPT_NO_UNDO&lt;br /&gt;
** ENABLE_NIGHTBLADE&lt;br /&gt;
* Parsing of &amp;lt;&amp;lt; in quotes has been fixed. This means cases like '''key=&amp;quot;&amp;lt;&amp;lt;&amp;quot;''' do not error anymore and cases like '''key=&amp;quot;&amp;lt;&amp;lt;&amp;quot; {MACRO} &amp;quot;&amp;gt;&amp;gt;&amp;quot;''' now expand the macro.&lt;br /&gt;
&lt;br /&gt;
=== Deprecations (will continue to work for now) ===&lt;br /&gt;
* rechange [experimental_filter_ability/active] and [experimental_filter_specials] to [filter_ability] and [filter_specials] and make &amp;quot;experimental_&amp;quot; deprecated.&lt;br /&gt;
&lt;br /&gt;
=== New features (help fill this list, https://wiki.wesnoth.org/Special:WhatLinksHere/Template:DevFeature1.19) ===&lt;br /&gt;
* StandardAbilityFilter, including [https://github.com/wesnoth/wesnoth/pull/7814 7814]&lt;br /&gt;
* [resistance] min_value&lt;br /&gt;
* [attack] alignment&lt;br /&gt;
* New events '''unit_hits''', '''unit_misses'''&lt;br /&gt;
* Positive '''attack_weight''' now affects weapon selection&lt;br /&gt;
* Unit attack [effect]+Lua+formula API min_range and max_range&lt;br /&gt;
* Lua unit attributes fearless and healthy&lt;br /&gt;
* wesnoth.game_config shows some color-related values&lt;br /&gt;
* wesnoth.units.rebuild&lt;br /&gt;
* stringx.ends_with, stringx.starts_with&lt;br /&gt;
* Unit formula new attributes objects, advancements_taken, traits_count, objects_count, advancements_taken_count, fearless, healthy&lt;br /&gt;
* Formula functions lerp_index, ends_with, replace_all, starts_with, get_palette&lt;br /&gt;
* Custom themes https://wiki.wesnoth.org/GUIToolkit#Custom_themes&lt;br /&gt;
* Abilities and specials now support [event] (does not work correctly due to [issue]10819[/issue])&lt;br /&gt;
* Ability &amp;amp; Weapon specials registry ([https://github.com/wesnoth/wesnoth/pull/10644 10644]) (does not work correctly if ability contains [event] due to [issue]10819[/issue])&lt;br /&gt;
* [effect][remove_specials]&lt;br /&gt;
* Expose unit pick dialog to Lua as a simple API call ([https://github.com/wesnoth/wesnoth/pull/8829 8829])&lt;br /&gt;
* [fire_event][data] can be accessed from other event as $data&lt;br /&gt;
* Unit Type Editor&lt;br /&gt;
* [era]auto_sort allows to use custom faction ordering&lt;br /&gt;
* [terrain_defaults] formula is now working as expected in case formula evaluates to null&lt;br /&gt;
* [set_menu_item] description substitutes variables when rightclick is used&lt;br /&gt;
* [defense]&lt;br /&gt;
* [resistance_defaults] is not causing OOS in random maps anymore&lt;br /&gt;
* Ability/weapon special descriptions support po variables in descriptions like '''$add''', '''$sub''' etc that contain the value of the relevant key. ([https://github.com/wesnoth/wesnoth/pull/10053 10053], [https://github.com/wesnoth/wesnoth/pull/10293 10293], [https://github.com/wesnoth/wesnoth/pull/10749 10749])&lt;br /&gt;
* Ability/weapon special help page ids now follow the format: '''ability_&amp;lt;unique_id&amp;gt;''' or '''weaponspecial_&amp;lt;unique_id&amp;gt;''' ([https://github.com/wesnoth/wesnoth/pull/11012 11012]).&lt;br /&gt;
* A lot more functions were added to https://wiki.wesnoth.org/LuaAPI/types/widget with https://wiki.wesnoth.org/index.php?title=LuaAPI%2Ftypes%2Fwidget&amp;amp;type=revision&amp;amp;diff=74843&amp;amp;oldid=74842&lt;/div&gt;</summary>
		<author><name>Soliton</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.wesnoth.org/index.php?title=CompatibilityStandards&amp;diff=75194</id>
		<title>CompatibilityStandards</title>
		<link rel="alternate" type="text/html" href="https://wiki.wesnoth.org/index.php?title=CompatibilityStandards&amp;diff=75194"/>
		<updated>2026-05-18T14:34:05Z</updated>

		<summary type="html">&lt;p&gt;Soliton: Move CompatibilityStandardsV2 here&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;As a piece of software matures, there are often new designs, paradigms, and idioms developed which are superior to old ones. This creates an inherent conflict between the need for progress and the need for compatibility. Wesnoth is no exception. This document describes Wesnoth's approach toward resolving that conflict in a way which is most beneficial to both goals, as well as the rationale behind this approach.&lt;br /&gt;
&lt;br /&gt;
== Policy ==&lt;br /&gt;
This policy defines how the creation of new Wesnoth APIs and the deprecation and removal of old ones are to be handled. For the purposes of this document &amp;quot;API&amp;quot; means &amp;quot;any technical channel by which a content creator interacts with the game engine&amp;quot;. This includes, but is not limited to: preprocessor macros, WML tags, WFL functions, IPFs, and the Lua API. Note that this policy applies only to software APIs. Core content such as sprites, portraits, animations, lore, etc. are to be updated freely, without consideration for stylistic or literary conflicts that such content changes may present to add-ons.&lt;br /&gt;
&lt;br /&gt;
=== When to deprecate ===&lt;br /&gt;
==== Adding a better API ====&lt;br /&gt;
Any time a superior API is introduced which has '''complete feature-parity''' with an existing API, the old one should be immediately deprecated. Note that in most cases, in order to be considered to have &amp;quot;complete feature-parity&amp;quot;, the API should be available in the same language or area of the code as the obsolete one was. For example, the introduction of a more powerful API in Lua which can accomplish a superset of the functionality which had previously been available with a certain WML tag would not obsolete that WML tag. Exceptions can be made to this rule in cases where it is clear that the feature does not make a lot of sense in its current language or area, and was merely there for legacy reasons (such as the proper place for it not having been introduced yet at the time of its creation). Such exceptions should be determined by developer consensus.&lt;br /&gt;
&lt;br /&gt;
==== Preventing needed fixes or improvements ====&lt;br /&gt;
In such cases where a feature is preventing an important new feature from being added or makes it impossible to fix a problem impacting players, it can be preferable to deprecate the API to allow for the necessary changes to be made. APIs deprecated for this reason should still follow the deprecation schedule as normal, unless the fix or improvement is urgently needed.&lt;br /&gt;
&lt;br /&gt;
==== Actively harmful ====&lt;br /&gt;
If an API is found to cause significant problems for players or UMC authors, such as being prone to causing crashes while also very difficult to properly fix, corrupting saves and replays when not used correctly while being difficult to use correctly, or other similar situations, then such APIs should be deprecated and removed regardless of whether there is a replacement available.&lt;br /&gt;
&lt;br /&gt;
==== Unused ====&lt;br /&gt;
Any API that is not used in mainline and also is not used by the most recent version of an add-on on the add-ons server of the current or previous stable release can be deprecated. For example, if an add-on for 1.16 uses a deprecated API but the updated version of the add-on for 1.18 does not, then that add-on is not considered as currently using the API. Once deprecated for this reason, a new add-on being uploaded that uses the API is not a reason to undeprecate it.&lt;br /&gt;
&lt;br /&gt;
This does not need to be a passive process where developers simply check the add-ons server for whether an API is used - developers who want to deprecate an API for removal can proactively talk to and work with UMC authors to help update their add-ons to remove usage of said API. This can be anything from talking with them online about how to update to submitting updated code directly (ie: opening a PR against an add-on's public git repository).&lt;br /&gt;
&lt;br /&gt;
Deprecating and then removing APIs that are unused is the most preferred approach since their removal does not have any impact on UMC authors.&lt;br /&gt;
&lt;br /&gt;
=== When NOT to deprecate ===&lt;br /&gt;
==== Style ====&lt;br /&gt;
Deprecation should not be done purely for reasons of style. This is very subjective and prone to change as new contributors join and current contributors leave or become less active. As such, allowing deprecation for stylistic reasons would lead to entirely unnecessary work for UMC authors as developer preferences change over time.&lt;br /&gt;
&lt;br /&gt;
==== Renaming ====&lt;br /&gt;
While there can be exceptions, it is rarely a net positive to deprecate an API simply for the sake of renaming it to something else. It is preferable to either add a second name for the same function, leaving the old name as-is, or simply live with the current name rather than expecting all UMC authors using the API to update to the new name.&lt;br /&gt;
&lt;br /&gt;
==== Any other reason ====&lt;br /&gt;
Accepted reasons for deprecating APIs should be something that's discussed and agreed upon by the development team while also, ideally, including UMC authors. It should not become the norm that additional reasons to deprecate APIs are treated as exceptions and left as an increasingly forgotten discussion on Discord, IRC, or the forums - they should be added to here with the reasoning behind them.&lt;br /&gt;
&lt;br /&gt;
=== Deprecation awareness ===&lt;br /&gt;
==== Conflicting goals ====&lt;br /&gt;
When deprecating APIs there is an inherent conflict in terms of how to make UMC authors aware of the deprecation. After all, if they aren't aware something is deprecated, they can't know they may need to update their add-on. Therefore, deprecations need to be displayed in a place where they will see them and most UMC authors don't look at Wesnoth's logs unless there's some other issue they're investigating. At the same time, deprecation warnings aren't relevant to players and spamming deprecation warnings is not an effective way of communicating what the issues are.&lt;br /&gt;
&lt;br /&gt;
==== A middle ground ====&lt;br /&gt;
Each deprecated feature should make use of an appropriate deprecation function call for that language or subsystem to ensure that the appropriate deprecation notice is printed to the log output. Additionally, deprecation warnings should be displayed in-game in the following cases:&lt;br /&gt;
* If the player is running a development version, level 3 and level 4 deprecations should be shown in-game by default.&lt;br /&gt;
* If the player enables debug mode then all deprecation warnings should be shown, regardless of whether they're using a stable release or a development release.&lt;br /&gt;
&lt;br /&gt;
==== Documentation ====&lt;br /&gt;
It is also not enough to only display a warning at runtime when something deprecated is encountered. It is the responsibility of the development team to proactively make UMC authors aware of the deprecations and removals being done. To accomplish this:&lt;br /&gt;
* When an API is deprecated, and again if it's later removed, its deprecation or removal must be documented in the appropriate section of the changelog for the version it was deprecated or removed in.&lt;br /&gt;
* Likewise, it should be added to https://wiki.wesnoth.org/CompatibilityBreakingChanges&lt;br /&gt;
&lt;br /&gt;
Additionally, it is not enough to simply say that an API is deprecated. In the deprecation message itself as well as in the changelog and https://wiki.wesnoth.org/CompatibilityBreakingChanges, a description must be included as to why it was deprecated or removed and how UMC authors can update their add-ons to address it.&lt;br /&gt;
&lt;br /&gt;
Lastly, it should be understood that &amp;quot;removed&amp;quot; doesn't necessarily mean that the API is entirely gone from Wesnoth's codebase. There is no maintenance burden to keeping macro or method stubs that do nothing aside from printing an error message describing what was removed and why. Keeping such stubs around is highly encouraged as it is helpful for UMC authors trying to update very old add-ons to the current version of Wesnoth.&lt;br /&gt;
&lt;br /&gt;
=== How to deprecate ===&lt;br /&gt;
Every effort should be made to create the simplest possible wrappers which will translate from an obsolete API to the updated one. Such wrappers should ideally be organized into their own compatibility file or module, and set up in such a way that the internals of the updated API will not affect how the old calls get wrapped to the new one. Essentially, the idea is to create a set-it-and-forget-it compatibility wrapper which will continue to work regardless of updates made to the newer API.&lt;br /&gt;
&lt;br /&gt;
Additionally, in all cases where it's practical, the wmllint tool must be updated to be able to automatically handle updating add-ons for anything that's been deprecated except for APIs deprecated at level 1. While developers are still heavily encouraged to add wmllint support for level 1 deprecations, it is not required as these do not show deprecation warnings by default and are expected to continue working indefinitely.&lt;br /&gt;
&lt;br /&gt;
=== Deprecation levels - When to remove deprecated features ===&lt;br /&gt;
While creating simple compatibility wrappers should be possible most of the time, it would be unreasonable to assume that this approach will be viable in absolutely every case. Wesnoth's compatibility policy therefore has four different levels of deprecation which are used to set expectations for when and if an API is expected to be removed:&lt;br /&gt;
&lt;br /&gt;
#Deprecated indefinitely &amp;amp;mdash; This deprecation level is for changes which have newer preferred alternatives but, barring any unforeseen issues, have little to no maintenance impact and should be kept indefinitely in order to reduce the work required for UMC authors to maintain their content. For example, functions or attributes which have had their names changed, macros which have been replaced with tags, or simple wrappers with little to no maintenance overhead. If future large scale changes make it impractical to maintain an API deprecated at this level then the deprecation level should be raised accordingly. This is generally the preferred deprecation level - higher deprecation levels are for APIs which are intended for eventual removal and must be weighed against the maintenance work this forces upon UMC authors.&lt;br /&gt;
#Deprecated with the intention of future removal &amp;amp;mdash; This deprecation level is for APIs which will be removed in a future version, but the version they are removed in has not yet been decided. Barring urgent circumstances, all APIs that are deprecated with the intention of being removed '''must''' start with being deprecated at level 2 for 1-2 development cycles at minimum depending on the impact of the API's removal on UMC authors. Once the API has spent the necessary amount of time at deprecation level 2, it can be moved to deprecation level 3. It is not allowed to deprecate an API at level 2 and change it to level 3 in the same development cycle. There is no maximum amount of time that an API can remain deprecated at level 2.&lt;br /&gt;
#Deprecated for removal in a specific version &amp;amp;mdash; This deprecation level is for APIs which were previously deprecated at level 2 and now have a future version at which they will be removed. The version an API is removed in must be at least two development cycles after the API was deprecated at level 2. It is not allowed to move an API to deprecation level 3 and then remove it in the same development cycle.&lt;br /&gt;
#Removed without deprecation &amp;amp;mdash; This level should be used EXTREMELY rarely, and only in cases where it is ABSOLUTELY NECESSARY. Occasionally, an update to a feature will change the underlying architecture in such a fundamental way that the old paradigm cannot coexist with the new one no matter how much redundant code one would create. While this kind of scenario is extremely rare, and every effort should be made to find creative solutions to avoid it, there are occasionally cases where it truly is impossible to maintain both methods even in the short term. This level should only be used with broad developer consensus, after the majority of active developers familiar with the feature in question have given at least some thought to trying to deprecate gracefully and failed. This level should also be used for macro and method stubs containing only an error message describing what was removed and why, as well as if an API feature is found to have a security vulnerability which can't be fixed.&lt;br /&gt;
&lt;br /&gt;
APIs that are clearly labeled as being experimental, such as a WML tag having &amp;quot;experimental&amp;quot; in the name or a lua function having &amp;quot;experimental&amp;quot; in its name or package, can be be removed or deprecated at any level at any time. These are APIs which UMC authors use at their own risk.&lt;br /&gt;
&lt;br /&gt;
== Rationale ==&lt;br /&gt;
The above policy is the result of a large amount of thought, discussion, and debate. Following is a brief outline of the considerations and goals on both sides of the problem, why there is an inherent conflict between them, some failed approaches to resolving the conflict, and how the final policy ultimately maximizes the pursuit of both goals.&lt;br /&gt;
&lt;br /&gt;
=== The Problem - The paradox of progress ===&lt;br /&gt;
Invariably, as development on any project moves forward, developers will realize that there are better, cleaner, or more elegant ways to structure things than they had been previously. These changes can be to improve efficiency, make an API more intuitive, keep code better organized, make common tasks more straightforward, or accomplish any number of other positive things. These changes can also make the development of additional features much more viable. In short, progress is good.&lt;br /&gt;
&lt;br /&gt;
On the other hand, a content-heavy program such as Wesnoth relies on the ability of content creators to efficiently create, maintain, and update their content. Too many changes all at once will force creators of existing content to spend obscene amounts time updating their creations just to keeping them up-to-date and in working order. This can lead to a high amount of frustration, a drop in motivation, and a decline in content being created. In short, progress is bad.&lt;br /&gt;
&lt;br /&gt;
=== Backwards Compatibility - benefits and drawbacks ===&lt;br /&gt;
Most of the time, older paradigms can still be maintained in a manner in which they coexist with the newer ones. This allows for existing content to continue functioning, while at the same time allowing and encouraging new content to be created using the newer methods. However, maintaining such code can be problematic in the following ways:&lt;br /&gt;
#There may eventually be architectural changes a developer would want to make where the old method's square peg no longer fits, even forcibly, into the new method's round hole.&lt;br /&gt;
#Having compatibility code hanging around may, depending on how it is implemented, mean that any updates made to the feature, module, or subsystem in question would have to made in both the new, cleaner design, and the older, poorly structured one, adding more work for developers.&lt;br /&gt;
&lt;br /&gt;
=== The Naive Approach - Deprecate and remove everything old ===&lt;br /&gt;
One approach to balancing old and new is to deprecate the old and slate its eventual removal after either a certain amount of time has passed or a certain number of subsequent versions have been released. This sounds good in theory, but in practice, there will be many changes which are minor or cosmetic in nature and which will add up. Things like replacing macros with WML tags, updating the name of an API call or order of parameters to be more consistent with other similar functions, or switching from a functional to an object-oriented structure are very good for organizational purposes, but will result in a large amount of maintenance required on the part of content creators to keep existing code operational, and for very little real gain. This approach invariably leads to the situation where so much is being changed from one version to the next that creators turn into maintainers, forced to spend nearly all of their time trying to stay ahead of the update curve in an attempt to keep their existing content working, and leaving them very little time and motivation to create new content. And of course, by the time they're finished painstakingly updating their existing code for every little change made for the current release, whoops, there's a new release with a whole slew of new changes that need accounting for. It simply becomes unmanageable.&lt;br /&gt;
&lt;br /&gt;
=== The Naive Approach - Deprecate and remove only when necessary ===&lt;br /&gt;
The opposite approach would be to keep all existing paradigms until they actively interfere with a new architecture or create a double-maintenance problem. While this approach does cut down on the maintenance burden by ensuring that content using an older design continues to work, it hinders progress by the fact that the moment at which it first becomes clear that an architectural or double-maintenance problem will occur is exactly the same moment at which keeping the old structure around becomes problematic. Beginning a deprecation cycle at that point and then having to &amp;quot;wait out&amp;quot; the old paradigm will cause an unacceptable delay in development.&lt;br /&gt;
&lt;br /&gt;
=== The Middle Ground - Deprecate everything old, remove only when necessary ===&lt;br /&gt;
Most of the time, older APIs can be implemented in terms of their newer, cleaner counterparts through the use of things like simple wrappers, parse-translators which re-write the older paradigm's code in terms of the new one, or other relatively low-maintenance &amp;quot;set-it-and-forget-it&amp;quot; approaches. These simple wrappers are not really detrimental to making progress, don't require updating when the new APIs internals are changed, and can usually be organized into their own files and/or modules so that they don't clutter the cleaner code. Many such wrappers will never truly present either of the backwards compatibility drawbacks mentioned above. As such, there is really no detriment to keeping them around indefinitely. However, occasionally, a new idea or approach will be put forth that updates the newer paradigm in such a way that the older one can no longer cleanly wrap to it. This usually happens, as inspiration is wont to do, suddenly, unexpectedly, and without warning. As such developers need the flexibility to be able to remove outdated code as freely as possible when the situation requires. Therefore, the ideal solution would be to deprecate any API which has newer, feature-complete ways to do it, while leaving it in the codebase until such time as its presence becomes a hindrance. Essentially, deprecation need not necessarily mean &amp;quot;this WILL be removed&amp;quot; so much as &amp;quot;this is now a candidate for removal&amp;quot;. By separating the concepts of deprecation and removal, both goals can be better served.&lt;br /&gt;
&lt;br /&gt;
=== Undefined removal timeline - issues encountered ===&lt;br /&gt;
In practice however, simply stating something is a candidate for removal while providing no further information on when it will actually be removed causes multiple issues:&lt;br /&gt;
* When a deprecated API is causing a maintenance burden worthy of removal is a subjective decision, often leading to debates over removal any time a developer decides it's time for an API to be removed, initially deprecated, or moved to a higher deprecation level.&lt;br /&gt;
* Lack of developer incentive to provide good documentation and support for the deprecation of the API given there's no particular timeline for when it will actually cause issues for UMC authors.&lt;br /&gt;
* UMC authors often don't find out about deprecated APIs and so can't possibly migrate to the new APIs.&lt;br /&gt;
* UMC authors aren't provided the documentation or tooling support needed to make updating their add-ons easier.&lt;br /&gt;
* UMC authors may simply decide there's no reason to update to the new API even if they know it's deprecated and how to update their add-on. After all, why spend time updating APIs that may stick around forever?&lt;br /&gt;
* Giving a version that an API '''may''' be removed instead of a version that it '''will''' be removed is not as clear as it may seem to UMC authors who aren't already aware of how Wesnoth handles deprecation. This can lead to UMC authors ignoring deprecation warnings after seeing such warnings for APIs which provide a version that's years old.&lt;br /&gt;
&lt;br /&gt;
=== Certainty is also a benefit ===&lt;br /&gt;
Wesnoth continues to exist today in large part because of the content made by its community. As such, developers should always be sparing in what they choose to deprecate and what they choose to remove, so that UMC authors can update their content to the latest version of Wesnoth without needing to make a herculean effort every couple of years.&lt;br /&gt;
&lt;br /&gt;
But, for cases where APIs are removed, the benefit of providing certainty for when that will happen outweighs the flexibility of being able remove them at any time after they been marked as deprecated. It encourages developers to provide the documentation and tooling support to make it easier for UMC authors to update their add-ons, and it lets UMC authors know when they can expect deprecated APIs to be removed rather than it effectively happening at random when a developer decides a deprecated API needs to be dropped.&lt;br /&gt;
&lt;br /&gt;
=== More Complex Cases - One size does not fit all ===&lt;br /&gt;
There may, however, be cases where the obsolete API cannot be implemented cleanly in terms of the updated one and must be maintained separately, or, in extremely rare cases, cannot coexist at all. There needs to be some leeway for such cases as well. In the former case, it therefore makes sense to allow for a feature to be deprecated pending removal after the shortest reasonable deprecation period. In the latter case, there is obviously no choice but to make the change and remove the old immediately. Developers should, naturally, be encouraged to find creative solutions to avoid such cases, but it is inevitable that there will eventually be a few cases where no graceful transition procedure can be found. These more aggressive forms of deprecation should only be done with developer consensus, and only after all options of creating a backwards-compatible transition have been exhausted.&lt;br /&gt;
&lt;br /&gt;
=== Graphics - The exception that proves the rule ===&lt;br /&gt;
The one area where backwards compatibility should NOT be a factor is graphical changes. Any change to the terrain graphics, unit sprites, or portrait images has the potential to result in visually-incompatible custom content. Core content creators cannot be expected to maintain a deprecated visual style alongside a more modern one, as any approach toward doing so would add an unreasonable amount of bloat and overhead, and make it very difficult for core graphics to be updated without having to do double the work. In addition, add-ons will continue to function even with such visual incompatibilities present, they just won't look right. As such, it can be said that stylistic incompatibilities fall more within the realm of content than of code, and it is not unreasonable to expect a content creator to... well...  create content. Expecting the graphical style to remain backwards-compatible would be just as unreasonable as expecting stories, help descriptions, or other forms of lore to never change because they may introduce plot holes into add-on stories. Essentially, since the goal of the software portion of Wesnoth is, at its heart, merely to facilitate the creation and advancement of this kind of content, core content needs to be free to develop unhindered by considerations for add-on content.&lt;/div&gt;</summary>
		<author><name>Soliton</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.wesnoth.org/index.php?title=StandardAbilityFilter&amp;diff=75017</id>
		<title>StandardAbilityFilter</title>
		<link rel="alternate" type="text/html" href="https://wiki.wesnoth.org/index.php?title=StandardAbilityFilter&amp;diff=75017"/>
		<updated>2026-04-30T15:25:46Z</updated>

		<summary type="html">&lt;p&gt;Soliton: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;From [[FilterWML]], this is the experimental way to filtering ability inside [[StandardUnitFilter]] {{DevFeature1.17|17}}.&lt;br /&gt;
&lt;br /&gt;
It is used to filter out abilities or special weapons using multiple attributes simultaneously (ability type, ID, but also if it affects adjacent units, etc.). The concept is still experimental and developers should keep in mind that it is still possible that it will be removed for stable version 1.20 if it is not validated in version 1.19.&lt;br /&gt;
&lt;br /&gt;
The term [[StandardAbilityFilter]] means that the set of such keys and tags (see below) can appear at that point. Often a [[StandardAbilityFilter]] needs to be included in a [experimental_filter_ability] or [experimental_filter_ability_active],tag. In [overwrite] subtags in weapon specials [experimental_filter_specials] use also [[StandardAbilityFilter]].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The following attributes and sub-tags are allowed:&lt;br /&gt;
&lt;br /&gt;
* '''tag_name''': matches with the specified ability types. If tag_name=heals then any ability [heals] will match.&lt;br /&gt;
* '''id''': unit has an ability with the given id. This can be a comma-separated list. The unit must have at least one of the specified abilities.&lt;br /&gt;
* '''affect_self''': matches abilities with ''affect_self'' having the specified value, this value is true by default in abilities.&lt;br /&gt;
* '''affect_enemies''': matches abilities with ''affect_enemies'' having the specified value, this value is false by default in abilities.&lt;br /&gt;
* '''affect_allies''': matches abilities with ''affect_allies'' having the specified value; however ''affect_alllies'' does not have a default value because its absence within an ability means that it only affects units on the same side as the possessor of it. So if ''affect_allies=none'' is checked, this will correspond to any ability not using this attribute.&lt;br /&gt;
* '''affect_adjacent''': match abilities with or without the [affect_adjacent] subtag. If the value is yes, matches abilities with this subtag.&lt;br /&gt;
* '''type''': specific to [plagues], match if the ability used as a weapon uses a matching type. If ''type=Walking Corpse'', any weapon transforming a killed unit into that unit type will match. Other abilities using ''type'' can also be checked.&lt;br /&gt;
* '''replacement_type''' {{DevFeature1.17|23}}: specific to [damage_type], match if the ability used as a weapon uses a matching type. If ''replacement_type=arcane'', any weapon who replace any type of damage by arcane will match.&lt;br /&gt;
* '''alternative_type''' {{DevFeature1.17|23}}: specific to [damage_type], match if the ability used as a weapon uses a matching type. If ''alternative_type=arcane'', any weapon who add arcane to type of damage will match.&lt;br /&gt;
* '''active_on''': for abilities used as weapons and [resistance], check if the unit is active in the specified situation. If ''active_on=defense'', then corresponds to active abilities only in defense. This attribute has the value ''both'' by default in these abilities.&lt;br /&gt;
* '''apply_to''': In special weapons, checks if the weapon applies to self, opponent, attacker and defender, ''apply_to=self'' by default. In resistance ''apply_to'' is used to determine the type of attack for which the resistance must be modified; it is not recommended to check an ability [resistance] with this attribute. {{DevFeature1.19|1}} It is modified to do an inclusion check for a comma-separated list of damage types in [resistance] abilities&lt;br /&gt;
* '''cumulative''': checks whether or not the cumulative option is used in abilities like [leadership] and all specials returning a numeric value.&lt;br /&gt;
* '''value''': if for example ''value=10-50'', all abilities with value between 10 and 50 will match, [drains] without specified value will also match, [leadership], [illuminates], [heals], [regenerate] and [heal_on_hit] have default value equals to 0, [berserk] has default value to 1 and [drains] an value by default to 50. Abilities without a default value like [teleport] or [hides] but also '[dummy]' abilities will not be able to match. {{DevFeature1.19|0}} If '''value=default''' and the ability does have a default value like [drains], then match if the value (specified or not) equals the default value.&lt;br /&gt;
* '''add, sub, multiply and divide''': as for value, match if the ability uses the specified attribute with the correct value. For add and sub, if ''add=10'' checked and an ability uses ''sub=-10'', it will match. Multiply and divide do not have this reversibility.&lt;br /&gt;
* '''overwrite_specials''': works with capabilities using this attribute with the option specified ''none'', ''one_side'' or ''both_sides''. If ''overwrite_specials=none'' is checked, abilities without overwrite_specials will match.&lt;br /&gt;
* '''[filter_wml]''' {{DevFeature1.19|0}}: Converts the ability to WML and tests it against a [[FilterWML#Filtering_on_WML_data|WML filter]]. Note that this is slower than other methods, so if possible it's better to use other filter keys; but it can be used to check sub-tags or keys that don't exist in [[StandardAbilityFilter]].&lt;br /&gt;
&lt;br /&gt;
== See Also ==&lt;br /&gt;
&lt;br /&gt;
* [[FilterWML]]&lt;br /&gt;
* [[AbilitiesWML]]&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=CompatibilityStandardsV2&amp;diff=74998</id>
		<title>CompatibilityStandardsV2</title>
		<link rel="alternate" type="text/html" href="https://wiki.wesnoth.org/index.php?title=CompatibilityStandardsV2&amp;diff=74998"/>
		<updated>2026-04-23T19:07:47Z</updated>

		<summary type="html">&lt;p&gt;Soliton: /* Deprecation levels - When to remove deprecated features */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;As a piece of software matures, there are often new designs, paradigms, and idioms developed which are superior to old ones. This creates an inherent conflict between the need for progress and the need for compatibility. Wesnoth is no exception. This document describes Wesnoth's approach toward resolving that conflict in a way which is most beneficial to both goals, as well as the rationale behind this approach.&lt;br /&gt;
&lt;br /&gt;
== Policy ==&lt;br /&gt;
This policy defines how the creation of new Wesnoth APIs and the deprecation and removal of old ones are to be handled. For the purposes of this document &amp;quot;API&amp;quot; means &amp;quot;any technical channel by which a content creator interacts with the game engine&amp;quot;. This includes, but is not limited to: preprocessor macros, WML tags, WFL functions, IPFs, and the Lua API. Note that this policy applies only to software APIs. Core content such as sprites, portraits, animations, lore, etc. are to be updated freely, without consideration for stylistic or literary conflicts that such content changes may present to add-ons.&lt;br /&gt;
&lt;br /&gt;
=== When to deprecate ===&lt;br /&gt;
==== Adding a better API ====&lt;br /&gt;
Any time a superior API is introduced which has '''complete feature-parity''' with an existing API, the old one should be immediately deprecated. Note that in most cases, in order to be considered to have &amp;quot;complete feature-parity&amp;quot;, the API should be available in the same language or area of the code as the obsolete one was. For example, the introduction of a more powerful API in Lua which can accomplish a superset of the functionality which had previously been available with a certain WML tag would not obsolete that WML tag. Exceptions can be made to this rule in cases where it is clear that the feature does not make a lot of sense in its current language or area, and was merely there for legacy reasons (such as the proper place for it not having been introduced yet at the time of its creation). Such exceptions should be determined by developer consensus.&lt;br /&gt;
&lt;br /&gt;
==== Preventing needed fixes or improvements ====&lt;br /&gt;
In such cases where a feature is preventing an important new feature from being added or makes it impossible to fix a problem impacting players, it can be preferable to deprecate the API to allow for the necessary changes to be made. APIs deprecated for this reason should still follow the deprecation schedule as normal, unless the fix or improvement is urgently needed.&lt;br /&gt;
&lt;br /&gt;
==== Actively harmful ====&lt;br /&gt;
If an API is found to cause significant problems for players or UMC authors, such as being prone to causing crashes while also very difficult to properly fix, corrupting saves and replays when not used correctly while being difficult to use correctly, or other similar situations, then such APIs should be deprecated and removed regardless of whether there is a replacement available.&lt;br /&gt;
&lt;br /&gt;
==== Unused ====&lt;br /&gt;
Any API that is not used in mainline and also is not used by the most recent version of an add-on on the add-ons server of the current or previous stable release can be deprecated. For example, if an add-on for 1.16 uses a deprecated API but the updated version of the add-on for 1.18 does not, then that add-on is not considered as currently using the API. Once deprecated for this reason, a new add-on being uploaded that uses the API is not a reason to undeprecate it.&lt;br /&gt;
&lt;br /&gt;
This does not need to be a passive process where developers simply check the add-ons server for whether an API is used - developers who want to deprecate an API for removal can proactively talk to and work with UMC authors to help update their add-ons to remove usage of said API. This can be anything from talking with them online about how to update to submitting updated code directly (ie: opening a PR against an add-on's public git repository).&lt;br /&gt;
&lt;br /&gt;
Deprecating and then removing APIs that are unused is the most preferred approach since their removal does not have any impact on UMC authors.&lt;br /&gt;
&lt;br /&gt;
=== When NOT to deprecate ===&lt;br /&gt;
==== Style ====&lt;br /&gt;
Deprecation should not be done purely for reasons of style. This is very subjective and prone to change as new contributors join and current contributors leave or become less active. As such, allowing deprecation for stylistic reasons would lead to entirely unnecessary work for UMC authors as developer preferences change over time.&lt;br /&gt;
&lt;br /&gt;
==== Renaming ====&lt;br /&gt;
While there can be exceptions, it is rarely a net positive to deprecate an API simply for the sake of renaming it to something else. It is preferable to either add a second name for the same function, leaving the old name as-is, or simply live with the current name rather than expecting all UMC authors using the API to update to the new name.&lt;br /&gt;
&lt;br /&gt;
==== Any other reason ====&lt;br /&gt;
Accepted reasons for deprecating APIs should be something that's discussed and agreed upon by the development team while also, ideally, including UMC authors. It should not become the norm that additional reasons to deprecate APIs are treated as exceptions and left as an increasingly forgotten discussion on Discord, IRC, or the forums - they should be added to here with the reasoning behind them.&lt;br /&gt;
&lt;br /&gt;
=== Deprecation awareness ===&lt;br /&gt;
==== Conflicting goals ====&lt;br /&gt;
When deprecating APIs there is an inherent conflict in terms of how to make UMC authors aware of the deprecation. After all, if they aren't aware something is deprecated, they can't know they may need to update their add-on. Therefore, deprecations need to be displayed in a place where they will see them and most UMC authors don't look at Wesnoth's logs unless there's some other issue they're investigating. At the same time, deprecation warnings aren't relevant to players and spamming deprecation warnings is not an effective way of communicating what the issues are.&lt;br /&gt;
&lt;br /&gt;
==== A middle ground ====&lt;br /&gt;
Each deprecated feature should make use of an appropriate deprecation function call for that language or subsystem to ensure that the appropriate deprecation notice is printed to the log output. Additionally, deprecation warnings should be displayed in-game in the following cases:&lt;br /&gt;
* If the player is running a development version, level 3 and level 4 deprecations should be shown in-game by default.&lt;br /&gt;
* If the player enables debug mode then all deprecation warnings should be shown, regardless of whether they're using a stable release or a development release.&lt;br /&gt;
&lt;br /&gt;
==== Documentation ====&lt;br /&gt;
It is also not enough to only display a warning at runtime when something deprecated is encountered. It is the responsibility of the development team to proactively make UMC authors aware of the deprecations and removals being done. To accomplish this:&lt;br /&gt;
* When an API is deprecated, and again if it's later removed, its deprecation or removal must be documented in the appropriate section of the changelog for the version it was deprecated or removed in.&lt;br /&gt;
* Likewise, it should be added to https://wiki.wesnoth.org/CompatibilityBreakingChanges&lt;br /&gt;
&lt;br /&gt;
Additionally, it is not enough to simply say that an API is deprecated. In the deprecation message itself as well as in the changelog and https://wiki.wesnoth.org/CompatibilityBreakingChanges, a description must be included as to why it was deprecated or removed and how UMC authors can update their add-ons to address it.&lt;br /&gt;
&lt;br /&gt;
Lastly, it should be understood that &amp;quot;removed&amp;quot; doesn't necessarily mean that the API is entirely gone from Wesnoth's codebase. There is no maintenance burden to keeping macro or method stubs that do nothing aside from printing an error message describing what was removed and why. Keeping such stubs around is highly encouraged as it is helpful for UMC authors trying to update very old add-ons to the current version of Wesnoth.&lt;br /&gt;
&lt;br /&gt;
=== How to deprecate ===&lt;br /&gt;
Every effort should be made to create the simplest possible wrappers which will translate from an obsolete API to the updated one. Such wrappers should ideally be organized into their own compatibility file or module, and set up in such a way that the internals of the updated API will not affect how the old calls get wrapped to the new one. Essentially, the idea is to create a set-it-and-forget-it compatibility wrapper which will continue to work regardless of updates made to the newer API.&lt;br /&gt;
&lt;br /&gt;
Additionally, in all cases where it's practical, the wmllint tool must be updated to be able to automatically handle updating add-ons for anything that's been deprecated except for APIs deprecated at level 1. While developers are still heavily encouraged to add wmllint support for level 1 deprecations, it is not required as these do not show deprecation warnings by default and are expected to continue working indefinitely.&lt;br /&gt;
&lt;br /&gt;
=== Deprecation levels - When to remove deprecated features ===&lt;br /&gt;
While creating simple compatibility wrappers should be possible most of the time, it would be unreasonable to assume that this approach will be viable in absolutely every case. Wesnoth's compatibility policy therefore has four different levels of deprecation which are used to set expectations for when and if an API is expected to be removed:&lt;br /&gt;
&lt;br /&gt;
#Deprecated indefinitely &amp;amp;mdash; This deprecation level is for changes which have newer preferred alternatives but, barring any unforeseen issues, have little to no maintenance impact and should be kept indefinitely in order to reduce the work required for UMC authors to maintain their content. For example, functions or attributes which have had their names changed, macros which have been replaced with tags, or simple wrappers with little to no maintenance overhead. If future large scale changes make it impractical to maintain an API deprecated at this level then the deprecation level should be raised accordingly. This is generally the preferred deprecation level - higher deprecation levels are for APIs which are intended for eventual removal and must be weighed against the maintenance work this forces upon UMC authors.&lt;br /&gt;
#Deprecated with the intention of future removal &amp;amp;mdash; This deprecation level is for APIs which will be removed in a future version, but the version they are removed in has not yet been decided. Barring urgent circumstances, all APIs that are deprecated with the intention of being removed '''must''' start with being deprecated at level 2 for 1-2 development cycles at minimum depending on the impact of the API's removal on UMC authors. Once the API has spent the necessary amount of time at deprecation level 2, it can be moved to deprecation level 3. It is not allowed to deprecate an API at level 2 and change it to level 3 in the same development cycle. There is no maximum amount of time that an API can remain deprecated at level 2.&lt;br /&gt;
#Deprecated for removal in a specific version &amp;amp;mdash; This deprecation level is for APIs which were previously deprecated at level 2 and now have a future version at which they will be removed. The version an API is removed in must be at least two development cycles after the API was deprecated at level 2. It is not allowed to move an API to deprecation level 3 and then remove it in the same development cycle.&lt;br /&gt;
#Removed without deprecation &amp;amp;mdash; This level should be used EXTREMELY rarely, and only in cases where it is ABSOLUTELY NECESSARY. Occasionally, an update to a feature will change the underlying architecture in such a fundamental way that the old paradigm cannot coexist with the new one no matter how much redundant code one would create. While this kind of scenario is extremely rare, and every effort should be made to find creative solutions to avoid it, there are occasionally cases where it truly is impossible to maintain both methods even in the short term. This level should only be used with broad developer consensus, after the majority of active developers familiar with the feature in question have given at least some thought to trying to deprecate gracefully and failed. This level should also be used for macro and method stubs containing only an error message describing what was removed and why, as well as if an API feature is found to have a security vulnerability which can't be fixed.&lt;br /&gt;
&lt;br /&gt;
APIs that are clearly labeled as being experimental, such as a WML tag having &amp;quot;experimental&amp;quot; in the name or a lua function having &amp;quot;experimental&amp;quot; in its name or package, can be be removed or deprecated at any level at any time. These are APIs which UMC authors use at their own risk.&lt;br /&gt;
&lt;br /&gt;
== Rationale ==&lt;br /&gt;
The above policy is the result of a large amount of thought, discussion, and debate. Following is a brief outline of the considerations and goals on both sides of the problem, why there is an inherent conflict between them, some failed approaches to resolving the conflict, and how the final policy ultimately maximizes the pursuit of both goals.&lt;br /&gt;
&lt;br /&gt;
=== The Problem - The paradox of progress ===&lt;br /&gt;
Invariably, as development on any project moves forward, developers will realize that there are better, cleaner, or more elegant ways to structure things than they had been previously. These changes can be to improve efficiency, make an API more intuitive, keep code better organized, make common tasks more straightforward, or accomplish any number of other positive things. These changes can also make the development of additional features much more viable. In short, progress is good.&lt;br /&gt;
&lt;br /&gt;
On the other hand, a content-heavy program such as Wesnoth relies on the ability of content creators to efficiently create, maintain, and update their content. Too many changes all at once will force creators of existing content to spend obscene amounts time updating their creations just to keeping them up-to-date and in working order. This can lead to a high amount of frustration, a drop in motivation, and a decline in content being created. In short, progress is bad.&lt;br /&gt;
&lt;br /&gt;
=== Backwards Compatibility - benefits and drawbacks ===&lt;br /&gt;
Most of the time, older paradigms can still be maintained in a manner in which they coexist with the newer ones. This allows for existing content to continue functioning, while at the same time allowing and encouraging new content to be created using the newer methods. However, maintaining such code can be problematic in the following ways:&lt;br /&gt;
#There may eventually be architectural changes a developer would want to make where the old method's square peg no longer fits, even forcibly, into the new method's round hole.&lt;br /&gt;
#Having compatibility code hanging around may, depending on how it is implemented, mean that any updates made to the feature, module, or subsystem in question would have to made in both the new, cleaner design, and the older, poorly structured one, adding more work for developers.&lt;br /&gt;
&lt;br /&gt;
=== The Naive Approach - Deprecate and remove everything old ===&lt;br /&gt;
One approach to balancing old and new is to deprecate the old and slate its eventual removal after either a certain amount of time has passed or a certain number of subsequent versions have been released. This sounds good in theory, but in practice, there will be many changes which are minor or cosmetic in nature and which will add up. Things like replacing macros with WML tags, updating the name of an API call or order of parameters to be more consistent with other similar functions, or switching from a functional to an object-oriented structure are very good for organizational purposes, but will result in a large amount of maintenance required on the part of content creators to keep existing code operational, and for very little real gain. This approach invariably leads to the situation where so much is being changed from one version to the next that creators turn into maintainers, forced to spend nearly all of their time trying to stay ahead of the update curve in an attempt to keep their existing content working, and leaving them very little time and motivation to create new content. And of course, by the time they're finished painstakingly updating their existing code for every little change made for the current release, whoops, there's a new release with a whole slew of new changes that need accounting for. It simply becomes unmanageable.&lt;br /&gt;
&lt;br /&gt;
=== The Naive Approach - Deprecate and remove only when necessary ===&lt;br /&gt;
The opposite approach would be to keep all existing paradigms until they actively interfere with a new architecture or create a double-maintenance problem. While this approach does cut down on the maintenance burden by ensuring that content using an older design continues to work, it hinders progress by the fact that the moment at which it first becomes clear that an architectural or double-maintenance problem will occur is exactly the same moment at which keeping the old structure around becomes problematic. Beginning a deprecation cycle at that point and then having to &amp;quot;wait out&amp;quot; the old paradigm will cause an unacceptable delay in development.&lt;br /&gt;
&lt;br /&gt;
=== The Middle Ground - Deprecate everything old, remove only when necessary ===&lt;br /&gt;
Most of the time, older APIs can be implemented in terms of their newer, cleaner counterparts through the use of things like simple wrappers, parse-translators which re-write the older paradigm's code in terms of the new one, or other relatively low-maintenance &amp;quot;set-it-and-forget-it&amp;quot; approaches. These simple wrappers are not really detrimental to making progress, don't require updating when the new APIs internals are changed, and can usually be organized into their own files and/or modules so that they don't clutter the cleaner code. Many such wrappers will never truly present either of the backwards compatibility drawbacks mentioned above. As such, there is really no detriment to keeping them around indefinitely. However, occasionally, a new idea or approach will be put forth that updates the newer paradigm in such a way that the older one can no longer cleanly wrap to it. This usually happens, as inspiration is wont to do, suddenly, unexpectedly, and without warning. As such developers need the flexibility to be able to remove outdated code as freely as possible when the situation requires. Therefore, the ideal solution would be to deprecate any API which has newer, feature-complete ways to do it, while leaving it in the codebase until such time as its presence becomes a hindrance. Essentially, deprecation need not necessarily mean &amp;quot;this WILL be removed&amp;quot; so much as &amp;quot;this is now a candidate for removal&amp;quot;. By separating the concepts of deprecation and removal, both goals can be better served.&lt;br /&gt;
&lt;br /&gt;
=== Undefined removal timeline - issues encountered ===&lt;br /&gt;
In practice however, simply stating something is a candidate for removal while providing no further information on when it will actually be removed causes multiple issues:&lt;br /&gt;
* When a deprecated API is causing a maintenance burden worthy of removal is a subjective decision, often leading to debates over removal any time a developer decides it's time for an API to be removed, initially deprecated, or moved to a higher deprecation level.&lt;br /&gt;
* Lack of developer incentive to provide good documentation and support for the deprecation of the API given there's no particular timeline for when it will actually cause issues for UMC authors.&lt;br /&gt;
* UMC authors often don't find out about deprecated APIs and so can't possibly migrate to the new APIs.&lt;br /&gt;
* UMC authors aren't provided the documentation or tooling support needed to make updating their add-ons easier.&lt;br /&gt;
* UMC authors may simply decide there's no reason to update to the new API even if they know it's deprecated and how to update their add-on. After all, why spend time updating APIs that may stick around forever?&lt;br /&gt;
* Giving a version that an API '''may''' be removed instead of a version that it '''will''' be removed is not as clear as it may seem to UMC authors who aren't already aware of how Wesnoth handles deprecation. This can lead to UMC authors ignoring deprecation warnings after seeing such warnings for APIs which provide a version that's years old.&lt;br /&gt;
&lt;br /&gt;
=== Certainty is also a benefit ===&lt;br /&gt;
Wesnoth continues to exist today in large part because of the content made by its community. As such, developers should always be sparing in what they choose to deprecate and what they choose to remove, so that UMC authors can update their content to the latest version of Wesnoth without needing to make a herculean effort every couple of years.&lt;br /&gt;
&lt;br /&gt;
But, for cases where APIs are removed, the benefit of providing certainty for when that will happen outweighs the flexibility of being able remove them at any time after they been marked as deprecated. It encourages developers to provide the documentation and tooling support to make it easier for UMC authors to update their add-ons, and it lets UMC authors know when they can expect deprecated APIs to be removed rather than it effectively happening at random when a developer decides a deprecated API needs to be dropped.&lt;br /&gt;
&lt;br /&gt;
=== More Complex Cases - One size does not fit all ===&lt;br /&gt;
There may, however, be cases where the obsolete API cannot be implemented cleanly in terms of the updated one and must be maintained separately, or, in extremely rare cases, cannot coexist at all. There needs to be some leeway for such cases as well. In the former case, it therefore makes sense to allow for a feature to be deprecated pending removal after the shortest reasonable deprecation period. In the latter case, there is obviously no choice but to make the change and remove the old immediately. Developers should, naturally, be encouraged to find creative solutions to avoid such cases, but it is inevitable that there will eventually be a few cases where no graceful transition procedure can be found. These more aggressive forms of deprecation should only be done with developer consensus, and only after all options of creating a backwards-compatible transition have been exhausted.&lt;br /&gt;
&lt;br /&gt;
=== Graphics - The exception that proves the rule ===&lt;br /&gt;
The one area where backwards compatibility should NOT be a factor is graphical changes. Any change to the terrain graphics, unit sprites, or portrait images has the potential to result in visually-incompatible custom content. Core content creators cannot be expected to maintain a deprecated visual style alongside a more modern one, as any approach toward doing so would add an unreasonable amount of bloat and overhead, and make it very difficult for core graphics to be updated without having to do double the work. In addition, add-ons will continue to function even with such visual incompatibilities present, they just won't look right. As such, it can be said that stylistic incompatibilities fall more within the realm of content than of code, and it is not unreasonable to expect a content creator to... well...  create content. Expecting the graphical style to remain backwards-compatible would be just as unreasonable as expecting stories, help descriptions, or other forms of lore to never change because they may introduce plot holes into add-on stories. Essentially, since the goal of the software portion of Wesnoth is, at its heart, merely to facilitate the creation and advancement of this kind of content, core content needs to be free to develop unhindered by considerations for add-on content.&lt;/div&gt;</summary>
		<author><name>Soliton</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.wesnoth.org/index.php?title=Testers&amp;diff=74990</id>
		<title>Testers</title>
		<link rel="alternate" type="text/html" href="https://wiki.wesnoth.org/index.php?title=Testers&amp;diff=74990"/>
		<updated>2026-04-22T08:50:14Z</updated>

		<summary type="html">&lt;p&gt;Soliton: Created page with &amp;quot;Add yourself here if you are available to test anything around wesnoth and mention what environment (OS, platform, windowing system, etc) you can test and/or debug issues in....&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Add yourself here if you are available to test anything around wesnoth and mention what environment (OS, platform, windowing system, etc) you can test and/or debug issues in. Maybe also mention what kind of issues you're mostly interested in or when you're likely available and which way you can best be reached.&lt;br /&gt;
&lt;br /&gt;
* Soliton: can test+debug on macOS, ios, linux (flatpak, X11), android&lt;br /&gt;
** reachable via IRC/discord/forum/github&lt;/div&gt;</summary>
		<author><name>Soliton</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.wesnoth.org/index.php?title=DevelopersHome&amp;diff=74989</id>
		<title>DevelopersHome</title>
		<link rel="alternate" type="text/html" href="https://wiki.wesnoth.org/index.php?title=DevelopersHome&amp;diff=74989"/>
		<updated>2026-04-22T08:42:18Z</updated>

		<summary type="html">&lt;p&gt;Soliton: /* Communication, Feedback, Events */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== General Information ==&lt;br /&gt;
* Links&lt;br /&gt;
** [http://changelog.wesnoth.org Changelog] - the most recent changes made to the game&lt;br /&gt;
** [https://github.com/wesnoth/wesnoth/commits/master Latest commits] - Up-to-date commit messages&lt;br /&gt;
&lt;br /&gt;
* Coding Guidelines&lt;br /&gt;
** [[Git_for_Wesnoth_Crash_Course]] - guide for contributors who are new to git&lt;br /&gt;
** [[HackingWesnoth]] - guide for programmers&lt;br /&gt;
** [[CodingStandards]] - for programmers&lt;br /&gt;
** [[DeveloperGuide]] - for those who received repository commit rights&lt;br /&gt;
** [[SoftwareTesting]] - for programmers&lt;br /&gt;
&lt;br /&gt;
* Library documentation&lt;br /&gt;
** [http://cppreference.com C++ Reference]&lt;br /&gt;
** [http://www.boost.org/doc/ Boost documentation]&lt;br /&gt;
&lt;br /&gt;
* Debugging Tips&lt;br /&gt;
** [[DebuggingWesnoth]]&lt;br /&gt;
&lt;br /&gt;
== Tools and Packaging ==&lt;br /&gt;
* Supporting Websites&lt;br /&gt;
** [[WesnothRepository]] - accessing the source code&lt;br /&gt;
** http://gettext.wesnoth.org/ - gettext status&lt;br /&gt;
* Compiling and Building&lt;br /&gt;
** [https://github.com/wesnoth/wesnoth/blob/master/INSTALL.md Compiling Wesnoth] - how to compile Battle for Wesnoth (it's not hard)&lt;br /&gt;
* Packaging and Releasing&lt;br /&gt;
** [[ReleasingWesnoth]] - steps to follow to release a new version&lt;br /&gt;
* Documentation&lt;br /&gt;
** Doxygen - Documentation generator&lt;br /&gt;
* More stuff&lt;br /&gt;
** [[MaintenanceTools]] WMLLint, WMLIndent and WMLScope&lt;br /&gt;
** [[UsingGooglePerformanceTools]] to profile Wesnoth CPU and memory usage.&lt;br /&gt;
&lt;br /&gt;
== I want to start coding, what can I do? ==&lt;br /&gt;
* [[EasyCoding]] - Bugs and features that are easy to implement for new coders&lt;br /&gt;
* [[NotSoEasyCoding]] - Bugs and features which are doable but lacking someone working on them&lt;br /&gt;
* [[GettingStarted]]&lt;br /&gt;
* [https://forums.wesnoth.org/viewtopic.php?f=12&amp;amp;t=34904 Frequently Proposed Ideas] - summary of past often-repeated forum discussions&lt;br /&gt;
* [[Glossary]]&lt;br /&gt;
&lt;br /&gt;
== Game - Create content ==&lt;br /&gt;
* [[BuildingScenarios]] and related useful forum discussions: &lt;br /&gt;
** [http://www.wesnoth.org/forum/viewtopic.php?t=4188 Beginning Campaign Development]&lt;br /&gt;
** [http://www.wesnoth.org/forum/viewtopic.php?t=4301 A Balancing Act]&lt;br /&gt;
* [[ReferenceWML]]&lt;br /&gt;
* [[CompatibilityStandards#Deprecation_levels_-_When_to_remove_deprecated_features|DeprecationLevels]]&lt;br /&gt;
&lt;br /&gt;
== Code documentation ==&lt;br /&gt;
* http://devdocs.wesnoth.org - generated code documentation&lt;br /&gt;
* AI&lt;br /&gt;
** [[Wesnoth_AI]] - Starting point for AI documentation&lt;br /&gt;
* Themes&lt;br /&gt;
** [[ThemeSystem]] - customizing the screen layout for the game and the editor&lt;br /&gt;
* Multiplayer&lt;br /&gt;
** [[WesnothdDesign]] - Guide to the design of wesnothd, the multiplayer server.&lt;br /&gt;
* Gui2 - The new Gui-Framework&lt;br /&gt;
** [[GUIWidgetInstanceWML]]&lt;br /&gt;
** [[GUIWidgetDefinitionWML]]&lt;br /&gt;
** [[GUIToolkit]]&lt;br /&gt;
** [[GUILayout]]&lt;br /&gt;
** Gui2 WML&lt;br /&gt;
*** [[GUICanvasWML]]&lt;br /&gt;
*** [[GUIToolkitWML]]&lt;br /&gt;
*** [[WindowDefinitionWML]]&lt;br /&gt;
&lt;br /&gt;
== Communication, Feedback, Events ==&lt;br /&gt;
* http://bugs.wesnoth.org/ - bug reports and feature requests&lt;br /&gt;
* http://patches.wesnoth.org/ - patches/pull requests&lt;br /&gt;
* [[Testers]] - List of people that can test/debug on specific setups (OS, platform, windowing system, etc)&lt;br /&gt;
&lt;br /&gt;
* Mailing lists&lt;br /&gt;
** https://listengine.tuxfamily.org/wesnoth.org/ (old: https://mailman.wesnoth.org/)&lt;br /&gt;
&lt;br /&gt;
* IRC&lt;br /&gt;
** [irc://irc.wesnoth.org/#wesnoth-dev Libera.Chat/#wesnoth-dev] - IRC (alias to irc.libera.chat)&lt;br /&gt;
** http://irclog.wesnoth.org/ - IRC logs&lt;br /&gt;
&lt;br /&gt;
* Forum - http://forum.wesnoth.org&lt;br /&gt;
&lt;br /&gt;
* This wiki - http://www.wesnoth.org/wiki/Main_Page &lt;br /&gt;
&lt;br /&gt;
* FOSDEM&lt;br /&gt;
** [[Fosdem2008]]&lt;br /&gt;
** [[Fosdem2009]]&lt;br /&gt;
** [[Fosdem2010]]&lt;br /&gt;
** [[Fosdem2011]]&lt;br /&gt;
** [[Fosdem2012]]&lt;br /&gt;
&lt;br /&gt;
* Google Summer of Code&lt;br /&gt;
** [[SummerOfCodeIdeas]] - Ideas for GSoC&lt;br /&gt;
** [[SoC_Information_for_Google]] - Our organization profile for Google&lt;br /&gt;
** [[SoC_People_to_bug_on_IRC]] - Who GSoC students can ask for help&lt;br /&gt;
&lt;br /&gt;
== Miscellaneous ==&lt;br /&gt;
* [[DebugMode]] and [[CommandMode]] - in game debugging commands&lt;br /&gt;
* [http://www.wesnoth.org/units/trunk/animations.html Missing unit animations] - what's available and what's missing&lt;br /&gt;
* http://units.wesnoth.org/ - Unit reference&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=CompatibilityBreakingChanges&amp;diff=74972</id>
		<title>CompatibilityBreakingChanges</title>
		<link rel="alternate" type="text/html" href="https://wiki.wesnoth.org/index.php?title=CompatibilityBreakingChanges&amp;diff=74972"/>
		<updated>2026-04-13T12:29:39Z</updated>

		<summary type="html">&lt;p&gt;Soliton: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This lists removed WML functionality and helpful hints for avoiding pitfalls.&lt;br /&gt;
&lt;br /&gt;
The previous list is available [https://forums.wesnoth.org/viewtopic.php?t=58532 here].&lt;br /&gt;
&lt;br /&gt;
== Compatibility breaking changes between 1.18 and 1.19/1.20 ==&lt;br /&gt;
&lt;br /&gt;
=== Compatibility breaking (requires updates to work) ===&lt;br /&gt;
&lt;br /&gt;
* '''[kill]''' now reduces target unit hitpoints to 0 before triggering '''last_breath, die''' events. This affects mentioned events that rely on [have_unit] conditions.&lt;br /&gt;
* WFL Removed properties '''unit.side''' and '''terrain.owner'''. Use '''unit.side_number''' and '''terrain.owner_side''' instead. They return 1-indexed side, removed properties returned 0-indexed side.&lt;br /&gt;
* Abilities with both '''add''' and '''sub''' now calculate value differently&lt;br /&gt;
* rotate_loc_around formula now works&lt;br /&gt;
* [era] with id=era_dunefolk does not exist anymore&lt;br /&gt;
* [side]'s leader attribute has been removed&lt;br /&gt;
* [side]'s [variables] tag is now used to set side variables. Use [side]'s [leader] tag to set a unit variable.&lt;br /&gt;
* Setting gold to decimal value fails with error. Previously it was converted to int automatically. As of 1.19.21, automatic conversion is only done in [gold], but not in Lua or [modify_side].&lt;br /&gt;
* The following macros were removed ([https://github.com/wesnoth/wesnoth/pull/11126 #11126])&lt;br /&gt;
** EARLY_FINISH_BONUS_NOTE&lt;br /&gt;
** NO_EARLY_FINISH_BONUS_NOTE&lt;br /&gt;
** NO_GOLD_CARRYOVER_NOTE&lt;br /&gt;
** NEW_GOLD_CARRYOVER_NOTE_100&lt;br /&gt;
** NEW_GOLD_CARRYOVER_NOTE_40&lt;br /&gt;
** NEW_GOLD_CARRYOVER_NOTE_20&lt;br /&gt;
** MISSILE_FRAME_FIREBALL&lt;br /&gt;
** MESSAGE&lt;br /&gt;
** STORY_PART_SPEECH&lt;br /&gt;
** LOYAL_UNDEAD_UNIT&lt;br /&gt;
** ON_SIGHTING&lt;br /&gt;
** MAKE_AI_SIDE_PERSISTENT&lt;br /&gt;
** DRAKE_FLYING_ANIM&lt;br /&gt;
** NO_INTERRUPT_NO_UNDO&lt;br /&gt;
** ENABLE_NIGHTBLADE&lt;br /&gt;
&lt;br /&gt;
=== Deprecations (will continue to work for now) ===&lt;br /&gt;
* rechange [experimental_filter_ability/active] and [experimental_filter_specials] to [filter_ability] and [filter_specials] and make &amp;quot;experimental_&amp;quot; deprecated.&lt;br /&gt;
&lt;br /&gt;
=== New features (help fill this list, https://wiki.wesnoth.org/Special:WhatLinksHere/Template:DevFeature1.19) ===&lt;br /&gt;
* StandardAbilityFilter, including [https://github.com/wesnoth/wesnoth/pull/7814 7814]&lt;br /&gt;
* [resistance] min_value&lt;br /&gt;
* [attack] alignment&lt;br /&gt;
* New events '''unit_hits''', '''unit_misses'''&lt;br /&gt;
* Positive '''attack_weight''' now affects weapon selection&lt;br /&gt;
* Unit attack [effect]+Lua+formula API min_range and max_range&lt;br /&gt;
* Lua unit attributes fearless and healthy&lt;br /&gt;
* wesnoth.game_config shows some color-related values&lt;br /&gt;
* wesnoth.units.rebuild&lt;br /&gt;
* stringx.ends_with, stringx.starts_with&lt;br /&gt;
* Unit formula new attributes objects, advancements_taken, traits_count, objects_count, advancements_taken_count, fearless, healthy&lt;br /&gt;
* Formula functions lerp_index, ends_with, replace_all, starts_with, get_palette&lt;br /&gt;
* Custom themes https://wiki.wesnoth.org/GUIToolkit#Custom_themes&lt;br /&gt;
* Abilities and specials now support [event] (does not work correctly due to [issue]10819[/issue])&lt;br /&gt;
* Ability &amp;amp; Weapon specials registry ([https://github.com/wesnoth/wesnoth/pull/10644 10644]) (does not work correctly if ability contains [event] due to [issue]10819[/issue])&lt;br /&gt;
* [effect][remove_specials]&lt;br /&gt;
* Expose unit pick dialog to Lua as a simple API call ([https://github.com/wesnoth/wesnoth/pull/8829 8829])&lt;br /&gt;
* [fire_event][data] can be accessed from other event as $data&lt;br /&gt;
* Unit Type Editor&lt;br /&gt;
* [era]auto_sort allows to use custom faction ordering&lt;br /&gt;
* [terrain_defaults] formula is now working as expected in case formula evaluates to null&lt;br /&gt;
* [set_menu_item] description substitutes variables when rightclick is used&lt;br /&gt;
* [defense]&lt;br /&gt;
* [resistance_defaults] is not causing OOS in random maps anymore&lt;br /&gt;
* Ability/weapon special descriptions support po variables in descriptions like '''$add''', '''$sub''' etc that contain the value of the relevant key. ([https://github.com/wesnoth/wesnoth/pull/10053 10053], [https://github.com/wesnoth/wesnoth/pull/10293 10293], [https://github.com/wesnoth/wesnoth/pull/10749 10749])&lt;br /&gt;
* Ability/weapon special help page ids now follow the format: '''ability_&amp;lt;unique_id&amp;gt;''' or '''weaponspecial_&amp;lt;unique_id&amp;gt;''' ([https://github.com/wesnoth/wesnoth/pull/11012 11012]).&lt;br /&gt;
* A lot more functions were added to https://wiki.wesnoth.org/LuaAPI/types/widget with https://wiki.wesnoth.org/index.php?title=LuaAPI%2Ftypes%2Fwidget&amp;amp;type=revision&amp;amp;diff=74843&amp;amp;oldid=74842&lt;/div&gt;</summary>
		<author><name>Soliton</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.wesnoth.org/index.php?title=StandardUnitFilter&amp;diff=74963</id>
		<title>StandardUnitFilter</title>
		<link rel="alternate" type="text/html" href="https://wiki.wesnoth.org/index.php?title=StandardUnitFilter&amp;diff=74963"/>
		<updated>2026-04-10T09:42:25Z</updated>

		<summary type="html">&lt;p&gt;Soliton: Remove nonsensical radius mention&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{WML Tags}}&lt;br /&gt;
&lt;br /&gt;
From [[FilterWML]], this is the standard way of filtering units.&lt;br /&gt;
&lt;br /&gt;
When a unit filter is applied to a map, first it applies to all units on the field,&lt;br /&gt;
based on their coordinates.&lt;br /&gt;
Next it applies to units in the recall list.&lt;br /&gt;
This is important to remember as it means, for example,&lt;br /&gt;
that the tag '''[kill]''' can be used to kill units in the recall list.&lt;br /&gt;
&lt;br /&gt;
You can access the filtered unit within the filter as the ''$this_unit'' variable, see [[SingleUnitWML]] for the possible content of these variables&lt;br /&gt;
&lt;br /&gt;
The term [[StandardUnitFilter]] means that the set of such keys and tags (see below) can appear at that point. Often a [[StandardUnitFilter]] needs to be included in a [filter] tag. But many tags take the [[StandardUnitFilter]] directly as an argument, like [[DirectActionsWML#.5Bkill.5D|[kill]]] and [[ConditionalActionsWML#.5Bhave_unit.5D|[have_unit]]] (which each accept a few additional keys of their own). See [[Special:WhatLinksHere/StandardUnitFilter]] for tags which can contain a StandardUnitFilter.&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
The following attributes and sub-tags are allowed:&lt;br /&gt;
&lt;br /&gt;
* '''id''': unit matches the given id. This is the same as ''id'' in the [unit] tag. Note that it is independent of a unit's user-visible name, which can be internationalized independent of this (see [[SingleUnitWML]]). id= can be a comma-separated list, every unit with one of these ids matches.&lt;br /&gt;
* '''speaker''': alias for id (no comma-separated list supported)&lt;br /&gt;
* '''type''': matches the unit's type name (can be a list of types)&lt;br /&gt;
* '''type_adv_tree''': {{DevFeature1.13|7}} matches the type name of the unit and all its advancements (can be a list)&lt;br /&gt;
* '''race''': the race of the unit type. This can be a comma-separated list; the unit's race must match one of the given races. &amp;lt;br&amp;gt;Mainline races are listed in data/core/units.cfg&amp;lt;br&amp;gt; &lt;br /&gt;
* '''variation''': the unit type variation id (can be a list of variation ids)&lt;br /&gt;
* '''has_variation''': matches if the unit type for the unit defines at least one of the variation ids provided as a comma-separated list&lt;br /&gt;
* '''upkeep''': {{DevFeature1.15|3}} The upkeep of the unit. Can be either a non-negative number or one of the special values ''loyal'', ''free'', ''full''. Note that while ''loyal'' and ''free'' are synonymous with an upkeep of 0, the value ''full'' is not synonymous with any single numeric value – it is equivalent to &amp;lt;code&amp;gt;$this_unit.level&amp;lt;/code&amp;gt;.&lt;br /&gt;
* '''ability''': unit has an ability with the given id; see [[AbilitiesWML]]. This can be a comma-separated list. The unit must have at least one of the specified abilities.&lt;br /&gt;
* '''ability_type''': {{DevFeature1.13|7}} unit has an ability with the given type (tag name) - eg, ''ability_type=heals'' will match a unit with any healing ability.&lt;br /&gt;
* '''ability_type_active''': {{DevFeature1.13|8}} unit has an ''active'' ability with the given type (tag name).&lt;br /&gt;
* '''ability_id_active''': {{DevFeature1.15|13}} unit has an ''active'' ability with the given id; see [[AbilitiesWML]]&lt;br /&gt;
* '''trait''': {{DevFeature1.13|8}} This can be a comma-separated list. The unit must have at least one of the specified traits.&lt;br /&gt;
* '''status''': {{DevFeature1.13|0}} matches if the unit has the specified status active. This can be a comma-separated list, in which case the unit will match as long as it has one of the listed statuses active (note: possible statuses are listed on the [[SingleUnitWML]] page).&lt;br /&gt;
* '''side''': the unit is on the given side (can be a list)&lt;br /&gt;
* '''has_weapon''': the unit has a weapon with the given name {{DevFeature1.13|5}} Now deprecated&lt;br /&gt;
* {{anchor|has_attack|'''[has_attack]'''}}: {{DevFeature1.13|5}} the unit has a weapon matching the [[StandardWeaponFilter]]. If this is present, '''has_weapon''' is ignored.&lt;br /&gt;
* '''canrecruit''': yes if the unit can recruit (i.e. is a leader)&lt;br /&gt;
* '''gender''': female if the unit is female rather than the default of male&lt;br /&gt;
* '''role''': the unit has been assigned the given role; see '''[role]''', [[InternalActionsWML]]&lt;br /&gt;
* '''level''': the level of the unit (this can be a comma-separated list).&lt;br /&gt;
* '''defense''': current defense of the unit on current tile (chance to hit %, like in movement type definitions)&lt;br /&gt;
* '''movement_cost''': current movement cost of the unit on current tile. Can be a number, range, or comma separated range.&lt;br /&gt;
* '''x,y''': the position of the unit. Note: As a special case '''x,y=recall,recall''' matches units on the recall list. Note that the similar '''search_recall_list=yes''' key is only available as part of the '''[have_unit]''' condition tag, and is not otherwise considered part of a StandardUnitFilter.&lt;br /&gt;
* '''find_in''': name of an array or container variable; if present, the unit will not match unless a unit with the same '''id''' is already stored in the variable&lt;br /&gt;
* {{anchor|filter_vision|'''[filter_vision]'''}}: this tests whether or not the unit is currently visible&lt;br /&gt;
** '''visible''': yes or no, default yes. When &amp;quot;yes&amp;quot;, this matches units that are not obscured by fog or shroud, and that are not hiding (via the {{tag|AbilitiesWML|hides}} ability). When &amp;quot;no&amp;quot;, this matches units that are obscured by fog or shroud, or that are hiding.&lt;br /&gt;
** [[StandardSideFilter]] tags and keys. Filter for who may be able to see (or not see) the unit. If there is *at least one* matching side which can see the unit then the filter matches, and otherwise it fails to match.&lt;br /&gt;
* {{anchor|filter_wml|'''[filter_wml]'''}}: Converts the unit to WML (as if by '''[store_unit]''') and tests it against a [[FilterWML#Filtering_on_WML_data|WML filter]]. For a list of things in the WML that could be filtered on, see [[SingleUnitWML]] or open a saved game in a text editor. Note that this is slower than other methods, so if possible it's better to use other filter keys and tags; however, if the WML filter contains only a child '''[variables]''', then the unit is not converted to WML and the filter is matched only against the unit's variables (which are already WML).&lt;br /&gt;
* '''[and]''': an extra unit filter. Unless the unit also matches the [and] filter, then it will not count as a match. ''Note: [and],[or], and [not] filters are considered after the containing filter; they are then processed in the order encountered.''&lt;br /&gt;
* '''[or]''': an extra unit filter. If a unit 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 unit filter. If a unit matches the [not] filter, then that unit will not be considered a match by the containing filter.&lt;br /&gt;
* {{anchor|filter_adjacent|'''[filter_adjacent]'''}} with a StandardUnitFilter as argument. If present the correct number of adjacent units must match this filter.&lt;br /&gt;
**'''StandardUnitFilter''' tags and keys&lt;br /&gt;
** '''count''': a number, range, or comma separated range; default &amp;quot;1-6&amp;quot; {{DevFeature1.19|13}} '''count''' no longer has a default value.&lt;br /&gt;
** '''adjacent''': a comma separated list of directions; default &amp;quot;n,ne,se,s,sw,nw&amp;quot; (see [[StandardLocationFilter#Directions|notes]])&lt;br /&gt;
** '''is_enemy''': a boolean specifying whether the adjacent unit must be an enemy or an ally (optional)&lt;br /&gt;
** '''$other_unit''': {{DevFeature1.13|2}} Within [filter_adjacent], the special variable $other_unit refers to the filtered unit from the enclosing filter, while $this_unit refers (as with all StandardUnitFilters) to the unit being filtered on.&lt;br /&gt;
** '''radius''': {{DevFeature1.19|13}} determines the distance of units that can be filtered and not just adjacent units, '''radius''' is set to 1 by default.&lt;br /&gt;
* '''[filter_location]''': [[StandardLocationFilter]] - the tile that the unit is standing on matches the location filter.&lt;br /&gt;
*'''[filter_side]''': The currently filtered unit's side must match this [[StandardSideFilter]] for the unit to match.&lt;br /&gt;
**[[StandardSideFilter]] tags and keys&lt;br /&gt;
* '''formula''': A formula using [[Wesnoth Formula Language]]. The &amp;lt;tt&amp;gt;self&amp;lt;/tt&amp;gt; variable is set to the current $this_unit, and the formula should return a boolean. If it returns 0, the filter does not match. Otherwise, the filter does match. {{DevFeature1.13|5}} If the filter has a secondary unit, the formula can access it using the &amp;lt;code&amp;gt;other&amp;lt;/code&amp;gt; variable. Both the unit and the secondary unit are a '''unit object''', with keys documented [[#Wesnoth_Formula_Language|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''': the name of a [[LuaWML|Lua]] function in the global environment that takes a unit as an argument and returns true if the given unit matches the filter. {{DevFeature1.13|5}} 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;
* {{anchor|filter_ability|'''[experimental_filter_ability]'''}}: {{DevFeature1.17|17}} [[StandardAbilityFilter]] matches if the unit has an ability with the given properties - eg, ''[experimental_filter_ability]affect_self=yes'' will match a unit with any ability with ''affect_self=yes''. {{DevFeature1.19|5}} [experimental_filter_ability] deprecated, use [filter_ability] instead.&lt;br /&gt;
* {{anchor|filter_ability_active|'''[experimental_filter_ability_active]'''}}: {{DevFeature1.17|17}} [[StandardAbilityFilter]] matches if the unit has an ''active'' ability with the given properties - eg, ''[experimental_filter_ability_active]affect_adjacent=yes'' will match a unit with any ''active'' ability with ''[affect_adjacent]''. The attributes checked are the same as for [experimental_filter_ability].  {{DevFeature1.19|5}} [experimental_filter_ability_active] deprecated, use [filter_ability] instead.&lt;br /&gt;
* '''[filter_ability]''': {{DevFeature1.19|5}} [[StandardAbilityFilter]] matches if the unit has anability with the given properties - eg, ''[filter_ability]affect_adjacent=yes'' will match a unit with any ability with ''[affect_adjacent]''.&lt;br /&gt;
** '''active''': if active=yes, matches if the unit has an ''active'' ability with the given properties, if active=no, matches if the unit has an ability with the given properties regardless of 'active' or not. '''active''' is false by default.&lt;br /&gt;
&lt;br /&gt;
== [[Wesnoth Formula Language]] ==&lt;br /&gt;
&lt;br /&gt;
When using the '''formula''' key, the '''self''' and (if present) '''other''' objects support the following keys:&lt;br /&gt;
&lt;br /&gt;
* '''x''', '''y''', '''loc''' - the latter is a '''location object''' such as what would be returned from [[Wesnoth_Formula_Language#loc|loc()]].&lt;br /&gt;
* '''id'''&lt;br /&gt;
* '''type'''&lt;br /&gt;
* '''name'''&lt;br /&gt;
* '''usage'''&lt;br /&gt;
* '''canrecruit''', '''leader'''&lt;br /&gt;
* '''undead''' - true if the unit has the ''not_living'' status&lt;br /&gt;
* '''attacks''' - a list of '''[[FilterWML#Filtering_Weapons|weapon objects]]'''&lt;br /&gt;
* '''abilities''' - a list of the ability IDs the unit possesses&lt;br /&gt;
* '''hitpoints''', '''max_hitpoints'''&lt;br /&gt;
* '''experience''', '''max_experience'''&lt;br /&gt;
* '''moves''', '''max_moves'''&lt;br /&gt;
* '''attacks_left''', '''max_attacks'''&lt;br /&gt;
* '''level''', '''full''' - '''full''' refers to the unit's level to support the formula &amp;lt;syntaxhighlight lang=wfl inline&amp;gt;upkeep = full&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
* '''traits''' - a list of the trait IDs&lt;br /&gt;
* '''objects''' {{DevFeature1.19|0}} - a list of the objects IDs&lt;br /&gt;
* '''advancements_taken''' {{DevFeature1.19|0}} - a list of the advancements taken IDs&lt;br /&gt;
* '''traits_count''' {{DevFeature1.19|0}} - number of traits used by unit regardless of IDs&lt;br /&gt;
* '''objects_count''' {{DevFeature1.19|0}} -  number of objects used by unit regardless of IDs&lt;br /&gt;
* '''advancements_taken_count''' {{DevFeature1.19|0}} -  number of advancements taken used by unit regardless of IDs&lt;br /&gt;
* '''extra_recruit'''&lt;br /&gt;
* '''advances_to'''&lt;br /&gt;
* '''status''' - a list of active statuses&lt;br /&gt;
* '''side_number'''&lt;br /&gt;
* '''cost'''&lt;br /&gt;
* '''upkeep'''&lt;br /&gt;
* '''loyal''' - a constant 0 to support the formula &amp;lt;syntaxhighlight lang=wfl inline&amp;gt;upkeep = loyal&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
* '''hidden'''&lt;br /&gt;
* '''petrified''' - true if the unit has the '''petrified''' status&lt;br /&gt;
* '''resting'''&lt;br /&gt;
* '''role'''&lt;br /&gt;
* '''race'''&lt;br /&gt;
* '''gender'''&lt;br /&gt;
* '''variation'''&lt;br /&gt;
* '''zoc'''&lt;br /&gt;
* '''alignment'''&lt;br /&gt;
* '''facing'''&lt;br /&gt;
* '''resistance''', '''movement_cost''', '''vision_cost''', '''jamming_cost''', '''defense''' - {{DevFeature1.15|3}} Maps containing the basic movetype data. The '''defense''' and '''resistance''' maps contain the actual defense and resistance values, rather than the values specified in the WML, so you do not need to subtract them from 100.&lt;br /&gt;
* '''flying''' {{DevFeature1.15|3}}&lt;br /&gt;
* '''fearless''', '''healthy''' {{DevFeature1.19|4}}&lt;br /&gt;
* '''vars''' - WFL variables owned by the unit, which can be set and used by FormulaAI&lt;br /&gt;
* '''wml_vars''' - the WML variables stored in the unit&lt;br /&gt;
* '''n''', '''s''', '''ne''', '''se''', '''nw''', '''sw''', '''lawful''', '''chaotic''', '''neutral''', '''liminal''', '''male''', '''female''' - these are all defined to be the equivalent string so that, for example, you can write a formula like &amp;lt;syntaxhighlight lang=wfl inline&amp;gt;alignment = liminal and gender = female&amp;lt;/syntaxhighlight&amp;gt; without needing to quote the alignment and gender strings.&lt;br /&gt;
&lt;br /&gt;
== A Note about Re-Using the Same Attribute ==&lt;br /&gt;
You are limited to having each attribute, such as '''id''', appear once or less in a [[StandardUnitFilter]]. However, this can be worked around. If you have several specific units you want excepted from matching, use a separate [or] subfilters for each one. Also you can use [not] subfilters. For example to kill ([kill] uses the standard unit filter) all units except Gwiti Ha'atel and Tanar you can do the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang='wml'&amp;gt;&lt;br /&gt;
[kill]&lt;br /&gt;
    [not]&lt;br /&gt;
        id=Gwiti Ha'atel&lt;br /&gt;
    [/not]&lt;br /&gt;
    [not]&lt;br /&gt;
        id=Tanar&lt;br /&gt;
    [/not]&lt;br /&gt;
[/kill]&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And similarly if you wanted to kill both Gwiti Ha'atel and Tanar, but no one else you could do the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang='wml'&amp;gt;&lt;br /&gt;
[kill]&lt;br /&gt;
    id=Gwiti Ha'atel&lt;br /&gt;
    [or]&lt;br /&gt;
       id=Tanar&lt;br /&gt;
    [/or]&lt;br /&gt;
[/kill]&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Tutorial ==&lt;br /&gt;
&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;
* [[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=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>
</feed>