<?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=Meriton</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=Meriton"/>
	<link rel="alternate" type="text/html" href="https://wiki.wesnoth.org/Special:Contributions/Meriton"/>
	<updated>2026-04-17T15:50:49Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.31.16</generator>
	<entry>
		<id>https://wiki.wesnoth.org/index.php?title=Talk:ReferenceWMLDump&amp;diff=16480</id>
		<title>Talk:ReferenceWMLDump</title>
		<link rel="alternate" type="text/html" href="https://wiki.wesnoth.org/index.php?title=Talk:ReferenceWMLDump&amp;diff=16480"/>
		<updated>2007-07-16T11:51:48Z</updated>

		<summary type="html">&lt;p&gt;Meriton: Request for clarification: Substitution mode of [set_variable]value= in stable branch&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Kernigh wrote:&lt;br /&gt;
: Since Wesnoth 1.1.5, all simple substitution was eliminated in favor of complex substitution, which is more versatile.&lt;br /&gt;
&lt;br /&gt;
There is no source for this claim, and my tests contradict it: In wesnoth 1.2.5, the WML snippet&lt;br /&gt;
 			{VARIABLE foo_bar 42}&lt;br /&gt;
 			{VARIABLE b bar}&lt;br /&gt;
 			[gold]&lt;br /&gt;
 				side=1&lt;br /&gt;
 				amount=$foo_$b&lt;br /&gt;
 			[/gold]&lt;br /&gt;
does nothing, but &lt;br /&gt;
 			{VARIABLE foo_bar 42}&lt;br /&gt;
 			{VARIABLE b bar}&lt;br /&gt;
 			{VARIABLE_OP temp format $foo_$b}&lt;br /&gt;
 			[gold]&lt;br /&gt;
 				side=1&lt;br /&gt;
 				amount=$temp&lt;br /&gt;
 			[/gold]&lt;br /&gt;
adds 42 gold to side 1. I have therefore reverted the edit. Please only change the content of this page if you are sure you are right.&lt;br /&gt;
&lt;br /&gt;
[[User:Meriton|Meriton]] 15:25, 15 July 2007 (CEST)&lt;br /&gt;
&lt;br /&gt;
: In the source file wesnoth-1.2.5/changelog, under the section for &amp;quot;Wesnoth 1.1.5&amp;quot;, it states, &amp;quot;all [event] tags shall perform complex substitution&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
: Further, the following example passes wesnoth 1.2.5, and at least demonstrates that the [allow_recruit]type= key permits complex substitution:&lt;br /&gt;
&lt;br /&gt;
 			# works in 1.2.5&lt;br /&gt;
 			[event]&lt;br /&gt;
 				name=start&lt;br /&gt;
 				{VARIABLE title &amp;quot;Sharpshooter&amp;quot;}&lt;br /&gt;
 				{VARIABLE name title}&lt;br /&gt;
 				[allow_recruit]&lt;br /&gt;
 					type=&amp;quot;Elvish $$name||&amp;quot;&lt;br /&gt;
 					side=1&lt;br /&gt;
 				[/allow_recruit]&lt;br /&gt;
 			[/event]&lt;br /&gt;
&lt;br /&gt;
: When I made a copy of 2p - Blitz with this event, side 1 was able to recruit Elvish Sharpshooters.&lt;br /&gt;
&lt;br /&gt;
: To show why your test failed, I suggest that &amp;quot;$foo_$b&amp;quot; is not a valid complex suggestion. (I do not know why &amp;quot;$foo_$b&amp;quot; does not work; maybe there is a bug in 1.2.5, or I misunderstand how complex substitution works.) &lt;br /&gt;
&lt;br /&gt;
:: But if this is not a valid expression, how can it be correctly interpreted by [set_variable]format=, which after all does complex substitution, too? [[User:Meriton|Meriton]] 22:17, 15 July 2007 (CEST)&lt;br /&gt;
&lt;br /&gt;
: The wiki page claims that [message]message= allows complex substitution, so I extended your example to be:&lt;br /&gt;
&lt;br /&gt;
 			{VARIABLE foo_bar 42}&lt;br /&gt;
 			{VARIABLE b bar}&lt;br /&gt;
 			[gold]&lt;br /&gt;
 				side=2&lt;br /&gt;
 				amount=$foo_$b&lt;br /&gt;
 				# broken in 1.2.5&lt;br /&gt;
 			[/gold]&lt;br /&gt;
 &lt;br /&gt;
 			[message]&lt;br /&gt;
 				speaker=narrator&lt;br /&gt;
 				message=$foo_$b&lt;br /&gt;
 				# broken in 1.2.5&lt;br /&gt;
 			[/message]&lt;br /&gt;
