<?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=BlueWinds</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=BlueWinds"/>
	<link rel="alternate" type="text/html" href="https://wiki.wesnoth.org/Special:Contributions/BlueWinds"/>
	<updated>2026-04-05T21:23:29Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.31.16</generator>
	<entry>
		<id>https://wiki.wesnoth.org/index.php?title=TerrainGraphicsWML&amp;diff=58106</id>
		<title>TerrainGraphicsWML</title>
		<link rel="alternate" type="text/html" href="https://wiki.wesnoth.org/index.php?title=TerrainGraphicsWML&amp;diff=58106"/>
		<updated>2016-12-30T16:45:28Z</updated>

		<summary type="html">&lt;p&gt;BlueWinds: /* The toplevel [terrain_graphics] tag */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{WML Tags}}&lt;br /&gt;
&lt;br /&gt;
== The toplevel [terrain_graphics] tag ==&lt;br /&gt;
&lt;br /&gt;
For information about the multi-hex tiling system, see [[MultiHexTutorial]]&lt;br /&gt;
&lt;br /&gt;
In terrain graphics, in Wesnoth 1.8.x all images are assumed to be .png and relative to images/terrain/. For example, writing 'image=grassland' means that the image file is images/terrain/grassland.png.  In Wesnoth 1.9.x the .png extension is required.  This means that TerrainGraphicsWML is incompatible from 1.8.x to 1.9.x.&lt;br /&gt;
&lt;br /&gt;
The multi-hex tiling system adds a new top-level element to WML, [terrain_graphics].&lt;br /&gt;
A building rule is used to specify images to place when terrains are in a certain formation.&lt;br /&gt;
When a building rule is applied to a map, it is applied once to each coordinate on the map;&lt;br /&gt;
when it is applied to a coordinate then that coordinate is considered the ''base''.&lt;br /&gt;
All locations in '''[terrain_graphics]''' are relative to the base.&lt;br /&gt;
&lt;br /&gt;
The following keys/tags are recognized:&lt;br /&gt;
* '''x''','''y''': constrains the rule to given absolute map coordinates. Primarily useful to place map-specific features.&lt;br /&gt;
* '''mod_x''','''mod_y''': {{DevFeature1.13|1}} constrains the rule to absolute map coordinates which are multiples of the given values. For example, mod_x=4 would only match locations with an x coordinate of 4, 8, 12, 16, etc.&lt;br /&gt;
* '''[tile]''': whenever a building rule is applied, each [tile] tag corresponds to a tile on the map. The corresponding tile must match each condition contained in [tile] for the [tile] tag to match. All [tile] tags must match in order for a rule to match. If the rule for a [tile] tag is applied, each action within [tile] will be executed on the tile corresponding to that [tile] tag&lt;br /&gt;
** '''x''','''y''': standard coordinates - the location of the corresponding tile relative to the base.&lt;br /&gt;
** '''pos''': a shortcut to specifying coordinates. Used in combination with ''map''&lt;br /&gt;
** '''type''': a comma-separated list of terrain codes (See [[TerrainWML]], data/terrain.cfg). In order for a tile to match this condition, it must be one of the terrains specified. However, if the string is preceded by &amp;quot;!&amp;quot;, the terrain must not be listed in order to match. If the string is '*', or if it is empty, any tile matches.&lt;br /&gt;
** '''name''': for animated terrain this takes the form of a comma separated list of images with durations specified after ':'. A square bracket expansion can also be used as in AnimationWML (see in example below).&lt;br /&gt;
** '''no_draw''' (default: no): {{DevFeature1.13|5}} whether to actually draw images of this rule onto this hex.&lt;br /&gt;
** '''set_flag''': a comma-separated list of strings or square bracket expansion as in AnimationWML. Attaches flags from that list to the corresponding tile if the rule matches. The only difference a flag makes is being detected by ''has_flag'' and ''no_flag'' in [tile]. This is determined by the order of the [terrain_graphics] tags; a tag after another one cannot influence it. See also ''has_flag'', ''no_flag''&lt;br /&gt;
** '''has_flag''': a comma-separated list of strings or square bracket expansion as in AnimationWML. Matches if all flags in that list are attached to the corresponding tile. Flags are attached using the ''set_flag'' key.&lt;br /&gt;
** '''no_flag''': a comma-separated list of strings or square bracket expansion as in AnimationWML. Matches if none of the flags in that list are attached to the corresponding tile. Flags are attached using the ''set_flag'' key.&lt;br /&gt;
** '''set_no_flag''': helper combining ''set_flag'' and ''no_flag''. Same effect as using them with the same flags. Added because it's the most common use; ''set_flag'' or ''no_flag'' can still be used to add flags in one group only. &lt;br /&gt;
** '''[image]''': images specified as a subtag to '''[tile]''' sets the images for a single tile.&lt;br /&gt;
*** '''layer''': an integer, usually negative. The more negative it is, the earlier it is drawn, and thus the farther &amp;quot;back&amp;quot; it is when compositing the terrain images together.&lt;br /&gt;
*** '''name''': the image to apply on this tile if appropriate (See [[ImagePathFunctionWML]] for additional options).&lt;br /&gt;
*** '''random_start''' (default: yes): Tells engine to start animation at random point instead of at the beginning for every tile&lt;br /&gt;
*** '''base''': specifies the point at which the image is considered to be for layering purposes.  ''base'' is specified as '''x,y''' where x and y indicate distances in pixels from the top-left corner of the '''image'''. This is translated to a certain pixel on the map, and all images with the ''base'' attribute are drawn from top-to-bottom in terms of these specified pixel positions '''on the map'''.&lt;br /&gt;
*** '''[variant]''': an alternate image to use for differing times of day&lt;br /&gt;
**** '''tod''': the time of day for which this variant applies. Accepts a comma separated list of times of day.&lt;br /&gt;
**** '''name''': the image to apply on this tile if appropriate&lt;br /&gt;
**** '''random_start''' (default: yes): Tells engine to start animation at random point instead of at the beginning for every tile&lt;br /&gt;
**** '''has_flag''' {{DevFeature1.13|1}} comma-separated list of flags that the tile must have for this variant to apply.&lt;br /&gt;
* '''[image]''': image may also be used directly in the rule, to specify multihex images. The following additional attributes are recognized for multihex images (as well as all the ones for images within '''[tile]''').&lt;br /&gt;
** '''center''': specifies the point which the image will be centered on. If it is not specified, the image will instead be aligned with the top left corner of the tile.&lt;br /&gt;
* '''probability''': the percent probability for each position that if the position matches, then the rule will be applied. Default is 100(%).  See [[TerrainGraphicsTutorial#Cumulative_Probabilities|Cumulative_Probabilities]] for mathematical complications.&lt;br /&gt;
* '''rotations''': 6 comma(''',''') separated input strings. A rule that contains this key is not actually checked against the terrain; it instead is used as a template to create 6 new rules, each corresponding to a rotated version of the current rule. Whenever a rotated version is applied, instances of @(at-sign)R0, @R1, ... @R6 in attributes in the [terrain_graphics] tag will be adjusted by the corresponding amount and replaced with the letters specified by that numbered rotation in the ''rotations'' list. Each value corresponds to the rotated version that is -Pi/3 (60° clockwise) from the previous version; the first value corresponds to the unrotated version.&amp;lt;br&amp;gt;For example, if '''rotations=n,ne,se,s,sw,nw''' and it is being rotated 120°, then &amp;quot;@R0&amp;quot;-&amp;gt;&amp;quot;@R2&amp;quot;-&amp;gt;&amp;quot;se&amp;quot;, &amp;quot;@R1&amp;quot;-&amp;gt;&amp;quot;@R3&amp;quot;-&amp;gt;&amp;quot;s&amp;quot;, ... &amp;quot;@R6&amp;quot;-&amp;gt;&amp;quot;@R1&amp;quot;-&amp;gt;&amp;quot;ne&amp;quot;.&amp;lt;br&amp;gt;Basically the important thing is that this lets the rule be applied in any of the six hex-directions, allowing you to adjust the name of the image files automatically.&lt;br /&gt;
* '''set_flag''','''has_flag''', '''no_flag''': shortcuts to putting these in the [tile] subtags; unbound attributes will apply to all [tile] subtags.&lt;br /&gt;
* '''map''': a shortcut for defining [tile] tags with ''type'' conditions. Inputs a multi-line string value visually describing the map. The lines are cut into words of 4 characters, which correspond to [tile] tags. The line types alternate between lines corresponding to relatively even-abciss tiles and lines preceded by two spaces corresponding to relatively odd-abciss tiles. Every two lines represent 1 row on the map.&lt;br /&gt;
&lt;br /&gt;
=== Words ===&lt;br /&gt;
&lt;br /&gt;
A ''word'' is a 4-character shortcut to a [tile] tag. There are different types of words:&lt;br /&gt;
* Usually a word is interpreted as being the input to the ''type'' key of the corresponding [tile]. That is, it creates a [tile] with the attribute '''type=''word'''''.&lt;br /&gt;
* A word can also be a digit followed by 3 spaces. In this case, it is a shortcut to the [tile] with the attribute '''pos=''word'''''. This is called ''anchoring''.&lt;br /&gt;
&lt;br /&gt;
In 1.3, the format is basically the same but the following changes are made&lt;br /&gt;
* A ''word'' no longer needs to be 4 characters but is comma separated and spaces and tabs may be used for padding&lt;br /&gt;
* The 2 spaces for odd lines in no longer used, instead a leading comma is used on these lines (before the comma spaces and tabs are allowed for padding)&lt;br /&gt;
* A ''word'' may only be a dot a star or an anchor. The terrain letter format was not used and hard to support in the new engine, so that support is dropped.&lt;br /&gt;
&lt;br /&gt;
== Examples ==&lt;br /&gt;
&lt;br /&gt;
To define a north-south 2-tile mountain, the following syntax can be used:&lt;br /&gt;
&lt;br /&gt;
 [terrain_graphics]&lt;br /&gt;
     [tile]&lt;br /&gt;
         x=0&lt;br /&gt;
         y=0&lt;br /&gt;
         type=Mm&lt;br /&gt;
         set_no_flag=&amp;quot;base&amp;quot;&lt;br /&gt;
     [/tile]&lt;br /&gt;
     [tile]&lt;br /&gt;
         x=0&lt;br /&gt;
         y=1&lt;br /&gt;
         type=Mm&lt;br /&gt;
         set_no_flag=&amp;quot;base&amp;quot;&lt;br /&gt;
     [/tile]&lt;br /&gt;
     [image]&lt;br /&gt;
          name=&amp;quot;mountain-n-s.png&amp;quot;&lt;br /&gt;
     [/image]&lt;br /&gt;
 [/terrain_graphics]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This represents a tile 1, and its six adjacent tiles 2, in the map notation.&lt;br /&gt;
&lt;br /&gt;
 .,   .,   .,   .&lt;br /&gt;
 ,  .,   2,   .,   .&lt;br /&gt;
 .,   2,   2,   .&lt;br /&gt;
 ,  .,   1,   .,   .&lt;br /&gt;
 .,   2,   2,   .&lt;br /&gt;
 ,  .,   2,   .,   .&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To define an animated campfire at coordinates (4,5) with files &amp;quot;misc/fire-A01.png&amp;quot; to &amp;quot;misc/fire-A08.png&amp;quot; with an inter-frame transition time of 140, the following can be placed at the scenario top level (adapted from the CAMPFIRE macro):&lt;br /&gt;
&lt;br /&gt;
 [terrain_graphics]&lt;br /&gt;
     x,y=4,5&lt;br /&gt;
     [tile]&lt;br /&gt;
         x=0&lt;br /&gt;
         y=0&lt;br /&gt;
         [image]&lt;br /&gt;
             layer=0&lt;br /&gt;
             name=&amp;quot;misc/fire-A[01~08].png:140&amp;quot;&lt;br /&gt;
         [/image]&lt;br /&gt;
     [/tile]&lt;br /&gt;
 [/terrain_graphics]&lt;br /&gt;
&lt;br /&gt;
== See Also ==&lt;br /&gt;
* [[MultiHexTutorial]]&lt;br /&gt;
* [[ReferenceWML]]&lt;br /&gt;
* [[ImagePathFunctionWML]]&lt;br /&gt;
* Ayin's [http://www.anathas.org/ayin/wesnoth/doc/terrain_graphics_wml detailed Terrain Graphics document]&lt;br /&gt;
* [[TerrainGraphicsTutorial]] - First half of Ayin's document, wikified&lt;br /&gt;
* [[TerrainGraphicsReference]] - Second (partial) half of Ayin's document, wikified&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category: WML Reference]]&lt;/div&gt;</summary>
		<author><name>BlueWinds</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.wesnoth.org/index.php?title=TerrainGraphicsWML&amp;diff=58105</id>
		<title>TerrainGraphicsWML</title>
		<link rel="alternate" type="text/html" href="https://wiki.wesnoth.org/index.php?title=TerrainGraphicsWML&amp;diff=58105"/>
		<updated>2016-12-30T16:43:37Z</updated>

		<summary type="html">&lt;p&gt;BlueWinds: /* See Also */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{WML Tags}}&lt;br /&gt;
&lt;br /&gt;
== The toplevel [terrain_graphics] tag ==&lt;br /&gt;
&lt;br /&gt;
For information about the multi-hex tiling system, see [[MultiHexTutorial]]&lt;br /&gt;
&lt;br /&gt;
In terrain graphics, in Wesnoth 1.8.x all images are assumed to be .png and relative to images/terrain/. For example, writing 'image=grassland' means that the image file is images/terrain/grassland.png.  In Wesnoth 1.9.x the .png extension is required.  This means that TerrainGraphicsWML is incompatible from 1.8.x to 1.9.x.&lt;br /&gt;
&lt;br /&gt;
The multi-hex tiling system adds a new top-level element to WML, [terrain_graphics].&lt;br /&gt;
A building rule is used to specify images to place when terrains are in a certain formation.&lt;br /&gt;
When a building rule is applied to a map, it is applied once to each coordinate on the map;&lt;br /&gt;
when it is applied to a coordinate then that coordinate is considered the ''base''.&lt;br /&gt;
All locations in '''[terrain_graphics]''' are relative to the base.&lt;br /&gt;
&lt;br /&gt;
The following keys/tags are recognized:&lt;br /&gt;
* '''x''','''y''': constrains the rule to given absolute map coordinates. Primarily useful to place map-specific features.&lt;br /&gt;
* '''mod_x''','''mod_y''': {{DevFeature1.13|1}} constrains the rule to absolute map coordinates which are multiples of the given values. For example, mod_x=4 would only match locations with an x coordinate of 4, 8, 12, 16, etc.&lt;br /&gt;
* '''[tile]''': whenever a building rule is applied, each [tile] tag corresponds to a tile on the map. The corresponding tile must match each condition contained in [tile] for the [tile] tag to match. All [tile] tags must match in order for a rule to match. If the rule for a [tile] tag is applied, each action within [tile] will be executed on the tile corresponding to that [tile] tag&lt;br /&gt;
** '''x''','''y''': standard coordinates - the location of the corresponding tile relative to the base.&lt;br /&gt;
** '''pos''': a shortcut to specifying coordinates. Used in combination with ''map''&lt;br /&gt;
** '''type''': a comma-separated list of terrain codes (See [[TerrainWML]], data/terrain.cfg). In order for a tile to match this condition, it must be one of the terrains specified. However, if the string is preceded by &amp;quot;!&amp;quot;, the terrain must not be listed in order to match. If the string is '*', or if it is empty, any tile matches.&lt;br /&gt;
** '''name''': for animated terrain this takes the form of a comma separated list of images with durations specified after ':'. A square bracket expansion can also be used as in AnimationWML (see in example below).&lt;br /&gt;
** '''no_draw''' (default: no): {{DevFeature1.13|5}} whether to actually draw images of this rule onto this hex.&lt;br /&gt;
** '''set_flag''': a comma-separated list of strings or square bracket expansion as in AnimationWML. Attaches flags from that list to the corresponding tile if the rule matches. The only difference a flag makes is being detected by ''has_flag'' and ''no_flag'' in [tile]. This is determined by the order of the [terrain_graphics] tags; a tag after another one cannot influence it. See also ''has_flag'', ''no_flag''&lt;br /&gt;
** '''has_flag''': a comma-separated list of strings or square bracket expansion as in AnimationWML. Matches if all flags in that list are attached to the corresponding tile. Flags are attached using the ''set_flag'' key.&lt;br /&gt;
** '''no_flag''': a comma-separated list of strings or square bracket expansion as in AnimationWML. Matches if none of the flags in that list are attached to the corresponding tile. Flags are attached using the ''set_flag'' key.&lt;br /&gt;
** '''set_no_flag''': helper combining ''set_flag'' and ''no_flag''. Same effect as using them with the same flags. Added because it's the most common use; ''set_flag'' or ''no_flag'' can still be used to add flags in one group only. &lt;br /&gt;
** '''[image]''': images specified as a subtag to '''[tile]''' sets the images for a single tile.&lt;br /&gt;
*** '''layer''': an integer, usually negative. The more negative it is, the earlier it is drawn, and thus the farther &amp;quot;back&amp;quot; it is when compositing the terrain images together.&lt;br /&gt;
*** '''name''': the image to apply on this tile if appropriate&lt;br /&gt;
*** '''random_start''' (default: yes): Tells engine to start animation at random point instead of at the beginning for every tile&lt;br /&gt;
*** '''base''': specifies the point at which the image is considered to be for layering purposes.  ''base'' is specified as '''x,y''' where x and y indicate distances in pixels from the top-left corner of the '''image'''. This is translated to a certain pixel on the map, and all images with the ''base'' attribute are drawn from top-to-bottom in terms of these specified pixel positions '''on the map'''.&lt;br /&gt;
*** '''[variant]''': an alternate image to use for differing times of day&lt;br /&gt;
**** '''tod''': the time of day for which this variant applies. Accepts a comma separated list of times of day.&lt;br /&gt;
**** '''name''': the image to apply on this tile if appropriate&lt;br /&gt;
**** '''random_start''' (default: yes): Tells engine to start animation at random point instead of at the beginning for every tile&lt;br /&gt;
**** '''has_flag''' {{DevFeature1.13|1}} comma-separated list of flags that the tile must have for this variant to apply.&lt;br /&gt;
* '''[image]''': image may also be used directly in the rule, to specify multihex images. The following additional attributes are recognized for multihex images (as well as all the ones for images within '''[tile]''').&lt;br /&gt;
** '''center''': specifies the point which the image will be centered on. If it is not specified, the image will instead be aligned with the top left corner of the tile.&lt;br /&gt;
* '''probability''': the percent probability for each position that if the position matches, then the rule will be applied. Default is 100(%).  See [[TerrainGraphicsTutorial#Cumulative_Probabilities|Cumulative_Probabilities]] for mathematical complications.&lt;br /&gt;
* '''rotations''': 6 comma(''',''') separated input strings. A rule that contains this key is not actually checked against the terrain; it instead is used as a template to create 6 new rules, each corresponding to a rotated version of the current rule. Whenever a rotated version is applied, instances of @(at-sign)R0, @R1, ... @R6 in attributes in the [terrain_graphics] tag will be adjusted by the corresponding amount and replaced with the letters specified by that numbered rotation in the ''rotations'' list. Each value corresponds to the rotated version that is -Pi/3 (60° clockwise) from the previous version; the first value corresponds to the unrotated version.&amp;lt;br&amp;gt;For example, if '''rotations=n,ne,se,s,sw,nw''' and it is being rotated 120°, then &amp;quot;@R0&amp;quot;-&amp;gt;&amp;quot;@R2&amp;quot;-&amp;gt;&amp;quot;se&amp;quot;, &amp;quot;@R1&amp;quot;-&amp;gt;&amp;quot;@R3&amp;quot;-&amp;gt;&amp;quot;s&amp;quot;, ... &amp;quot;@R6&amp;quot;-&amp;gt;&amp;quot;@R1&amp;quot;-&amp;gt;&amp;quot;ne&amp;quot;.&amp;lt;br&amp;gt;Basically the important thing is that this lets the rule be applied in any of the six hex-directions, allowing you to adjust the name of the image files automatically.&lt;br /&gt;
* '''set_flag''','''has_flag''', '''no_flag''': shortcuts to putting these in the [tile] subtags; unbound attributes will apply to all [tile] subtags.&lt;br /&gt;
* '''map''': a shortcut for defining [tile] tags with ''type'' conditions. Inputs a multi-line string value visually describing the map. The lines are cut into words of 4 characters, which correspond to [tile] tags. The line types alternate between lines corresponding to relatively even-abciss tiles and lines preceded by two spaces corresponding to relatively odd-abciss tiles. Every two lines represent 1 row on the map.&lt;br /&gt;
&lt;br /&gt;
=== Words ===&lt;br /&gt;
&lt;br /&gt;
A ''word'' is a 4-character shortcut to a [tile] tag. There are different types of words:&lt;br /&gt;
* Usually a word is interpreted as being the input to the ''type'' key of the corresponding [tile]. That is, it creates a [tile] with the attribute '''type=''word'''''.&lt;br /&gt;
* A word can also be a digit followed by 3 spaces. In this case, it is a shortcut to the [tile] with the attribute '''pos=''word'''''. This is called ''anchoring''.&lt;br /&gt;
&lt;br /&gt;
In 1.3, the format is basically the same but the following changes are made&lt;br /&gt;
* A ''word'' no longer needs to be 4 characters but is comma separated and spaces and tabs may be used for padding&lt;br /&gt;
* The 2 spaces for odd lines in no longer used, instead a leading comma is used on these lines (before the comma spaces and tabs are allowed for padding)&lt;br /&gt;
* A ''word'' may only be a dot a star or an anchor. The terrain letter format was not used and hard to support in the new engine, so that support is dropped.&lt;br /&gt;
&lt;br /&gt;
== Examples ==&lt;br /&gt;
&lt;br /&gt;
To define a north-south 2-tile mountain, the following syntax can be used:&lt;br /&gt;
&lt;br /&gt;
 [terrain_graphics]&lt;br /&gt;
     [tile]&lt;br /&gt;
         x=0&lt;br /&gt;
         y=0&lt;br /&gt;
         type=Mm&lt;br /&gt;
         set_no_flag=&amp;quot;base&amp;quot;&lt;br /&gt;
     [/tile]&lt;br /&gt;
     [tile]&lt;br /&gt;
         x=0&lt;br /&gt;
         y=1&lt;br /&gt;
         type=Mm&lt;br /&gt;
         set_no_flag=&amp;quot;base&amp;quot;&lt;br /&gt;
     [/tile]&lt;br /&gt;
     [image]&lt;br /&gt;
          name=&amp;quot;mountain-n-s.png&amp;quot;&lt;br /&gt;
     [/image]&lt;br /&gt;
 [/terrain_graphics]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This represents a tile 1, and its six adjacent tiles 2, in the map notation.&lt;br /&gt;
&lt;br /&gt;
 .,   .,   .,   .&lt;br /&gt;
 ,  .,   2,   .,   .&lt;br /&gt;
 .,   2,   2,   .&lt;br /&gt;
 ,  .,   1,   .,   .&lt;br /&gt;
 .,   2,   2,   .&lt;br /&gt;
 ,  .,   2,   .,   .&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To define an animated campfire at coordinates (4,5) with files &amp;quot;misc/fire-A01.png&amp;quot; to &amp;quot;misc/fire-A08.png&amp;quot; with an inter-frame transition time of 140, the following can be placed at the scenario top level (adapted from the CAMPFIRE macro):&lt;br /&gt;
&lt;br /&gt;
 [terrain_graphics]&lt;br /&gt;
     x,y=4,5&lt;br /&gt;
     [tile]&lt;br /&gt;
         x=0&lt;br /&gt;
         y=0&lt;br /&gt;
         [image]&lt;br /&gt;
             layer=0&lt;br /&gt;
             name=&amp;quot;misc/fire-A[01~08].png:140&amp;quot;&lt;br /&gt;
         [/image]&lt;br /&gt;
     [/tile]&lt;br /&gt;
 [/terrain_graphics]&lt;br /&gt;
&lt;br /&gt;
== See Also ==&lt;br /&gt;
* [[MultiHexTutorial]]&lt;br /&gt;
* [[ReferenceWML]]&lt;br /&gt;
* [[ImagePathFunctionWML]]&lt;br /&gt;
* Ayin's [http://www.anathas.org/ayin/wesnoth/doc/terrain_graphics_wml detailed Terrain Graphics document]&lt;br /&gt;
* [[TerrainGraphicsTutorial]] - First half of Ayin's document, wikified&lt;br /&gt;
* [[TerrainGraphicsReference]] - Second (partial) half of Ayin's document, wikified&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category: WML Reference]]&lt;/div&gt;</summary>
		<author><name>BlueWinds</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.wesnoth.org/index.php?title=ReferenceWML&amp;diff=58104</id>
		<title>ReferenceWML</title>
		<link rel="alternate" type="text/html" href="https://wiki.wesnoth.org/index.php?title=ReferenceWML&amp;diff=58104"/>
		<updated>2016-12-30T16:42:45Z</updated>

		<summary type="html">&lt;p&gt;BlueWinds: /* Other */&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]] the syntactical definition of WML, and how to use variables&lt;br /&gt;
* [[PreprocessorRef]] the WML preprocessor syntax&lt;br /&gt;
&lt;br /&gt;
== WML toplevel tags ==&lt;br /&gt;
&lt;br /&gt;
The following covers most of the possible toplevel tags in a typical main WML file. Some minor and dev-oriented tags (not intended for use by UMC) are omitted.&lt;br /&gt;
&lt;br /&gt;
* [[GameConfigWML]] the top level '''[game_config]''' tag&lt;br /&gt;
* [[UnitsWML]] the top level '''[units]''' tag&lt;br /&gt;
** [[UnitTypeWML]] how to describe a unit type&lt;br /&gt;
** [[AnimationWML]] how to animate units&lt;br /&gt;
* [[CampaignWML]] the top level '''[campaign]''' tag&lt;br /&gt;
* [[CoreWML]] the top level '''[core]''' tag&lt;br /&gt;
* [[ScenarioWML]] the top level tags '''[scenario]''', '''[multiplayer]''', '''[test]''', and '''[tutorial]'''&lt;br /&gt;
** [[EventWML]] how to describe an event&lt;br /&gt;
** [[SideWML]] how to describe a side&lt;br /&gt;
** [[MapGeneratorWML]] the random map generator&lt;br /&gt;
** [[TimeWML]] how to describe a day&lt;br /&gt;
** [[IntroWML]] how to describe the intro screen&lt;br /&gt;
* [[EraWML]] the top level '''[era]''' tag&lt;br /&gt;
* [[TerrainWML]] the top level '''[terrain_type]''' tag&lt;br /&gt;
* [[TerrainGraphicsWML]], the top level '''[terrain_graphics]''' tag&lt;br /&gt;
* [[ThemeWML]] the top level '''[theme]''' tag&lt;br /&gt;
* [[LanguageWML]] the top level '''[language]''' tag&lt;br /&gt;
* [[LocaleWML]] the top level '''[locale]''' tag&lt;br /&gt;
* [[HelpWML]] the top level '''[help]''' tag&lt;br /&gt;
* [[BinaryPathWML]] the top level '''[binary_path]''' tag&lt;br /&gt;
* [[FontsWML]] the top level '''[fonts]''' tag&lt;br /&gt;
* [[WesCamp#The_textdomain_declaration|Textdomains]] the '''[textdomain]''' tag&lt;br /&gt;
&lt;br /&gt;
Some other files use the WML format, but with different tags.&lt;br /&gt;
&lt;br /&gt;
* [[SavefileWML]] a description of the format of savegames&lt;br /&gt;
** [[ReplayWML]] a description of the format of player actions such as moving a unit&lt;br /&gt;
** [[StatisticalScenarioWML]] used to generate statistics of a savegame&lt;br /&gt;
* [[PblWML]] a description of the format of server-uploadable campaigns&lt;br /&gt;
&lt;br /&gt;
== Other WML tags ==&lt;br /&gt;
&lt;br /&gt;
* [[EventWML]] how to describe an event&lt;br /&gt;
** [[FilterWML]] the construct to filter on units, locations, and weapons&lt;br /&gt;
** [[ActionWML]] to describe the actions which occur when the event is fired&lt;br /&gt;
*** [[ConditionalActionsWML]] actions that encapsulate conditional filters and the actions to execute if the conditions are met&lt;br /&gt;
*** [[DirectActionsWML]] actions that directly affect gameplay: for example creating a unit&lt;br /&gt;
**** [[SingleUnitWML]] how to describe a unit&lt;br /&gt;
*** [[InternalActionsWML]] actions that WML uses internally: for example storing a variable&lt;br /&gt;
*** [[InterfaceActionsWML]] actions that do not affect gameplay: for example displaying a message&lt;br /&gt;
*** [[LuaWML]] how to code actions with the Lua language&lt;br /&gt;
* [[AiWML]] how to describe parameters for AI&lt;br /&gt;
* [[EffectWML]] the construct to modify a unit&lt;br /&gt;
* [[AbilitiesWML]] a list of the different abilities a unit or weapon can have&lt;br /&gt;
* [[DescriptionWML]] the structure of WML coded menus like the difficulty chooser of campaigns&lt;br /&gt;
* [[EditorWML]] tags controlling the post-1.4 editor's behavior&lt;br /&gt;
* [[GUIToolkit]] creating dialogs&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;
* [http://www.wesnoth.org/macro-reference.xhtml WML Macros] - description of all such macros.&lt;br /&gt;
&lt;br /&gt;
== Other ==&lt;br /&gt;
&lt;br /&gt;
* [[ReferenceWMLSyntax]] how this wiki and the pages it links to should be formatted&lt;br /&gt;
* [[ConventionsWML]] how to make your WML more readable&lt;br /&gt;
* [[Wml_optimisation]] how to make your WML code more efficient&lt;br /&gt;
* [[UsefulWMLFragments]] Various pieces of WML for various purposes. If you have some WML you're proud of that you think others can use, add it here.&lt;br /&gt;
* [[Maintenance tools]] for wmlindent, wmllint, wmlscope&lt;br /&gt;
* [[CommandMode]] commands are not strictly speaking part of WML, these could be a little hard to find so there's a link here.&lt;br /&gt;
* [[MultiplayerServerWML]] is used when communicating with the multiplayer server.&lt;br /&gt;
* [[CampaignServerWML]] is used when managing contributed campaigns on the campaign server.&lt;br /&gt;
* [[ImagePathFunctionWML]] is used when applying the color function to images, such as marking units as belonging to a team or in TerrainGraphics.&lt;br /&gt;
&lt;br /&gt;
== See Also ==&lt;br /&gt;
&lt;br /&gt;
* [[BuildingMaps]] the text-based format for Wesnoth maps&lt;br /&gt;
* [[TerrainCodesWML]] a list of all terrains&lt;br /&gt;
* [[MultiHexTutorial]] a description of the multi-hex tiling system&lt;br /&gt;
* [[IGNFileFormat]] a description of the ignore file format&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category: WML Reference]]&lt;/div&gt;</summary>
		<author><name>BlueWinds</name></author>
		
	</entry>
</feed>