&lt;br /&gt;
: When I tested this, side 2 failed to gain 42 gold, and the message box can up with an empty message! --[[User:Kernigh|Kernigh]] 16:35, 15 July 2007 (CEST)&lt;br /&gt;
&lt;br /&gt;
There is a bug with complex substitution in the stable branch; it the value starts with '$' as the very first character then it will (sometimes) switch back to simple substitution. This bug was fixed by eliminating simple substitution in the development branch. As a workaround, you can put a space as the first charatcer in the message, like this: message=&amp;quot; $foo_$b&amp;quot;. --[http://www.wesnoth.org/mw/index.php?title=Talk:VariablesWML&amp;amp;diff=16471&amp;amp;oldid=16468 ''unsigned talk from Sapient'']&lt;br /&gt;
&lt;br /&gt;
: I have to admit that my previous claim (&amp;quot; Since Wesnoth 1.1.5, all simple substitution was eliminated in favor of complex substitution, which is more versatile.&amp;quot;) was incorrect, because of the above description of how Wesnoth sometimes does &amp;quot;switch back to simple substitution&amp;quot;. --[[User:Kernigh|Kernigh]] 22:00, 15 July 2007 (CEST)&lt;br /&gt;
&lt;br /&gt;
Let me see if I got this right: In theory, all attributes that perform any substitution perform complex substitution, but due to a bug, complex substitution sometimes does simple substitution instead. We therefore tell users that only simple substitution is performed in the stable branch, because that is the only thing that is guaranteed to work. [[User:Meriton|Meriton]] 22:17, 15 July 2007 (CEST)&lt;br /&gt;
&lt;br /&gt;
Incorrect. I suggest you disregard Kernigh's statement, because it is misleading and false. There is still *lots* of simple substitution in the stable branch. (Including the bug with complex substitution sometimes reverting to simple substitution when the first character is '$'). If you are doing anything complex with WML you should be using the development branch because many improvements have been made. --Sapient&lt;br /&gt;
&lt;br /&gt;
Ok, thanks for the clarification. --Meriton&lt;br /&gt;
&lt;br /&gt;
=== Substitution mode of [set_variable]value= in stable branch ===&lt;br /&gt;
&lt;br /&gt;
In the forums, governor claimed&lt;br /&gt;
: {VARIABLE var1 $var2.xxxx} is valid.&lt;br /&gt;
which desugars to&lt;br /&gt;
 [set_variable]&lt;br /&gt;
     name=var1&lt;br /&gt;
     value=$var2.xxxx&lt;br /&gt;
 [/set_variable]&lt;br /&gt;
I tested this in 1.2.5 with the code&lt;br /&gt;
 {VARIABLE foo bar}&lt;br /&gt;
 {VARIABLE test $foo}&lt;br /&gt;
Inspection of the save file revealed that &amp;quot;test&amp;quot; had been set to &amp;quot;bar&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
What is the substitution mode for [set_variable]value= in the current stable branch?&lt;/div&gt;</summary>
		<author><name>Meriton</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.wesnoth.org/index.php?title=Talk:ReferenceWMLDump&amp;diff=16479</id>
		<title>Talk:ReferenceWMLDump</title>
		<link rel="alternate" type="text/html" href="https://wiki.wesnoth.org/index.php?title=Talk:ReferenceWMLDump&amp;diff=16479"/>
		<updated>2007-07-16T11:41:17Z</updated>

		<summary type="html">&lt;p&gt;Meriton: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Kernigh wrote:&lt;br /&gt;
: Since Wesnoth 1.1.5, all simple substitution was eliminated in favor of complex substitution, which is more versatile.&lt;br /&gt;
&lt;br /&gt;
There is no source for this claim, and my tests contradict it: In wesnoth 1.2.5, the WML snippet&lt;br /&gt;
 			{VARIABLE foo_bar 42}&lt;br /&gt;
 			{VARIABLE b bar}&lt;br /&gt;
 			[gold]&lt;br /&gt;
 				side=1&lt;br /&gt;
 				amount=$foo_$b&lt;br /&gt;
 			[/gold]&lt;br /&gt;
does nothing, but &lt;br /&gt;
 			{VARIABLE foo_bar 42}&lt;br /&gt;
 			{VARIABLE b bar}&lt;br /&gt;
 			{VARIABLE_OP temp format $foo_$b}&lt;br /&gt;
 			[gold]&lt;br /&gt;
 				side=1&lt;br /&gt;
 				amount=$temp&lt;br /&gt;
 			[/gold]&lt;br /&gt;
adds 42 gold to side 1. I have therefore reverted the edit. Please only change the content of this page if you are sure you are right.&lt;br /&gt;
&lt;br /&gt;
[[User:Meriton|Meriton]] 15:25, 15 July 2007 (CEST)&lt;br /&gt;
&lt;br /&gt;
: In the source file wesnoth-1.2.5/changelog, under the section for &amp;quot;Wesnoth 1.1.5&amp;quot;, it states, &amp;quot;all [event] tags shall perform complex substitution&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
: Further, the following example passes wesnoth 1.2.5, and at least demonstrates that the [allow_recruit]type= key permits complex substitution:&lt;br /&gt;
&lt;br /&gt;
 			# works in 1.2.5&lt;br /&gt;
 			[event]&lt;br /&gt;
 				name=start&lt;br /&gt;
 				{VARIABLE title &amp;quot;Sharpshooter&amp;quot;}&lt;br /&gt;
 				{VARIABLE name title}&lt;br /&gt;
 				[allow_recruit]&lt;br /&gt;
 					type=&amp;quot;Elvish $$name||&amp;quot;&lt;br /&gt;
 					side=1&lt;br /&gt;
 				[/allow_recruit]&lt;br /&gt;
 			[/event]&lt;br /&gt;
&lt;br /&gt;
: When I made a copy of 2p - Blitz with this event, side 1 was able to recruit Elvish Sharpshooters.&lt;br /&gt;
&lt;br /&gt;
: To show why your test failed, I suggest that &amp;quot;$foo_$b&amp;quot; is not a valid complex suggestion. (I do not know why &amp;quot;$foo_$b&amp;quot; does not work; maybe there is a bug in 1.2.5, or I misunderstand how complex substitution works.) &lt;br /&gt;
&lt;br /&gt;
:: But if this is not a valid expression, how can it be correctly interpreted by [set_variable]format=, which after all does complex substitution, too? [[User:Meriton|Meriton]] 22:17, 15 July 2007 (CEST)&lt;br /&gt;
&lt;br /&gt;
: The wiki page claims that [message]message= allows complex substitution, so I extended your example to be:&lt;br /&gt;
&lt;br /&gt;
 			{VARIABLE foo_bar 42}&lt;br /&gt;
 			{VARIABLE b bar}&lt;br /&gt;
 			[gold]&lt;br /&gt;
 				side=2&lt;br /&gt;
 				amount=$foo_$b&lt;br /&gt;
 				# broken in 1.2.5&lt;br /&gt;
 			[/gold]&lt;br /&gt;
 &lt;br /&gt;
 			[message]&lt;br /&gt;
 				speaker=narrator&lt;br /&gt;
 				message=$foo_$b&lt;br /&gt;
 				# broken in 1.2.5&lt;br /&gt;
 			[/message]&lt;br /&gt;
&lt;br /&gt;
: When I tested this, side 2 failed to gain 42 gold, and the message box can up with an empty message! --[[User:Kernigh|Kernigh]] 16:35, 15 July 2007 (CEST)&lt;br /&gt;
&lt;br /&gt;
There is a bug with complex substitution in the stable branch; it the value starts with '$' as the very first character then it will (sometimes) switch back to simple substitution. This bug was fixed by eliminating simple substitution in the development branch. As a workaround, you can put a space as the first charatcer in the message, like this: message=&amp;quot; $foo_$b&amp;quot;. --[http://www.wesnoth.org/mw/index.php?title=Talk:VariablesWML&amp;amp;diff=16471&amp;amp;oldid=16468 ''unsigned talk from Sapient'']&lt;br /&gt;
&lt;br /&gt;
: I have to admit that my previous claim (&amp;quot; Since Wesnoth 1.1.5, all simple substitution was eliminated in favor of complex substitution, which is more versatile.&amp;quot;) was incorrect, because of the above description of how Wesnoth sometimes does &amp;quot;switch back to simple substitution&amp;quot;. --[[User:Kernigh|Kernigh]] 22:00, 15 July 2007 (CEST)&lt;br /&gt;
&lt;br /&gt;
Let me see if I got this right: In theory, all attributes that perform any substitution perform complex substitution, but due to a bug, complex substitution sometimes does simple substitution instead. We therefore tell users that only simple substitution is performed in the stable branch, because that is the only thing that is guaranteed to work. [[User:Meriton|Meriton]] 22:17, 15 July 2007 (CEST)&lt;br /&gt;
&lt;br /&gt;
Incorrect. I suggest you disregard Kernigh's statement, because it is misleading and false. There is still *lots* of simple substitution in the stable branch. (Including the bug with complex substitution sometimes reverting to simple substitution when the first character is '$'). If you are doing anything complex with WML you should be using the development branch because many improvements have been made. --Sapient&lt;br /&gt;
&lt;br /&gt;
Ok, thanks for the clarification. --Meriton&lt;/div&gt;</summary>
		<author><name>Meriton</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.wesnoth.org/index.php?title=Talk:ReferenceWMLDump&amp;diff=16474</id>
		<title>Talk:ReferenceWMLDump</title>
		<link rel="alternate" type="text/html" href="https://wiki.wesnoth.org/index.php?title=Talk:ReferenceWMLDump&amp;diff=16474"/>
		<updated>2007-07-15T20:17:43Z</updated>

		<summary type="html">&lt;p&gt;Meriton: a comment and a question&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Kernigh wrote:&lt;br /&gt;
: Since Wesnoth 1.1.5, all simple substitution was eliminated in favor of complex substitution, which is more versatile.&lt;br /&gt;
&lt;br /&gt;
There is no source for this claim, and my tests contradict it: In wesnoth 1.2.5, the WML snippet&lt;br /&gt;
 			{VARIABLE foo_bar 42}&lt;br /&gt;
 			{VARIABLE b bar}&lt;br /&gt;
 			[gold]&lt;br /&gt;
 				side=1&lt;br /&gt;
 				amount=$foo_$b&lt;br /&gt;
 			[/gold]&lt;br /&gt;
does nothing, but &lt;br /&gt;
 			{VARIABLE foo_bar 42}&lt;br /&gt;
 			{VARIABLE b bar}&lt;br /&gt;
 			{VARIABLE_OP temp format $foo_$b}&lt;br /&gt;
 			[gold]&lt;br /&gt;
 				side=1&lt;br /&gt;
 				amount=$temp&lt;br /&gt;
 			[/gold]&lt;br /&gt;
adds 42 gold to side 1. I have therefore reverted the edit. Please only change the content of this page if you are sure you are right.&lt;br /&gt;
&lt;br /&gt;
[[User:Meriton|Meriton]] 15:25, 15 July 2007 (CEST)&lt;br /&gt;
&lt;br /&gt;
: In the source file wesnoth-1.2.5/changelog, under the section for &amp;quot;Wesnoth 1.1.5&amp;quot;, it states, &amp;quot;all [event] tags shall perform complex substitution&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
: Further, the following example passes wesnoth 1.2.5, and at least demonstrates that the [allow_recruit]type= key permits complex substitution:&lt;br /&gt;
&lt;br /&gt;
 			# works in 1.2.5&lt;br /&gt;
 			[event]&lt;br /&gt;
 				name=start&lt;br /&gt;
 				{VARIABLE title &amp;quot;Sharpshooter&amp;quot;}&lt;br /&gt;
 				{VARIABLE name title}&lt;br /&gt;
 				[allow_recruit]&lt;br /&gt;
 					type=&amp;quot;Elvish $$name||&amp;quot;&lt;br /&gt;
 					side=1&lt;br /&gt;
 				[/allow_recruit]&lt;br /&gt;
 			[/event]&lt;br /&gt;
&lt;br /&gt;
: When I made a copy of 2p - Blitz with this event, side 1 was able to recruit Elvish Sharpshooters.&lt;br /&gt;
&lt;br /&gt;
: To show why your test failed, I suggest that &amp;quot;$foo_$b&amp;quot; is not a valid complex suggestion. (I do not know why &amp;quot;$foo_$b&amp;quot; does not work; maybe there is a bug in 1.2.5, or I misunderstand how complex substitution works.) &lt;br /&gt;
&lt;br /&gt;
:: But if this is not a valid expression, how can it be correctly interpreted by [set_variable]format=, which after all does complex substitution, too? [[User:Meriton|Meriton]] 22:17, 15 July 2007 (CEST)&lt;br /&gt;
&lt;br /&gt;
: The wiki page claims that [message]message= allows complex substitution, so I extended your example to be:&lt;br /&gt;
&lt;br /&gt;
 			{VARIABLE foo_bar 42}&lt;br /&gt;
 			{VARIABLE b bar}&lt;br /&gt;
 			[gold]&lt;br /&gt;
 				side=2&lt;br /&gt;
 				amount=$foo_$b&lt;br /&gt;
 				# broken in 1.2.5&lt;br /&gt;
 			[/gold]&lt;br /&gt;
 &lt;br /&gt;
 			[message]&lt;br /&gt;
 				speaker=narrator&lt;br /&gt;
 				message=$foo_$b&lt;br /&gt;
 				# broken in 1.2.5&lt;br /&gt;
 			[/message]&lt;br /&gt;
&lt;br /&gt;
: When I tested this, side 2 failed to gain 42 gold, and the message box can up with an empty message! --[[User:Kernigh|Kernigh]] 16:35, 15 July 2007 (CEST)&lt;br /&gt;
&lt;br /&gt;
There is a bug with complex substitution in the stable branch; it the value starts with '$' as the very first character then it will (sometimes) switch back to simple substitution. This bug was fixed by eliminating simple substitution in the development branch. As a workaround, you can put a space as the first charatcer in the message, like this: message=&amp;quot; $foo_$b&amp;quot;. --[http://www.wesnoth.org/mw/index.php?title=Talk:VariablesWML&amp;amp;diff=16471&amp;amp;oldid=16468 ''unsigned talk from Sapient'']&lt;br /&gt;
&lt;br /&gt;
: I have to admit that my previous claim (&amp;quot; Since Wesnoth 1.1.5, all simple substitution was eliminated in favor of complex substitution, which is more versatile.&amp;quot;) was incorrect, because of the above description of how Wesnoth sometimes does &amp;quot;switch back to simple substitution&amp;quot;. --[[User:Kernigh|Kernigh]] 22:00, 15 July 2007 (CEST)&lt;br /&gt;
&lt;br /&gt;
Let me see if I got this right: In theory, all attributes that perform any substitution perform complex substitution, but due to a bug, complex substitution sometimes does simple substitution instead. We therefore tell users that only simple substitution is performed in the stable branch, because that is the only thing that is guaranteed to work. [[User:Meriton|Meriton]] 22:17, 15 July 2007 (CEST)&lt;/div&gt;</summary>
		<author><name>Meriton</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.wesnoth.org/index.php?title=Talk:SyntaxWML&amp;diff=16462</id>
		<title>Talk:SyntaxWML</title>
		<link rel="alternate" type="text/html" href="https://wiki.wesnoth.org/index.php?title=Talk:SyntaxWML&amp;diff=16462"/>
		<updated>2007-07-15T13:49:04Z</updated>

		<summary type="html">&lt;p&gt;Meriton: success story for workaround with empty variable&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Empty Values ==&lt;br /&gt;
&lt;br /&gt;
The workaround I posted was helpful to check whether a variable is initialized:&lt;br /&gt;
&lt;br /&gt;
 [variable]&lt;br /&gt;
     name=to_be_tested&lt;br /&gt;
     equals=$empty&lt;br /&gt;
 [/variable]&lt;br /&gt;
&lt;br /&gt;
(tested with wesnoth 1.2.5)&lt;br /&gt;
&lt;br /&gt;
Interesting it doesn't work with [set_variable]format=.&lt;br /&gt;
&lt;br /&gt;
[[User:Meriton|Meriton]] 15:49, 15 July 2007 (CEST)&lt;/div&gt;</summary>
		<author><name>Meriton</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.wesnoth.org/index.php?title=Talk:ReferenceWMLDump&amp;diff=16461</id>
		<title>Talk:ReferenceWMLDump</title>
		<link rel="alternate" type="text/html" href="https://wiki.wesnoth.org/index.php?title=Talk:ReferenceWMLDump&amp;diff=16461"/>
		<updated>2007-07-15T13:25:21Z</updated>

		<summary type="html">&lt;p&gt;Meriton: no, wesnoth 1.2.5 does not have complex substitution everywhere ...&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Kernigh wrote:&lt;br /&gt;
: Since Wesnoth 1.1.5, all simple substitution was eliminated in favor of complex substitution, which is more versatile.&lt;br /&gt;
&lt;br /&gt;
There is no source for this claim, and my tests contradict it: In wesnoth 1.2.5, the WML snippet&lt;br /&gt;
 			{VARIABLE foo_bar 42}&lt;br /&gt;
 			{VARIABLE b bar}&lt;br /&gt;
 			[gold]&lt;br /&gt;
 				side=1&lt;br /&gt;
 				amount=$foo_$b&lt;br /&gt;
 			[/gold]&lt;br /&gt;
does nothing, but &lt;br /&gt;
 			{VARIABLE foo_bar 42}&lt;br /&gt;
 			{VARIABLE b bar}&lt;br /&gt;
 			{VARIABLE_OP temp format $foo_$b}&lt;br /&gt;
 			[gold]&lt;br /&gt;
 				side=1&lt;br /&gt;
 				amount=$temp&lt;br /&gt;
 			[/gold]&lt;br /&gt;
adds 42 gold to side 1. I have therefore reverted the edit. Please only change the content of this page if you are sure you are right.&lt;br /&gt;
&lt;br /&gt;
[[User:Meriton|Meriton]] 15:25, 15 July 2007 (CEST)&lt;/div&gt;</summary>
		<author><name>Meriton</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.wesnoth.org/index.php?title=Talk:ReferenceWMLDump&amp;diff=16440</id>
		<title>Talk:ReferenceWMLDump</title>
		<link rel="alternate" type="text/html" href="https://wiki.wesnoth.org/index.php?title=Talk:ReferenceWMLDump&amp;diff=16440"/>
		<updated>2007-07-14T16:08:12Z</updated>

		<summary type="html">&lt;p&gt;Meriton: removed outdated discussion&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Meriton</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.wesnoth.org/index.php?title=SyntaxWML&amp;diff=16338</id>
		<title>SyntaxWML</title>
		<link rel="alternate" type="text/html" href="https://wiki.wesnoth.org/index.php?title=SyntaxWML&amp;diff=16338"/>
		<updated>2007-07-05T22:23:14Z</updated>

		<summary type="html">&lt;p&gt;Meriton: /* Empty Values */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{WML Tags}}&lt;br /&gt;
Wesnoth syntax has two basic elements: ''tags'' and ''attributes''.&lt;br /&gt;
Further, ''attributes'' consist of ''keys'' and ''values''.&lt;br /&gt;
Tag names and keys cannot contain whitespace.&lt;br /&gt;
Any line beginning with a pound ('''#''') sign is considered by&lt;br /&gt;
WML as a comment, except for preprocessor declarations beginning&lt;br /&gt;
with #.&lt;br /&gt;
* '''[tag-name] ''data'' [/tag-name]''' is a tag.  Tags are used to partition information.  A ''top level'' tag is one that is not inside any other tag.  Each top level tag describes something about the game.  Different tags work differently.  For information about how a certain tag works, see [[ReferenceWML]].&lt;br /&gt;
* '''[+tag-name] ''data'' [/tag-name]''' means that ''data'' will be considered as part of the data for the most recent [''tag-name''] tag.  The ''data'' of '''[+tag-name]''' will be considered as coming after all data in '''[tag-name]''', so attributes of '''[+tag-name]''' will replace attributes of the original '''[tag-name]'''.&lt;br /&gt;
* '''''key=value newline''''' is an ''attribute'', or an assignment of a value to a key.  When this line is processed, the value of ''key'' for the tag that the attribute is in is set or changed to ''value''.  All text from '=' until the end of the line is considered to be part of ''value''. Note that ''key'' is not a WML variable (with the exception of [[VariablesWML]]); the value it is set to has a use which is determined by C++ code, not WML code.  In order to change the value of a WML variable, you need to use '''[set_variable]''' (see [[InternalActionsWML]]).  '''There should be no space between the key and the '=' symbol!'''  If there is whitespace, the attribute assignment is ignored. Note that ''key'' should contain only alphanumerics or underscores (''a-zA-Z0-9_''); no ''+'' or ''-'' characters are allowed.&lt;br /&gt;
* '''''key1,key2,key3=value1,value2,value3 newline''''' is a multiple assignment.  If there are extra keys, they will be set to an empty value.  If there are extra values the last key will be set to the comma separated list of all remaining values.  It is the same as&lt;br /&gt;
  key1=value1&lt;br /&gt;
  key2=value2&lt;br /&gt;
  key3=value3&lt;br /&gt;
&lt;br /&gt;
Although a value can be just text corresponding to a function of&lt;br /&gt;
its key (these values are displayed in quotes (') in&lt;br /&gt;
[[ReferenceWML]]), a value can also be encoded:&lt;br /&gt;
* '''&amp;quot;''multiple-line-value''&amp;quot;''' a multiple-line value must be enclosed in quotes, to prevent it being interpreted as a single-line value.  Note that ''multiple-line-value'' doesn't have to have multiple lines; it can simply be a single-line value enclosed in quotes for clarity.&lt;br /&gt;
* '''''_ &amp;quot;text&amp;quot;''''' is a ''translatable'' value.  ''text'' is English (US) text that will be displayed in-game at some point.  Gettext (see [[GetText]]) is used to determine what to display if English (US) is not the current language.&lt;br /&gt;
* '''''value-1 + value-2''''' can be used to concatenate two different strings.  If you want to have a value that actually has a plus sign ('''+''') in it, you need to enclose the string containing the '''+''' character in quotes (see '''''&amp;quot;multiple-line-value&amp;quot;''''' above).&lt;br /&gt;
* '''''$variable-name''''' a ''variable'' value depends on the value of the WML variable ''variable-name''.  See [[VariablesWML]] for more information on WML-variable based values.&lt;br /&gt;
&lt;br /&gt;
=== Empty Values ===&lt;br /&gt;
Usually, wesnoth does not distinguish between a key that has not been provided, and a key that has been assigned an empty value. To provide a key with an empty value, you can write&lt;br /&gt;
  key=$empty&lt;br /&gt;
where 'empty' is a WML variable that has not been assigned yet. (This is not technically an empty value, and hence wesnoth will notice that this key has been provided, but will become empty during variable substitution.)&lt;br /&gt;
&lt;br /&gt;
=== Example ===&lt;br /&gt;
 [scenario]&lt;br /&gt;
         id=Elves Besieged&lt;br /&gt;
         [side]&lt;br /&gt;
                 side,gold=1,100&lt;br /&gt;
         [/side]&lt;br /&gt;
         [+side]&lt;br /&gt;
                 recruit=Elvish Fighter,Elvish Archer&lt;br /&gt;
         [/side]&lt;br /&gt;
 [/scenario]&lt;br /&gt;
In this example, [scenario] is a top level tag.  When these&lt;br /&gt;
lines are read, WML will know that there is a scenario with&lt;br /&gt;
the ID &amp;quot;Elves Besieged&amp;quot;.  Later, when WML is told to play&lt;br /&gt;
that scenario, it will read the [side] tag and give 100 gold&lt;br /&gt;
to side 1.  Then it will read the [+side] tag.&lt;br /&gt;
It interprets this tag as belonging to side 1, since the&lt;br /&gt;
most recent [side] belonged to side 1.  So the [+side] tag&lt;br /&gt;
allows side 1 to recruit Elvish Fighters and Elvish Archers.&lt;br /&gt;
(Then it will crash, as the leader of side 1 has no unit type.&lt;br /&gt;
But this isn't really important.)&lt;br /&gt;
&lt;br /&gt;
Notes: Normally the order and indentation of attributes and tags&lt;br /&gt;
does not matter, as long as the levels within tags are not changed.&lt;br /&gt;
So the above example could have been written:&lt;br /&gt;
 [scenario]&lt;br /&gt;
          [side]&lt;br /&gt;
                   gold=100&lt;br /&gt;
                   side=1&lt;br /&gt;
          [/side]&lt;br /&gt;
          id=Elves Besieged&lt;br /&gt;
 [/scenario]&lt;br /&gt;
Data inside tags should be separated with tabbing; see [[ConventionsWML]].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== See Also ==&lt;br /&gt;
&lt;br /&gt;
* [[PreprocessorRef]]&lt;br /&gt;
* [[ReferenceWML]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category: WML Reference]]&lt;/div&gt;</summary>
		<author><name>Meriton</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.wesnoth.org/index.php?title=SyntaxWML&amp;diff=16337</id>
		<title>SyntaxWML</title>
		<link rel="alternate" type="text/html" href="https://wiki.wesnoth.org/index.php?title=SyntaxWML&amp;diff=16337"/>
		<updated>2007-07-05T22:07:12Z</updated>

		<summary type="html">&lt;p&gt;Meriton: /* Empty Values */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{WML Tags}}&lt;br /&gt;
Wesnoth syntax has two basic elements: ''tags'' and ''attributes''.&lt;br /&gt;
Further, ''attributes'' consist of ''keys'' and ''values''.&lt;br /&gt;
Tag names and keys cannot contain whitespace.&lt;br /&gt;
Any line beginning with a pound ('''#''') sign is considered by&lt;br /&gt;
WML as a comment, except for preprocessor declarations beginning&lt;br /&gt;
with #.&lt;br /&gt;
* '''[tag-name] ''data'' [/tag-name]''' is a tag.  Tags are used to partition information.  A ''top level'' tag is one that is not inside any other tag.  Each top level tag describes something about the game.  Different tags work differently.  For information about how a certain tag works, see [[ReferenceWML]].&lt;br /&gt;
* '''[+tag-name] ''data'' [/tag-name]''' means that ''data'' will be considered as part of the data for the most recent [''tag-name''] tag.  The ''data'' of '''[+tag-name]''' will be considered as coming after all data in '''[tag-name]''', so attributes of '''[+tag-name]''' will replace attributes of the original '''[tag-name]'''.&lt;br /&gt;
* '''''key=value newline''''' is an ''attribute'', or an assignment of a value to a key.  When this line is processed, the value of ''key'' for the tag that the attribute is in is set or changed to ''value''.  All text from '=' until the end of the line is considered to be part of ''value''. Note that ''key'' is not a WML variable (with the exception of [[VariablesWML]]); the value it is set to has a use which is determined by C++ code, not WML code.  In order to change the value of a WML variable, you need to use '''[set_variable]''' (see [[InternalActionsWML]]).  '''There should be no space between the key and the '=' symbol!'''  If there is whitespace, the attribute assignment is ignored. Note that ''key'' should contain only alphanumerics or underscores (''a-zA-Z0-9_''); no ''+'' or ''-'' characters are allowed.&lt;br /&gt;
* '''''key1,key2,key3=value1,value2,value3 newline''''' is a multiple assignment.  If there are extra keys, they will be set to an empty value.  If there are extra values the last key will be set to the comma separated list of all remaining values.  It is the same as&lt;br /&gt;
  key1=value1&lt;br /&gt;
  key2=value2&lt;br /&gt;
  key3=value3&lt;br /&gt;
&lt;br /&gt;
Although a value can be just text corresponding to a function of&lt;br /&gt;
its key (these values are displayed in quotes (') in&lt;br /&gt;
[[ReferenceWML]]), a value can also be encoded:&lt;br /&gt;
* '''&amp;quot;''multiple-line-value''&amp;quot;''' a multiple-line value must be enclosed in quotes, to prevent it being interpreted as a single-line value.  Note that ''multiple-line-value'' doesn't have to have multiple lines; it can simply be a single-line value enclosed in quotes for clarity.&lt;br /&gt;
* '''''_ &amp;quot;text&amp;quot;''''' is a ''translatable'' value.  ''text'' is English (US) text that will be displayed in-game at some point.  Gettext (see [[GetText]]) is used to determine what to display if English (US) is not the current language.&lt;br /&gt;
* '''''value-1 + value-2''''' can be used to concatenate two different strings.  If you want to have a value that actually has a plus sign ('''+''') in it, you need to enclose the string containing the '''+''' character in quotes (see '''''&amp;quot;multiple-line-value&amp;quot;''''' above).&lt;br /&gt;
* '''''$variable-name''''' a ''variable'' value depends on the value of the WML variable ''variable-name''.  See [[VariablesWML]] for more information on WML-variable based values.&lt;br /&gt;
&lt;br /&gt;
=== Empty Values ===&lt;br /&gt;
Usually, wesnoth does not distinguish between a key that has not been provided, and a key that has been assigned an empty value. To provide a key with an empty value, you can write&lt;br /&gt;
  key=$empty&lt;br /&gt;
where 'empty' is a WML variable that has not been assigned yet. (This is not technically an empty value, and hence wesnoth will notice that this key has been provided, but becomes empty during variable substitution.)&lt;br /&gt;
&lt;br /&gt;
=== Example ===&lt;br /&gt;
 [scenario]&lt;br /&gt;
         id=Elves Besieged&lt;br /&gt;
         [side]&lt;br /&gt;
                 side,gold=1,100&lt;br /&gt;
         [/side]&lt;br /&gt;
         [+side]&lt;br /&gt;
                 recruit=Elvish Fighter,Elvish Archer&lt;br /&gt;
         [/side]&lt;br /&gt;
 [/scenario]&lt;br /&gt;
In this example, [scenario] is a top level tag.  When these&lt;br /&gt;
lines are read, WML will know that there is a scenario with&lt;br /&gt;
the ID &amp;quot;Elves Besieged&amp;quot;.  Later, when WML is told to play&lt;br /&gt;
that scenario, it will read the [side] tag and give 100 gold&lt;br /&gt;
to side 1.  Then it will read the [+side] tag.&lt;br /&gt;
It interprets this tag as belonging to side 1, since the&lt;br /&gt;
most recent [side] belonged to side 1.  So the [+side] tag&lt;br /&gt;
allows side 1 to recruit Elvish Fighters and Elvish Archers.&lt;br /&gt;
(Then it will crash, as the leader of side 1 has no unit type.&lt;br /&gt;
But this isn't really important.)&lt;br /&gt;
&lt;br /&gt;
Notes: Normally the order and indentation of attributes and tags&lt;br /&gt;
does not matter, as long as the levels within tags are not changed.&lt;br /&gt;
So the above example could have been written:&lt;br /&gt;
 [scenario]&lt;br /&gt;
          [side]&lt;br /&gt;
                   gold=100&lt;br /&gt;
                   side=1&lt;br /&gt;
          [/side]&lt;br /&gt;
          id=Elves Besieged&lt;br /&gt;
 [/scenario]&lt;br /&gt;
Data inside tags should be separated with tabbing; see [[ConventionsWML]].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== See Also ==&lt;br /&gt;
&lt;br /&gt;
* [[PreprocessorRef]]&lt;br /&gt;
* [[ReferenceWML]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category: WML Reference]]&lt;/div&gt;</summary>
		<author><name>Meriton</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.wesnoth.org/index.php?title=SyntaxWML&amp;diff=16336</id>
		<title>SyntaxWML</title>
		<link rel="alternate" type="text/html" href="https://wiki.wesnoth.org/index.php?title=SyntaxWML&amp;diff=16336"/>
		<updated>2007-07-05T22:06:02Z</updated>

		<summary type="html">&lt;p&gt;Meriton: clarified previous edit&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{WML Tags}}&lt;br /&gt;
Wesnoth syntax has two basic elements: ''tags'' and ''attributes''.&lt;br /&gt;
Further, ''attributes'' consist of ''keys'' and ''values''.&lt;br /&gt;
Tag names and keys cannot contain whitespace.&lt;br /&gt;
Any line beginning with a pound ('''#''') sign is considered by&lt;br /&gt;
WML as a comment, except for preprocessor declarations beginning&lt;br /&gt;
with #.&lt;br /&gt;
* '''[tag-name] ''data'' [/tag-name]''' is a tag.  Tags are used to partition information.  A ''top level'' tag is one that is not inside any other tag.  Each top level tag describes something about the game.  Different tags work differently.  For information about how a certain tag works, see [[ReferenceWML]].&lt;br /&gt;
* '''[+tag-name] ''data'' [/tag-name]''' means that ''data'' will be considered as part of the data for the most recent [''tag-name''] tag.  The ''data'' of '''[+tag-name]''' will be considered as coming after all data in '''[tag-name]''', so attributes of '''[+tag-name]''' will replace attributes of the original '''[tag-name]'''.&lt;br /&gt;
* '''''key=value newline''''' is an ''attribute'', or an assignment of a value to a key.  When this line is processed, the value of ''key'' for the tag that the attribute is in is set or changed to ''value''.  All text from '=' until the end of the line is considered to be part of ''value''. Note that ''key'' is not a WML variable (with the exception of [[VariablesWML]]); the value it is set to has a use which is determined by C++ code, not WML code.  In order to change the value of a WML variable, you need to use '''[set_variable]''' (see [[InternalActionsWML]]).  '''There should be no space between the key and the '=' symbol!'''  If there is whitespace, the attribute assignment is ignored. Note that ''key'' should contain only alphanumerics or underscores (''a-zA-Z0-9_''); no ''+'' or ''-'' characters are allowed.&lt;br /&gt;
* '''''key1,key2,key3=value1,value2,value3 newline''''' is a multiple assignment.  If there are extra keys, they will be set to an empty value.  If there are extra values the last key will be set to the comma separated list of all remaining values.  It is the same as&lt;br /&gt;
  key1=value1&lt;br /&gt;
  key2=value2&lt;br /&gt;
  key3=value3&lt;br /&gt;
&lt;br /&gt;
Although a value can be just text corresponding to a function of&lt;br /&gt;
its key (these values are displayed in quotes (') in&lt;br /&gt;
[[ReferenceWML]]), a value can also be encoded:&lt;br /&gt;
* '''&amp;quot;''multiple-line-value''&amp;quot;''' a multiple-line value must be enclosed in quotes, to prevent it being interpreted as a single-line value.  Note that ''multiple-line-value'' doesn't have to have multiple lines; it can simply be a single-line value enclosed in quotes for clarity.&lt;br /&gt;
* '''''_ &amp;quot;text&amp;quot;''''' is a ''translatable'' value.  ''text'' is English (US) text that will be displayed in-game at some point.  Gettext (see [[GetText]]) is used to determine what to display if English (US) is not the current language.&lt;br /&gt;
* '''''value-1 + value-2''''' can be used to concatenate two different strings.  If you want to have a value that actually has a plus sign ('''+''') in it, you need to enclose the string containing the '''+''' character in quotes (see '''''&amp;quot;multiple-line-value&amp;quot;''''' above).&lt;br /&gt;
* '''''$variable-name''''' a ''variable'' value depends on the value of the WML variable ''variable-name''.  See [[VariablesWML]] for more information on WML-variable based values.&lt;br /&gt;
&lt;br /&gt;
=== Empty Values ===&lt;br /&gt;
Usually, wesnoth does not distinguish between a key that has not been assigned, and a key that has been assigned an empty value. To assign an empty value, you can write&lt;br /&gt;
  key=$empty&lt;br /&gt;
where 'empty' is a WML variable that has not been assigned yet. (This is not technically an empty value, and hence wesnoth will notice that this key has been provided, but becomes empty during variable substitution.)&lt;br /&gt;
&lt;br /&gt;
=== Example ===&lt;br /&gt;
 [scenario]&lt;br /&gt;
         id=Elves Besieged&lt;br /&gt;
         [side]&lt;br /&gt;
                 side,gold=1,100&lt;br /&gt;
         [/side]&lt;br /&gt;
         [+side]&lt;br /&gt;
                 recruit=Elvish Fighter,Elvish Archer&lt;br /&gt;
         [/side]&lt;br /&gt;
 [/scenario]&lt;br /&gt;
In this example, [scenario] is a top level tag.  When these&lt;br /&gt;
lines are read, WML will know that there is a scenario with&lt;br /&gt;
the ID &amp;quot;Elves Besieged&amp;quot;.  Later, when WML is told to play&lt;br /&gt;
that scenario, it will read the [side] tag and give 100 gold&lt;br /&gt;
to side 1.  Then it will read the [+side] tag.&lt;br /&gt;
It interprets this tag as belonging to side 1, since the&lt;br /&gt;
most recent [side] belonged to side 1.  So the [+side] tag&lt;br /&gt;
allows side 1 to recruit Elvish Fighters and Elvish Archers.&lt;br /&gt;
(Then it will crash, as the leader of side 1 has no unit type.&lt;br /&gt;
But this isn't really important.)&lt;br /&gt;
&lt;br /&gt;
Notes: Normally the order and indentation of attributes and tags&lt;br /&gt;
does not matter, as long as the levels within tags are not changed.&lt;br /&gt;
So the above example could have been written:&lt;br /&gt;
 [scenario]&lt;br /&gt;
          [side]&lt;br /&gt;
                   gold=100&lt;br /&gt;
                   side=1&lt;br /&gt;
          [/side]&lt;br /&gt;
          id=Elves Besieged&lt;br /&gt;
 [/scenario]&lt;br /&gt;
Data inside tags should be separated with tabbing; see [[ConventionsWML]].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== See Also ==&lt;br /&gt;
&lt;br /&gt;
* [[PreprocessorRef]]&lt;br /&gt;
* [[ReferenceWML]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category: WML Reference]]&lt;/div&gt;</summary>
		<author><name>Meriton</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.wesnoth.org/index.php?title=SyntaxWML&amp;diff=16335</id>
		<title>SyntaxWML</title>
		<link rel="alternate" type="text/html" href="https://wiki.wesnoth.org/index.php?title=SyntaxWML&amp;diff=16335"/>
		<updated>2007-07-05T21:33:45Z</updated>

		<summary type="html">&lt;p&gt;Meriton: Mentioned that assigning the empty string to an attribute is usually ignored.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{WML Tags}}&lt;br /&gt;
Wesnoth syntax has two basic elements: ''tags'' and ''attributes''.&lt;br /&gt;
Further, ''attributes'' consist of ''keys'' and ''values''.&lt;br /&gt;
Tag names and keys cannot contain whitespace.&lt;br /&gt;
Any line beginning with a pound ('''#''') sign is considered by&lt;br /&gt;
WML as a comment, except for preprocessor declarations beginning&lt;br /&gt;
with #.&lt;br /&gt;
* '''[tag-name] ''data'' [/tag-name]''' is a tag.  Tags are used to partition information.  A ''top level'' tag is one that is not inside any other tag.  Each top level tag describes something about the game.  Different tags work differently.  For information about how a certain tag works, see [[ReferenceWML]].&lt;br /&gt;
* '''[+tag-name] ''data'' [/tag-name]''' means that ''data'' will be considered as part of the data for the most recent [''tag-name''] tag.  The ''data'' of '''[+tag-name]''' will be considered as coming after all data in '''[tag-name]''', so attributes of '''[+tag-name]''' will replace attributes of the original '''[tag-name]'''.&lt;br /&gt;
* '''''key=value newline''''' is an ''attribute'', or an assignment of a value to a key.  When this line is processed, the value of ''key'' for the tag that the attribute is in is set or changed to ''value''.  All text from '=' until the end of the line is considered to be part of ''value''. Note that ''key'' is not a WML variable (with the exception of [[VariablesWML]]); the value it is set to has a use which is determined by C++ code, not WML code.  In order to change the value of a WML variable, you need to use '''[set_variable]''' (see [[InternalActionsWML]]).  '''There should be no space between the key and the '=' symbol!'''  If there is whitespace, the attribute assignment is ignored. For most keys, the assignment is also ignored if ''value'' is the empty string. Note that ''key'' should contain only alphanumerics or underscores (''a-zA-Z0-9_''); no ''+'' or ''-'' characters are allowed.&lt;br /&gt;
* '''''key1,key2,key3=value1,value2,value3 newline''''' is a multiple assignment.  If there are extra keys, they will be set to an empty value.  If there are extra values the last key will be set to the comma separated list of all remaining values.  It is the same as&lt;br /&gt;
  key1=value1&lt;br /&gt;
  key2=value2&lt;br /&gt;
  key3=value3&lt;br /&gt;
&lt;br /&gt;
Although a value can be just text corresponding to a function of&lt;br /&gt;
its key (these values are displayed in quotes (') in&lt;br /&gt;
[[ReferenceWML]]), a value can also be encoded:&lt;br /&gt;
* '''&amp;quot;''multiple-line-value''&amp;quot;''' a multiple-line value must be enclosed in quotes, to prevent it being interpreted as a single-line value.  Note that ''multiple-line-value'' doesn't have to have multiple lines; it can simply be a single-line value enclosed in quotes for clarity.&lt;br /&gt;
* '''''_ &amp;quot;text&amp;quot;''''' is a ''translatable'' value.  ''text'' is English (US) text that will be displayed in-game at some point.  Gettext (see [[GetText]]) is used to determine what to display if English (US) is not the current language.&lt;br /&gt;
* '''''value-1 + value-2''''' can be used to concatenate two different strings.  If you want to have a value that actually has a plus sign ('''+''') in it, you need to enclose the string containing the '''+''' character in quotes (see '''''&amp;quot;multiple-line-value&amp;quot;''''' above).&lt;br /&gt;
* '''''$variable-name''''' a ''variable'' value depends on the value of the WML variable ''variable-name''.  See [[VariablesWML]] for more information on WML-variable based values.&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
 [scenario]&lt;br /&gt;
         id=Elves Besieged&lt;br /&gt;
         [side]&lt;br /&gt;
                 side,gold=1,100&lt;br /&gt;
         [/side]&lt;br /&gt;
         [+side]&lt;br /&gt;
                 recruit=Elvish Fighter,Elvish Archer&lt;br /&gt;
         [/side]&lt;br /&gt;
 [/scenario]&lt;br /&gt;
In this example, [scenario] is a top level tag.  When these&lt;br /&gt;
lines are read, WML will know that there is a scenario with&lt;br /&gt;
the ID &amp;quot;Elves Besieged&amp;quot;.  Later, when WML is told to play&lt;br /&gt;
that scenario, it will read the [side] tag and give 100 gold&lt;br /&gt;
to side 1.  Then it will read the [+side] tag.&lt;br /&gt;
It interprets this tag as belonging to side 1, since the&lt;br /&gt;
most recent [side] belonged to side 1.  So the [+side] tag&lt;br /&gt;
allows side 1 to recruit Elvish Fighters and Elvish Archers.&lt;br /&gt;
(Then it will crash, as the leader of side 1 has no unit type.&lt;br /&gt;
But this isn't really important.)&lt;br /&gt;
&lt;br /&gt;
Notes: Normally the order and indentation of attributes and tags&lt;br /&gt;
does not matter, as long as the levels within tags are not changed.&lt;br /&gt;
So the above example could have been written:&lt;br /&gt;
 [scenario]&lt;br /&gt;
          [side]&lt;br /&gt;
                   gold=100&lt;br /&gt;
                   side=1&lt;br /&gt;
          [/side]&lt;br /&gt;
          id=Elves Besieged&lt;br /&gt;
 [/scenario]&lt;br /&gt;
Data inside tags should be separated with tabbing; see [[ConventionsWML]].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== See Also ==&lt;br /&gt;
&lt;br /&gt;
* [[PreprocessorRef]]&lt;br /&gt;
* [[ReferenceWML]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category: WML Reference]]&lt;/div&gt;</summary>
		<author><name>Meriton</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.wesnoth.org/index.php?title=BuildingCampaignsTheCampaignFile&amp;diff=14237</id>
		<title>BuildingCampaignsTheCampaignFile</title>
		<link rel="alternate" type="text/html" href="https://wiki.wesnoth.org/index.php?title=BuildingCampaignsTheCampaignFile&amp;diff=14237"/>
		<updated>2007-03-10T17:05:09Z</updated>

		<summary type="html">&lt;p&gt;Meriton: that space fooled my wesnoth's preprocessor parser&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Each campaign must contain a WML file which contains a [campaign] tag. In order for the campaign to be translatable, it must also contain a [textdomain] tag, which should precede the [campaign] tag.&lt;br /&gt;
&lt;br /&gt;
This file contains the information the game needs to find the rest of the bits of your campaign scattered in other files and put them together to have a playable campaign.  Much information about this file can be found in the [[CampaignWML]] entry.  What follows is a description of each line of the campaign file and an explanation of what it does.&lt;br /&gt;
&lt;br /&gt;
For our purposes I'll assume we've already created a campaign called simple_campaign with the directory structure outlined in [[BuildingCampaignsDirectoryStructure]].&lt;br /&gt;
&lt;br /&gt;
The first line of the campaign file is the [textdomain] WML tag, which specifies where the game should look for translations to the strings in the campaign. The textdomain tag specifies a name for the textdomain, which is what is used in the [campaign] tag, and in f ex campaign scenarios to connect the strings with translations. The textdomain should be unique, and start with 'wesnoth-', to ensure that it does not conflict with other textdomains that might be specified on a given system. &lt;br /&gt;
The textdomain also specifies a path to the directory where the compiled translation files will be stored. This should be a file inside the campaign directory.&lt;br /&gt;
&lt;br /&gt;
Ex.&lt;br /&gt;
     [textdomain]&lt;br /&gt;
          name=&amp;quot;wesnoth-Simple_Campaign&amp;quot;&lt;br /&gt;
          path=&amp;quot;data/campaigns/simple_campaign/translations&amp;quot;&lt;br /&gt;
     [/textdomain]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Then follows the [campaign] WML tag that lets the game know this is a campaign:&lt;br /&gt;
&lt;br /&gt;
     [campaign]&lt;br /&gt;
&lt;br /&gt;
First associate the campaign with the textdomain you have just defined:&lt;br /&gt;
     #textdomain wesnoth-Simple_Campaign&lt;br /&gt;
&lt;br /&gt;
The next group of lines uniquely identifies the campaign:&lt;br /&gt;
&lt;br /&gt;
     name= _ &amp;quot;A Simple Campaign&amp;quot;&lt;br /&gt;
     define=CAMPAIGN_SIMPLE_CAMPAIGN&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[In earlier version, there was also ''id'' which was a unique identifier used for translation, but now has no effect.]&lt;br /&gt;
&lt;br /&gt;
''name'' is the name of your campaign that the user will see.  It must be in quotation marks and be preceded by an underscore to facilitate translation.  ''define'' creates a key that lets the game know when a user has selected to play a scenario from your campaign.  More on it in a bit.  If you are missing any of these your campaign will not work correctly.&lt;br /&gt;
&lt;br /&gt;
The next group gives the user information about your campaign when he selects it from the campaign menu:&lt;br /&gt;
&lt;br /&gt;
     icon=a_wesnoth_icon.png&lt;br /&gt;
     image= simple_campaign_logo.png&lt;br /&gt;
     description= _ &amp;quot;Some text about my campaign!&amp;quot;&lt;br /&gt;
&lt;br /&gt;
''icon'' is a reference to any of the standard Wesnoth images.  It will be displayed in the campaign selection menu. When appropriate, it should use [[ImagePathFunctionWML]] to give the icon a team color instead of magenta. ''image'' is an image that will be displayed when a user clicks on the campaign.  ''description'' is a text description that will be shown to the user at the same time as ''image''.  Note that none of these three are strictly necessary, but they do make your campaign look nice and professional.&lt;br /&gt;
&lt;br /&gt;
     difficulties=EASY,NORMAL,HARD&lt;br /&gt;
     difficulty_descriptions={MENU_IMG_TXT2 *&amp;amp;units/human-loyalists/peasant.png?TC(1,magenta) _&amp;quot;Civilian&amp;quot; _&amp;quot;(trivial)&amp;quot;} +&lt;br /&gt;
     &amp;quot;;&amp;quot; + {MENU_IMG_TXT2 units/human-loyalists/spearman.png?TC(1,magenta) _&amp;quot;Soldier&amp;quot; _&amp;quot;(simple)&amp;quot;} +&lt;br /&gt;
     &amp;quot;;&amp;quot; + {MENU_IMG_TXT2 units/human-loyalists/pikeman.png?TC(1,magenta) _&amp;quot;Veteran&amp;quot; _&amp;quot;(easy)&amp;quot;}&lt;br /&gt;
&lt;br /&gt;
''difficulties'' creates three definitions for three different difficulty levels.  For more information on difficulty levels and balancing see [[BuildingCampaignsBalancing]].&lt;br /&gt;
&lt;br /&gt;
     first_scenario=the_first_scenario&lt;br /&gt;
&lt;br /&gt;
''first_scenario'' is a reference to the scenario ''id'' of the scenario that you intend to be loaded and played first.&lt;br /&gt;
This line is essential.  Note that while　you are debugging and testing your campaign, it's often useful to change this line to the scenario you're working on so　you don't have to play through all&lt;br /&gt;
the scenarios that come before it.  (You could also just play through your campaign saving at each level.)&lt;br /&gt;
&lt;br /&gt;
     [/campaign]&lt;br /&gt;
&lt;br /&gt;
That's all that needs to be in the [campaign] tag, so we can close it here.&lt;br /&gt;
&lt;br /&gt;
There's more we want to do, though:  we've　got to tell Wesnoth where our various&lt;br /&gt;
additional files are located (i.e. our maps, scenarios, units, images, and sounds).&lt;br /&gt;
&lt;br /&gt;
You should put everything not in the [campaign] tag inside&lt;br /&gt;
  #ifdef CAMPAIGN_SIMPLE_CAMPAIGN&lt;br /&gt;
  ...&lt;br /&gt;
  #endif&lt;br /&gt;
so that your custom macros, WML code, and inclusion of files do not affect other campaigns and slow the game down.  The only exception to this is the [binary_path] tag specifying the path to custom images in your campaign, but you should only put this outside the #ifdef if you need custom images for the campaign selection menu and the difficulty selection menu.  Otherwise even this belongs inside the #ifdef.&lt;br /&gt;
&lt;br /&gt;
A fairly minimal #ifdef section might just contain a link to your scenarios.&lt;br /&gt;
&lt;br /&gt;
 #ifdef CAMPAIGN_SIMPLE_CAMPAIGN&lt;br /&gt;
 &lt;br /&gt;
 {@campaigns/simple_campaign/scenarios}&lt;br /&gt;
 &lt;br /&gt;
 #endif&lt;br /&gt;
&lt;br /&gt;
The {@campaigns/simple_campaign/scenarios} line just looks in your campaign's &amp;quot;scenarios&amp;quot; directory and parses any .cfg files it finds there (see [[BuildingScenarios]] for information on making your scenario files). If you have any other .cfg files (macros, custom terrains, etc.), you can link them in a similar way. If you want to use custom units however, you will have to link them from inside a [+units] tag (using the &amp;quot;+&amp;quot; adds them to wesnoth's stored units - this is important) like so:&lt;br /&gt;
&lt;br /&gt;
 [+units]&lt;br /&gt;
 {@campaigns/simple_campaign/units}&lt;br /&gt;
 [/units]&lt;br /&gt;
&lt;br /&gt;
== Next: ==&lt;br /&gt;
* [[BuildingCampaignsThePBLFile]]&lt;br /&gt;
&lt;br /&gt;
[http://www.example.com link title]&lt;br /&gt;
----&lt;br /&gt;
--[[User:Dfrf|Dfrf]] 17:16, 15 December 2006 (CET)== See Also ==&lt;br /&gt;
&lt;br /&gt;
* [[BuildingCampaignsDirectoryStructure]]&lt;br /&gt;
* [[BuildingCampaigns]]&lt;br /&gt;
yyy''Italic text'''''Bold text'''[[Link title]]&lt;/div&gt;</summary>
		<author><name>Meriton</name></author>
		
	</entry>
</feed>