<?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=Luther</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=Luther"/>
	<link rel="alternate" type="text/html" href="https://wiki.wesnoth.org/Special:Contributions/Luther"/>
	<updated>2026-05-07T01:53:13Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.31.16</generator>
	<entry>
		<id>https://wiki.wesnoth.org/index.php?title=WesnothTranslations&amp;diff=70595</id>
		<title>WesnothTranslations</title>
		<link rel="alternate" type="text/html" href="https://wiki.wesnoth.org/index.php?title=WesnothTranslations&amp;diff=70595"/>
		<updated>2023-02-22T00:24:22Z</updated>

		<summary type="html">&lt;p&gt;Luther: Change my email address&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. Instructions on how to contribute are found here:&lt;br /&gt;
[[WesnothTranslationsHowTo]].&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;
| [[AncientGreekTranslation|Ancient Greek]] || None || N/A&lt;br /&gt;
|-&lt;br /&gt;
| [[ArabicTranslation|Arabic]] || Mejri Ziad (Hermestrismi)|| [mailto:beja.comuneATgmailDOTcom]&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;
| [[BulgarianTranslation|Bulgarian]] || Ivan Petrov (TheWhiteKnight) || [mailto:vankata_petrovATabvDOTbg]&lt;br /&gt;
|-&lt;br /&gt;
| [[CatalanTranslation|Catalan]] || Miquel-Àngel Burgos i Fradeja || [mailto:miquel.angel.burgosATgmailDOTcom]&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;
| [[CroatianTranslation|Croatian]] || None || N/A&lt;br /&gt;
|-&lt;br /&gt;
| [[CzechTranslation|Czech]] || Michal Žejdl || [mailto:lachimATemerDOTcz]&lt;br /&gt;
|-&lt;br /&gt;
| [[DanishTranslation|Danish]] || None || N/A&lt;br /&gt;
|-&lt;br /&gt;
| [[DutchTranslation|Dutch]] || Merijn de Vet || [mailto:tybonzerATliveDOTnl]&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]] || Luther Thompson || [mailto:lutherotoATgmailDOTcom]&lt;br /&gt;
|-&lt;br /&gt;
| [[EstonianTranslation|Estonian]] || None || N/A&lt;br /&gt;
|-&lt;br /&gt;
| [[FilipinoTranslation|Filipino]] || None || N/A&lt;br /&gt;
|-&lt;br /&gt;
| [[FinnishTranslation|Finnish]] || Jaakko Saarikko (styxnix) || [mailto:jaakkoDOTsaarikkoATprotonmailDOTcom]&lt;br /&gt;
|-&lt;br /&gt;
| [[FrenchTranslation|French]] || Mathieu Guilbaud (Guim) || Translations ML&lt;br /&gt;
|-&lt;br /&gt;
| [[GalicianTranslation|Galician]] || None || N/A&lt;br /&gt;
|-&lt;br /&gt;
| [[GermanTranslation|German]] || Aaron Winter (Bitron) || &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;
| [[HungarianTranslation|Hungarian]] || Széll András || [mailto:szellDOTandrisATgmailDOTcom]&lt;br /&gt;
|-&lt;br /&gt;
| [[IcelandicTranslation|Icelandic]] || None || N/A&lt;br /&gt;
|-&lt;br /&gt;
| [[IndonesianTranslation|Indonesian]] || Irsyad Musthafa || [mailto:sevennightmareATtutanotaDOTde]&lt;br /&gt;
|-&lt;br /&gt;
| [[IrishTranslation|Irish]] || None || N/A&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]] || 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;
| [[NorwegianTranslation|Norwegian]] || None || N/A&lt;br /&gt;
|-&lt;br /&gt;
| [[OldEnglishTranslation|Old English]] || None || N/A&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;
| [[RACVTranslation|RACV]] || None || N/A&lt;br /&gt;
|-&lt;br /&gt;
| [[RomanianTranslation|Romanian]] || None || N/A&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;
| [[SerbianTranslation|Serbian]] || None || N/A&lt;br /&gt;
|-&lt;br /&gt;
| [[SlovakTranslation#Preklad|Slovak]] || Aceman || &lt;br /&gt;
|-&lt;br /&gt;
| [[SlovenianTranslation|Slovenian]] || None || N/A&lt;br /&gt;
|-&lt;br /&gt;
| [[SpanishTranslation|Spanish]] || Toranks || [mailto:davinciATtoranksDOTes]&lt;br /&gt;
|-&lt;br /&gt;
| [[SpanishLatinAmericanTranslation|Spanish (Latin American)]] || None || N/A&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]] || 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;
* [[WesCamp| Translating User made Campaigns (featuring WesCamp-i18n)]]&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>Luther</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.wesnoth.org/index.php?title=Esperanto_translation&amp;diff=65244</id>
		<title>Esperanto translation</title>
		<link rel="alternate" type="text/html" href="https://wiki.wesnoth.org/index.php?title=Esperanto_translation&amp;diff=65244"/>
		<updated>2019-12-27T06:34:19Z</updated>

		<summary type="html">&lt;p&gt;Luther: Update the maintainer&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{(eo) Traduko}}&lt;br /&gt;
&lt;br /&gt;
En la forumo oni diskutas pri la Esperanta traduko ĉe la temo [http://www.wesnoth.org/forum/viewtopic.php?t=9742  #9742].&lt;br /&gt;
&lt;br /&gt;
Se vi volas helpi traduki, bonvolu retpoŝte kontakti na Luther Thompson (luther ĉe librem punkto one).&lt;br /&gt;
Eĉ se vi ne scipovas la anglan, vi povas traduki uzante alilingvajn ekzistantajn tradukojn.&lt;br /&gt;
&lt;br /&gt;
La tre ofte uzataj frazoj (ekzemple la nomoj de la milit-unuoj) kaj la ali-kiale gravaj frazoj (ekzemple la nomoj de scenaroj) meritas apartan atenton. Tial en tiu ĉi vikio oni kunordigas kaj pridiskutas pri ili.&lt;br /&gt;
&lt;br /&gt;
== Nuna tradukteamo ==&lt;br /&gt;
&lt;br /&gt;
* Luther Thompson - Kunordiganto - tradukas&lt;br /&gt;
&lt;br /&gt;
== Malnova tradukteamo ==&lt;br /&gt;
&lt;br /&gt;
En la programo aperas la nomoj (kaj kromnomoj) de ĉiuj kunaŭtoroj, inkluzive tradukantoj.&lt;br /&gt;
Ankaŭ por ni estas utile scii kiun kontakti rilate al unuopaj tradukoj.&lt;br /&gt;
Bonvolu trovi kaj eventuale korekti la informon pri vi jen.&lt;br /&gt;
&lt;br /&gt;
* Aleksej Korgenkov (&amp;quot;Grimpanto&amp;quot;) -- wesnoth-editor, wesnoth-tutorial&lt;br /&gt;
* Lubo Fajth -- wesnoth&lt;br /&gt;
* Maarten Albrecht -- wesnoth-ei&lt;br /&gt;
* Rasto Sarissky -- wesnoth-httt&lt;br /&gt;
* Manuel Ortega -- wesnoth, kunordiganto&lt;br /&gt;
* Viliam Bur -- kunordigado kaj helpo&lt;br /&gt;
&lt;br /&gt;
== Ligiloj ==&lt;br /&gt;
&lt;br /&gt;
* [http://wesnoth.slack.it/units.cgi Listo de milit-unuoj]&lt;br /&gt;
* [http://gettext.wesnoth.org/index.lang.php?lang=eo&amp;amp;version=trunk Statistiko de Esperanta traduko]&lt;br /&gt;
&lt;br /&gt;
[[Category:Translations]]&lt;br /&gt;
[[Category:Esperanto]]&lt;/div&gt;</summary>
		<author><name>Luther</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.wesnoth.org/index.php?title=WesnothTranslations&amp;diff=65243</id>
		<title>WesnothTranslations</title>
		<link rel="alternate" type="text/html" href="https://wiki.wesnoth.org/index.php?title=WesnothTranslations&amp;diff=65243"/>
		<updated>2019-12-27T06:23:29Z</updated>

		<summary type="html">&lt;p&gt;Luther: /* Translations */ Update Esperanto maintainer&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. Instructions on how to contribute are found here:&lt;br /&gt;
[[WesnothTranslationsHowTo]].&lt;br /&gt;
* [[AfrikaansTranslation|Afrikaans]] - maintainer: Friedel Wolff - [mailto:friedelATSIGNtranslateDOTorgDOTza]&lt;br /&gt;
* [[ArabicTranslation|Arabic]] - maintainer: Amnay Mokhtari - [mailto:amnayAToperamailDOTcom]&lt;br /&gt;
* [[BasqueTranslation|Basque]] - maintainer: Alfredo Beaumont (ziberpunk) - [mailto:alfredo.beaumontATgmailDOTcom]&lt;br /&gt;
* [[BulgarianTranslation|Bulgarian]] maintainer: Ivan Petrov (TheWhiteKnight) - [mailto:vankata_petrovATabvDOTbg]&lt;br /&gt;
* [[CatalanTranslation|Catalan]] - maintainer: Jordà Polo (ettin) - [mailto:jordaATettinDOTorg]&lt;br /&gt;
* [[ChineseTranslation|Chinese]] - maintainer: CloudiDust - [mailto:cloudidustATgmailDOTcom]&lt;br /&gt;
* [[ChineseTaiwanTranslation|Chinese (Taiwan)]] - maintainer: 楊綮銘 (Taiwan) - [mailto:steven2880ATgmailDOTcom]&lt;br /&gt;
* [[CroatianTranslation|Croatian]] - maintainer: Ivica Đurenec (charlieh65) - [mailto:ivicaDOTdurenecATgmailDOTcom]&lt;br /&gt;
* [[CzechTranslation|Czech]] - maintainer: [[User:hrubymar10|Martin Hrubý (hrubymar10)]] - [mailto:hrubymar10ATgmailDOTcom]&lt;br /&gt;
* [[DanishTranslation|Danish]] maintainer: Joe Hansen (joedalton) - [mailto:joedalton2ATyahooDOTdk]&lt;br /&gt;
* [[DutchTranslation|Dutch]] - maintainer: Merijn de Vet (Ty Bonzer) - [mailto:merijndevetAThotmailDOTcom]&lt;br /&gt;
* [[EnglishGBTranslation|English (GB)]] - maintainer: Wedge009 [mailto:wedge009ATwedge009DOTnet]&lt;br /&gt;
* [[EnglishShawTranslation|English (Shaw)]] - maintainer: Arc Riley - [mailto:ArcRileyATubuntu.com]&lt;br /&gt;
* [[Esperanto_translation|Esperanto]] - maintainer: Luther Thompson - [mailto:lutherATlibremDOTone]&lt;br /&gt;
* [[EstonianTranslation|Estonian]] - maintainer: Kaido Kikkas (UncleOwl) - [mailto:kaidoDOTkikkasATkakupesaDOTnet]&lt;br /&gt;
* [[FilipinoTranslation|Filipino]] - maintainer: Karen Eso (keeve) - [mailto:eveUNDERSCOREesoATyahooDOTca]&lt;br /&gt;
* [[FinnishTranslation|Finnish]] - maintainer: Jarkko Patteri (Jarkko) - [mailto:jarkkopatteriATgmailDOTcom], Samu Voutilainen (Smar) - [mailto:samu.voutilainenATgmailDOTcom]&lt;br /&gt;
* [[FrenchTranslation|French]] - maintainer: Mathieu Guilbaud (Guim) - Please use the translation team mailing list [mailto:wesnothATmlDOTfreeDOTfr]&lt;br /&gt;
* [[GalicianTranslation|Galician]] - maintainer: Adrián Chaves Fernández (Gallaecio) - [mailto:adriyetichavesATgmailDOTcom] [http://trasno.net Proxecto Trasno]&lt;br /&gt;
* [[GermanTranslation|German]] - maintainer: Aaron Winter (Bitron)&lt;br /&gt;
* [[GreekTranslation|Greek]] - maintainer: Konstantinos Egarhos [mailto:konsnoslATgmailDOTcom]&lt;br /&gt;
* [[HebrewTranslation|Hebrew]] - maintainer: Oron Peled - [mailto:oronATactcomDOTcoDOTil]&lt;br /&gt;
* [[HungarianTranslation|Hungarian]] - maintainer: Széll András - [mailto:szellDOTandrisATgmailDOTcom]&lt;br /&gt;
* [[IcelandicTranslation|Icelandic]] - maintainer: Gabríel A. Pétursson [mailto:gabrielpATsimnetDOTis]&lt;br /&gt;
* [[IndonesianTranslation|Indonesian]] - maintainer: Yuristyawan Pambudi Wicaksana [mailto:yuris_wicaksana@yahoo.com]&lt;br /&gt;
* [[IrishTranslation|Irish]] - maintainer: Carson &amp;quot;Mountain_King&amp;quot; [mailto:tree_ringsATrocketmailDOTcom]&lt;br /&gt;
* [[ItalianTranslation|Italian]] - maintainer: Antonio Rosella - [mailto:arosellaATyahooDOTcom]&lt;br /&gt;
* [[JapaneseTranslation|Japanese]] - maintainer: Hironori Fujimoto (RatArmy) [mailto:broadbarredfirefishATgmailDOTcom]&lt;br /&gt;
* [[KoreanTranslation|Korean]] - maintainer: mistzone - [mailto:drier22ATgmailDOTcom]&lt;br /&gt;
* [[LatinTranslation|Latin]] - maintainer: Michael Babich ([[User:Aethaeryn|Aethaeryn]])&lt;br /&gt;
* [[LatvianTranslation|Latvian]] - maintainer: Reinis Danne - [mailto:rei4danATgmailDOTcom]&lt;br /&gt;
* [[LithuanianTranslation|Lithuanian]] - maintainer: Andrius Štikonas - [mailto:stikonasATgmailDOTcom] &lt;br /&gt;
* [[MarathiTranslation|Marathi]] - maintainer: Sujit R Jadhav - [mailto:sujitrjadhavATgmailDOTcom]&lt;br /&gt;
* [[MacedonianTranslation|Macedonian]] - maintainer: Dimitar Ilccov (Mythological)&lt;br /&gt;
* [[NorwegianTranslation|Norwegian]] - maintainer: Gaute Jao (Gauteamus) - [mailto:gauteamusATgmailDOTcom]&lt;br /&gt;
* [[OldEnglishTranslation|Old English]] - maintainer: no one (contact Espreon via private message on the forums for information)&lt;br /&gt;
* [[PolishTranslation|Polish]] - maintainer: Paweł Jackowski (fatality), contact via translation thread&lt;br /&gt;
* [[PortugueseTranslation|Portuguese Brazilian]] - maintainer: Andrei Machado - [mailto:andreisp.machadoATyahooDOTcom]&lt;br /&gt;
* [[PortugueseContinentalTranslation|Portuguese (European)]] - maintainer: trewe [mailto:sjrs456ATyahooDOTfr]&lt;br /&gt;
* [[RACVTranslation|RACV]] - maintainer: Mario (Mavorte) - [mailto:mavorte1ATyahooDOTes]&lt;br /&gt;
* [[RomanianTranslation|Romanian]] - maintainer: Alexandru Szasz [mailto:alexxedATgmailDOTcom]&lt;br /&gt;
* [[RussianTranslation|Russian]] - maintainer: Aldarisvet [mailto:rassvetozaaarATgmailDOTcom]&amp;lt;!--Alexandr Menovchicov - [mailto:vamATkypiDOTru]--&amp;gt;&lt;br /&gt;
* [[Scottish_Gaelic_Translation|Scottish Gaelic]] - maintainer: GunChleoc- [mailto:fiosAIGforamnagaidhligDOTnet]&lt;br /&gt;
* [[SerbianTranslation|Serbian]] - maintainer: Srećko Toroman (freecraft)- [mailto:sreckotoromanATgmailDOTcom]&lt;br /&gt;
* [[SlovakTranslation#Preklad|Slovak]] - maintainer: Aceman&lt;br /&gt;
* [[SlovenianTranslation|Slovenian]] - maintainer: Klemen Košir (nNa) - [mailto:klemen913ATgmailDOTcom]&lt;br /&gt;
* [[SpanishTranslation|Spanish]]  - maintainer: Pepe - [mailto:donpepe1963ATgmailDOTcom])&lt;br /&gt;
* [[SwedishTranslation|Swedish]] - maintainer: Niklas Bolmdahl (dacovale) - [mailto:wesnothATniklasDOTbolmdahlDOTse]&lt;br /&gt;
* [[TurkishTranslation|Turkish]] - maintainer: Nilgün Belma Bugüner - [mailto:nilgunATbelgelerDOTorg]&lt;br /&gt;
* [[UkrainianTranslation|Ukrainian]] - maintainer: robson - [mailto:arobsonATyandexDOTru]&lt;br /&gt;
* [[VietnameseTranslation|Vietnamese]] - maintainer: Huynh Yen Loc (hhyloc) - [mailto:nightgaunt13ATgmailDOTcom]&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://mailman.wesnoth.org/listinfo/i18n List information, including the subscription form]&lt;br /&gt;
* [https://mailman.wesnoth.org/pipermail/i18n/ List archives]&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;
* [[WesCamp| Translating User made Campaigns (featuring WesCamp-i18n)]]&lt;br /&gt;
* [[SpellingMistakes]]&lt;br /&gt;
* [[CharactersStorys| Character descriptions for Translators (Spoiler Warning)]]&lt;br /&gt;
* [[TextdomainStatus]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Translations|*]]&lt;/div&gt;</summary>
		<author><name>Luther</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.wesnoth.org/index.php?title=DirectActionsWML&amp;diff=61057</id>
		<title>DirectActionsWML</title>
		<link rel="alternate" type="text/html" href="https://wiki.wesnoth.org/index.php?title=DirectActionsWML&amp;diff=61057"/>
		<updated>2019-05-29T20:18:12Z</updated>

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

		<summary type="html">&lt;p&gt;Luther: hitpoints is read/write&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page describes the [[LuaWML]] functions for handling units.&lt;br /&gt;
&lt;br /&gt;
A unit is a proxy table with the following fields:&lt;br /&gt;
* '''x''', '''y''': integers (read only, read/write if the unit is not on the map)&lt;br /&gt;
* '''side''': integer (read/write)&lt;br /&gt;
* '''id''': string (read only)&lt;br /&gt;
* '''type''': string (read only)&lt;br /&gt;
* '''name''': translatable string (read only)&lt;br /&gt;
* '''max_hitpoints''', '''experience''', '''max_experience''', '''max_moves''': integers (read only)&lt;br /&gt;
* '''max_attacks''': integer (read only)&lt;br /&gt;
* '''attacks_left''': integer (read/write) Setting below 0 is limited to 0.&lt;br /&gt;
* '''extra_recruit''': table (read/write)&lt;br /&gt;
* '''advances_to''': table (read/write)&lt;br /&gt;
* '''hitpoints''', '''experience''': integer (read/write)&lt;br /&gt;
* '''moves''': integer (read/write)&lt;br /&gt;
* '''resting''': boolean (read/write)&lt;br /&gt;
* '''hidden''': boolean (read/write)&lt;br /&gt;
* '''petrified''', '''canrecruit''': booleans (read only)&lt;br /&gt;
* '''role''', '''facing''': strings (read/write)&lt;br /&gt;
* '''status''': proxy associative table (read only, read/write fields)&lt;br /&gt;
* '''image_mods''': string (read only)&lt;br /&gt;
* '''variables''': proxy associative table (read only, read/write fields, including ''variables.__cfg''), only toplevel named fields are proxied&lt;br /&gt;
* '''valid''': string or nil (read only)&lt;br /&gt;
* '''__cfg''': WML table (dump)&lt;br /&gt;
&lt;br /&gt;
The metatable of these proxy tables appears as '''&amp;quot;unit&amp;quot;'''.&lt;br /&gt;
&lt;br /&gt;
A unit can be either visible on the map ([[#wesnoth.get_units]], [[#wesnoth.put_unit]]), or on a recall list ([[#wesnoth.get_recall_units]], [[#wesnoth.put_recall_unit]]), or private to the Lua code ([[#wesnoth.create_unit]], [[#wesnoth.copy_unit]], [[#wesnoth.extract_unit]]). The Lua code has complete control over the private units; they will not be modified unless accessed through the proxy unit. Units on the map and on the recall lists, however, can be modified by the user, the engine, WML, independently of the Lua code. In particular, if a unit is killed, any further use of the proxy unit will cause an error. For units on the map, the proxy unit is valid as long as there is a unit on the map that has the same &amp;quot;underlying_id&amp;quot; WML field as the original one. The behavior is similar for units on the recall lists. The ''valid'' field reflects the unit availability by returning '''&amp;quot;map&amp;quot;''', '''&amp;quot;recall&amp;quot;''', '''&amp;quot;private&amp;quot;''', or ''nil''. The latter value is used for units that were removed (e.g. killed). In that case, the ''valid'' field is the only one that can be read without causing an error.&lt;br /&gt;
&lt;br /&gt;
The term &amp;quot;proxy&amp;quot;, here in particular &amp;quot;proxy unit&amp;quot;, means that the variable retrieved in the lua code (with get_units for example) is an accessor (reference) to the C++ object which represents that unit. This is very different from unit variables obtained by [store_unit] in wml. The fields marked as &amp;quot;writable&amp;quot; above can be modified without the need to use put_unit afterwards. This same reason explains that modifications to the unit from outside the lua code (like [kill] invalidating the proxy unit) have immediate effect on the lua code's proxy unit variable (with the exception of private proxy units).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== wesnoth.get_units ====&lt;br /&gt;
&lt;br /&gt;
Returns an array of all the units on the map matching the WML filter passed as the first argument. See [[StandardUnitFilter]] for details about filters.&lt;br /&gt;
&lt;br /&gt;
 local leaders_on_side_two = get_units { side = 2, canrecruit = true }&lt;br /&gt;
 local name_of_leader = leaders_on_side_two[1].name&lt;br /&gt;
&lt;br /&gt;
==== wesnoth.get_unit ====&lt;br /&gt;
&lt;br /&gt;
Returns the unit at the given location or with the given underlying ID.&lt;br /&gt;
&lt;br /&gt;
 local args = ...&lt;br /&gt;
 local unit = wesnoth.get_unit(args.x1, args.y1)&lt;br /&gt;
&lt;br /&gt;
==== wesnoth.match_unit ====&lt;br /&gt;
&lt;br /&gt;
Returns true if the given unit matches the WML filter passed as the second argument.&lt;br /&gt;
&lt;br /&gt;
 assert(unit.canrecruit == wesnoth.match_unit(unit, { canrecruit = true }))&lt;br /&gt;
&lt;br /&gt;
==== wesnoth.put_unit ====&lt;br /&gt;
&lt;br /&gt;
Places a unit on the map. This unit is described either by a WML table or by a proxy unit. Coordinates can be passed as the first two arguments, otherwise the table is expected to have two fields '''x''' and '''y''', which indicate where the unit will be placed. If the function is called with coordinates only, the unit on the map at the given coordinates is removed instead.&lt;br /&gt;
&lt;br /&gt;
 -- create a unit with random traits, then erase it&lt;br /&gt;
 wesnoth.put_unit(17, 42, { type = &amp;quot;Elvish Lady&amp;quot; })&lt;br /&gt;
 wesnoth.put_unit(17, 42)&lt;br /&gt;
&lt;br /&gt;
When the argument is a proxy unit, no duplicate is created. In particular, if the unit was private or on a recall list, it no longer is; and if the unit was on the map, it has been moved to the new location. Note: passing a WML table is just a shortcut for calling [[#wesnoth.create_unit]] and then putting the resulting unit on the map.&lt;br /&gt;
&lt;br /&gt;
 -- move the leader back to the top-left corner&lt;br /&gt;
 wesnoth.put_unit(1, 1, wesnoth.get_units({ canrecruit = true })[1])&lt;br /&gt;
&lt;br /&gt;
==== wesnoth.get_recall_units ====&lt;br /&gt;
&lt;br /&gt;
Returns an array of all the units on the recall lists matching the WML filter passed as the first argument.&lt;br /&gt;
&lt;br /&gt;
==== wesnoth.put_recall_unit ====&lt;br /&gt;
&lt;br /&gt;
Places a unit on a recall list. This unit is described either by a WML table or by a proxy unit. The side of the recall list is given by the second argument, or by the side of the unit if missing.&lt;br /&gt;
&lt;br /&gt;
 -- put the unit at location 17,42 on the recall list for side 2&lt;br /&gt;
 wesnoth.put_recall_unit(wesnoth.get_units({ x= 17, y = 42 })[1], 2)&lt;br /&gt;
&lt;br /&gt;
When the argument is a proxy unit, no duplicate is created. In particular, if the unit was private or on the map, it no longer is. Note: passing a WML table is just a shortcut for calling [[#wesnoth.create_unit]] and then putting the resulting unit on a recall list.&lt;br /&gt;
&lt;br /&gt;
==== wesnoth.create_unit ====&lt;br /&gt;
&lt;br /&gt;
Creates a private unit from a WML table.&lt;br /&gt;
&lt;br /&gt;
 local u = wesnoth.create_unit { type = &amp;quot;White Mage&amp;quot;, gender = &amp;quot;female&amp;quot; }&lt;br /&gt;
&lt;br /&gt;
==== wesnoth.copy_unit ====&lt;br /&gt;
&lt;br /&gt;
Creates a private unit from another unit.&lt;br /&gt;
&lt;br /&gt;
 -- extract a unit from the map&lt;br /&gt;
 local u = wesnoth.copy_unit(wesnoth.get_units({ type = &amp;quot;Thug&amp;quot; })[1])&lt;br /&gt;
 wesnoth.put_unit(u.x, u.y)&lt;br /&gt;
 -- u is still valid at this point&lt;br /&gt;
&lt;br /&gt;
==== wesnoth.extract_unit ====&lt;br /&gt;
&lt;br /&gt;
Removes a unit from the map or from a recall list and makes it private.&lt;br /&gt;
&lt;br /&gt;
 -- remove all the units from the recall list of side 1 and put them in a WML container&lt;br /&gt;
 local l = {}&lt;br /&gt;
 for i,u in ipairs(wesnoth.get_recall_units { side = 1 }) do&lt;br /&gt;
     wesnoth.extract_unit(u)&lt;br /&gt;
     table.insert(l, u.__cfg)&lt;br /&gt;
 end&lt;br /&gt;
 helper.set_variable_array(&amp;quot;player_recall_list&amp;quot;, l)&lt;br /&gt;
&lt;br /&gt;
Note: if the unit is on the map, it is just a shortcut for calling [[#wesnoth.copy_unit]] and then [[#wesnoth.put_unit]] without a unit. It is, however, the only way for removing a unit from a recall list without putting it on the map.&lt;br /&gt;
&lt;br /&gt;
==== wesnoth.add_modification ====&lt;br /&gt;
&lt;br /&gt;
Modifies a given unit. It needs to be a proxy unit. The second argument is the type of the modification (either trait, object, or advance). The option &amp;quot;advance&amp;quot; applies effects as if the unit would advance (e.g. AMLA effects). The third argument is a WML table describing the effect, so mostly containing '''[effect]''' children. See [[EffectWML]] for details about effects.&lt;br /&gt;
&lt;br /&gt;
 local u = wesnoth.get_units { canrecruit = true }[1]&lt;br /&gt;
 wesnoth.add_modification(u, &amp;quot;object&amp;quot;, { { &amp;quot;effect&amp;quot;, { apply_to = &amp;quot;image_mod&amp;quot;, replace = &amp;quot;RC(red&amp;gt;blue)&amp;quot; } } })&lt;br /&gt;
&lt;br /&gt;
==== wesnoth.unit_resistance ====&lt;br /&gt;
&lt;br /&gt;
Returns the resistance of a unit against an attack type. (Note: it is a WML resistance. So the higher it is, the weaker the unit is.) The third argument indicates whether the unit is the attacker. Last arguments are the coordinates of an optional map location (for the purpose of taking abilities into account).&lt;br /&gt;
&lt;br /&gt;
 local fire_resistance = 100 - wesnoth.unit_resistance(u, &amp;quot;fire&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
==== wesnoth.unit_defense ====&lt;br /&gt;
&lt;br /&gt;
Returns the defense of a unit on a particular terrain. (Note: it is a WML defense. So the higher it is, the weaker the unit is.)&lt;br /&gt;
&lt;br /&gt;
 local flat_defense = 100 - wesnoth.unit_defense(u, &amp;quot;Gt&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
==== wesnoth.unit_movement_cost ====&lt;br /&gt;
&lt;br /&gt;
Returns the movement cost of a unit on a particular terrain.&lt;br /&gt;
&lt;br /&gt;
 local move_cost = wesnoth.unit_movement_cost(u, &amp;quot;Gt&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
==== wesnoth.unit_ability ====&lt;br /&gt;
&lt;br /&gt;
Returns true if the unit is currently under effect by an ability with this given TAG NAME. This means that the ability could be owned by the unit itself, or by an adjacent unit.&lt;br /&gt;
&lt;br /&gt;
 function has_teleport(u)&lt;br /&gt;
     return wesnoth.unit_ability(u, &amp;quot;teleport&amp;quot;)&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
==== wesnoth.get_unit_type_ids ====&lt;br /&gt;
{{DevFeature1.11}}: This function is deprecated, use wesnoth.unit_types.&lt;br /&gt;
&lt;br /&gt;
==== wesnoth.get_unit_type ====&lt;br /&gt;
{{DevFeature1.11}}: This function is deprecated, use wesnoth.unit_types instead.&lt;br /&gt;
&lt;br /&gt;
==== wesnoth.unit_types ====&lt;br /&gt;
&lt;br /&gt;
This is not a function but a table indexed by unit type ids. Its elements are proxy tables with these fields:&lt;br /&gt;
&lt;br /&gt;
* '''id''': string&lt;br /&gt;
* '''name''': translatable string (read only)&lt;br /&gt;
* '''max_moves''', '''max_experience''', '''max_hitpoints''', '''level''', '''cost''': integers (read only)&lt;br /&gt;
* '''__cfg''': WML table (dump)&lt;br /&gt;
&lt;br /&gt;
The metatable of these proxy tables appears as '''&amp;quot;unit type&amp;quot;'''.&lt;br /&gt;
&lt;br /&gt;
 local lich_cost = wesnoth.unit_types[&amp;quot;Ancient Lich&amp;quot;].cost&lt;br /&gt;
&lt;br /&gt;
==== wesnoth.races ====&lt;br /&gt;
&lt;br /&gt;
This is not a function but a table indexed by race ids. Its elements are proxy tables for all races the engine knows about.&lt;br /&gt;
known fields of each element:&lt;br /&gt;
* '''id''': string&lt;br /&gt;
* '''description''', '''name''', '''plural_name''' (translatable strings)&lt;br /&gt;
* '''num_traits''' (integer)&lt;br /&gt;
* '''ignore_global_traits''' (boolean)&lt;br /&gt;
* '''undead_variation''' (string)&lt;br /&gt;
(all read only)&lt;br /&gt;
* '''__cfg''': WML table (dump)&lt;br /&gt;
&lt;br /&gt;
 wesnoth.message(tostring(wesnoth.races[&amp;quot;lizard&amp;quot;].name))&lt;br /&gt;
&lt;br /&gt;
==== wesnoth.get_traits ====&lt;br /&gt;
&lt;br /&gt;
Returns a table with named fields (trait id strings) holding the wml tables defining the traits. arguments: none. All global traits the engine knows about, race-specific traits are not included.&lt;br /&gt;
Known fields and subtags of each element are the ones which were given in the wml definition of the [[SingleUnitWML|trait]].&lt;br /&gt;
 wesnoth.message(tostring(wesnoth.get_traits().strong.male_name))&lt;br /&gt;
&lt;br /&gt;
==== wesnoth.simulate_combat ====&lt;br /&gt;
&lt;br /&gt;
Computes the hitpoint distribution and status chance after a combat between two units. Optional integers can be passed to select a particular weapon, otherwise the &amp;quot;best&amp;quot; one is selected. The first unit is the attacker; it does not have to be on the map, though its location should be meaningful. The second unit is the defender; it has to be on the map.&lt;br /&gt;
&lt;br /&gt;
When giving the attack, the parameter is the attack id (integer) and not an element from the table returned by helper.child_range(att, &amp;quot;attack&amp;quot;).&lt;br /&gt;
&lt;br /&gt;
 local function display_stats(n, t)&lt;br /&gt;
     wesnoth.message(string.format(&lt;br /&gt;
         &amp;quot;Chance for the %s\n  to be slowed: %f,\n  to be poisoned: %f,\n  to die: %f.\nAverage HP: %f.&amp;quot;,&lt;br /&gt;
         n, t.slowed, t.poisoned, t.hp_chance[0], t.average_hp))&lt;br /&gt;
 end&lt;br /&gt;
 local att_stats, def_stats = wesnoth.simulate_combat(att, att_weapon, def)&lt;br /&gt;
 display_stats(&amp;quot;attacker&amp;quot;, att_stats)&lt;br /&gt;
 display_stats(&amp;quot;defender&amp;quot;, def_stats)&lt;br /&gt;
&lt;br /&gt;
==== wesnoth.transform_unit ====&lt;br /&gt;
&lt;br /&gt;
Changes the type of a unit and adjust attributes accordingly. Note that hitpoints might be modified accordingly to the unit type.&lt;br /&gt;
&lt;br /&gt;
 local ev = wesnoth.current.event_context&lt;br /&gt;
 local u = wesnoth.get_units{x=ev.x1, y=ev.y1}[1]&lt;br /&gt;
 local old_hp = u.hitpoints&lt;br /&gt;
 wesnoth.transform_unit(u, &amp;quot;Skeleton&amp;quot;)&lt;br /&gt;
 u.hitpoints = old_hp&lt;br /&gt;
 u.status.poisoned = false&lt;br /&gt;
&lt;br /&gt;
[[Category: Lua Reference]]&lt;/div&gt;</summary>
		<author><name>Luther</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.wesnoth.org/index.php?title=LuaWML/Misc&amp;diff=45663</id>
		<title>LuaWML/Misc</title>
		<link rel="alternate" type="text/html" href="https://wiki.wesnoth.org/index.php?title=LuaWML/Misc&amp;diff=45663"/>
		<updated>2012-03-17T01:05:03Z</updated>

		<summary type="html">&lt;p&gt;Luther: /* wesnoth.synchronize_choice */ Reformatted the code to be more readable&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page describes miscellaneous [[LuaWML]] objects and helpers.&lt;br /&gt;
&lt;br /&gt;
==== wesnoth.game_config ====&lt;br /&gt;
&lt;br /&gt;
Contrarily to the other values of the ''wesnoth'' table, ''game_config'' is simply a proxy table. Its fields offer an interface to the global settings of Wesnoth:&lt;br /&gt;
&lt;br /&gt;
* '''version''': string (read only)&lt;br /&gt;
* '''base_income''': integer (read/write)&lt;br /&gt;
* '''village_income''': integer (read/write)&lt;br /&gt;
* '''poison_amount''': integer (read/write)&lt;br /&gt;
* '''rest_heal_amount''': integer (read/write)&lt;br /&gt;
* '''recall_cost''': integer (read/write)&lt;br /&gt;
* '''kill_experience''': integer (read/write)&lt;br /&gt;
* '''debug''': boolean (read only)&lt;br /&gt;
* '''mp_debug''': boolean (read only) {{DevFeature1.11}}&lt;br /&gt;
&lt;br /&gt;
 -- Poison a bit weak? Let's boost it!&lt;br /&gt;
 wesnoth.game_config.poison_amount = 15&lt;br /&gt;
&lt;br /&gt;
==== wesnoth.current ====&lt;br /&gt;
&lt;br /&gt;
As with ''game_config'', ''current'' is a proxy table. Its fields are getter for game-related properties:&lt;br /&gt;
&lt;br /&gt;
* '''side''': integer (read only)&lt;br /&gt;
* '''turn''': integer (read only)&lt;br /&gt;
* '''event_context''': WML table with attributes ''name'', ''x1'', ''y1'', ''x2'', ''y2'', and children ''weapon'', ''second_weapon'', describing the trigger for the current event.&lt;br /&gt;
&lt;br /&gt;
 wesnoth.message(string.format(&amp;quot;Turn %d, side %d is playing.&amp;quot;, wesnoth.current.turn, wesnoth.current.side))&lt;br /&gt;
&lt;br /&gt;
==== wesnoth.synchronize_choice ====&lt;br /&gt;
&lt;br /&gt;
Recovers a WML table that was computed on one client only or was stored in a replay. The actual computation is performed by the function passed as the first argument, assuming that the client is the side currently playing. For all the other clients, the function will not be called. An optional second function can be passed; if present, it will be used instead of the first one when the client happens to be an AI (hence not enable to interact with a user interface).&lt;br /&gt;
&lt;br /&gt;
 local result = wesnoth.synchronize_choice(&lt;br /&gt;
   function()&lt;br /&gt;
     -- Called only on the client handling the current side, if it is a human.&lt;br /&gt;
     local choice = 0&lt;br /&gt;
     wesnoth.show_dialog(&lt;br /&gt;
       some_dialog_cfg, nil,&lt;br /&gt;
       function()&lt;br /&gt;
         choice = wesnoth.get_dialog_value &amp;quot;some_list&amp;quot;&lt;br /&gt;
       end)&lt;br /&gt;
     return { value = choice }&lt;br /&gt;
   end,&lt;br /&gt;
   function()&lt;br /&gt;
     -- Called only on the client handling the current side, if it is an AI.&lt;br /&gt;
     return { value = math.random(some_list_size) }&lt;br /&gt;
   end)&lt;br /&gt;
 wesnoth.message(string.format(&amp;quot;Selected item: %d&amp;quot;, result.value))&lt;br /&gt;
&lt;br /&gt;
==== wesnoth.get_image_size ====&lt;br /&gt;
&lt;br /&gt;
Returns the width and height of an image.&lt;br /&gt;
&lt;br /&gt;
 local w, h = wesnoth.get_image_size &amp;quot;units/transport/galleon.png&amp;quot;&lt;br /&gt;
&lt;br /&gt;
==== wesnoth.compare_versions ====&lt;br /&gt;
&lt;br /&gt;
Takes two versions strings and an operator, returns whether the comparison yields true.&lt;br /&gt;
Follows the same rules like the #ifver preprocessor statement.&lt;br /&gt;
&lt;br /&gt;
 local function version_is_sufficient(required)&lt;br /&gt;
  if not wesnoth.compare_versions then return false end&lt;br /&gt;
  return wesnoth.compare_versions(wesnoth.game_config.version, &amp;quot;&amp;gt;=&amp;quot;, required)&lt;br /&gt;
 end&lt;br /&gt;
 local required = &amp;quot;1.9.6+svn&amp;quot;&lt;br /&gt;
 if not version_is_sufficient(required) then wesnoth.message(string.format(&lt;br /&gt;
  &amp;quot;Your BfW version is insufficient, please get BfW %s or greater!&amp;quot;, required)) end&lt;br /&gt;
&lt;br /&gt;
==== wesnoth.debug ====&lt;br /&gt;
&lt;br /&gt;
Takes a userdata with metatable wml object or a wml table and dumps its content into a pretty string.&lt;br /&gt;
 wesnoth.set_variable(&amp;quot;number&amp;quot;, 100)&lt;br /&gt;
 local vconfig = wesnoth.tovconfig({ key = &amp;quot;$number&amp;quot;, another_key = true,&lt;br /&gt;
     {&amp;quot;a_subtag&amp;quot;, { a_key_in_the_subtag = &amp;quot;foo&amp;quot; }}&lt;br /&gt;
 })&lt;br /&gt;
 wesnoth.message(wesnoth.debug(vconfig))&lt;br /&gt;
 wesnoth.message(wesnoth.debug(vconfig.__literal))&lt;br /&gt;
&lt;br /&gt;
==== helper.set_wml_tag_metatable ====&lt;br /&gt;
&lt;br /&gt;
Sets the metable of a table so that it can be used to create subtags with less brackets. Returns the table. The fields of the table are simple wrappers around table constructors.&lt;br /&gt;
&lt;br /&gt;
 T = helper.set_wml_tag_metatable {}&lt;br /&gt;
 W.event { name = &amp;quot;new turn&amp;quot;, T.message { speaker = &amp;quot;narrator&amp;quot;, message = &amp;quot;?&amp;quot; } }&lt;br /&gt;
&lt;br /&gt;
==== helper.modify_unit ====&lt;br /&gt;
&lt;br /&gt;
Modifies all the units satisfying the given filter (argument 1) with some WML attributes/objects (argument 2). This is a Lua implementation of the [http://www.wesnoth.org/macro-reference.xhtml MODIFY_UNIT] macro.&lt;br /&gt;
&lt;br /&gt;
 helper.modify_unit({ id=&amp;quot;Delfador&amp;quot; }, { moves=0 })&lt;br /&gt;
&lt;br /&gt;
==== helper.move_unit_fake ====&lt;br /&gt;
&lt;br /&gt;
Fakes the move of a unit satisfying the given filter (argument 1) to the given position (argument 2). This is a Lua implementation of the [http://www.wesnoth.org/macro-reference.xhtml MOVE_UNIT] macro.&lt;br /&gt;
&lt;br /&gt;
 helper.move_unit_fake({ id=&amp;quot;Delfador&amp;quot; }, 14, 8)&lt;br /&gt;
&lt;br /&gt;
==== helper.rand ====&lt;br /&gt;
&lt;br /&gt;
(A shortcut to set_variable's rand= since math.rand is an OOS magnet and therefore disabled.) Pass a string like you would to set_variable's rand=.&lt;br /&gt;
&lt;br /&gt;
create a random unit at (1, 1) on side=1 :&lt;br /&gt;
 wesnoth.put_unit(1, 1, { type = helper.rand(&amp;quot;Dwarvish Fighter,Dwarvish Thunderer,Dwarvish Scout&amp;quot;) })&lt;br /&gt;
&lt;br /&gt;
[[Category: Lua Reference]]&lt;/div&gt;</summary>
		<author><name>Luther</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.wesnoth.org/index.php?title=PreprocessorRef&amp;diff=40426</id>
		<title>PreprocessorRef</title>
		<link rel="alternate" type="text/html" href="https://wiki.wesnoth.org/index.php?title=PreprocessorRef&amp;diff=40426"/>
		<updated>2011-03-01T16:15:21Z</updated>

		<summary type="html">&lt;p&gt;Luther: /* The WML preprocessor */ 'non-recursively' makes it sound like it does not resolve any further filenames. Refer to subdirectories to be more clear.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{WML Tags}}&lt;br /&gt;
== The WML preprocessor ==&lt;br /&gt;
&lt;br /&gt;
Wesnoth loads just one configuration file directly: '''data/_main.cfg'''.&lt;br /&gt;
However the WML preprocessor allows to include more files.&lt;br /&gt;
Whenever a WML file is read by Wesnoth, it is passed through the preprocessor.&lt;br /&gt;
&lt;br /&gt;
The preprocessor can interpret a simple language of string-expansions known as &amp;quot;macros.&amp;quot; A macro should always be defined '''before''' the place where it needs to be used.&lt;br /&gt;
&lt;br /&gt;
The preprocessor is applied recursively, so included files will&lt;br /&gt;
be parsed for macros, and after macro expansion will be parsed for macros&lt;br /&gt;
again, and so on.  As a result, you should not write a recursive macro,&lt;br /&gt;
because it will cause errors&lt;br /&gt;
(but, alas, not necessarily error messages).&lt;br /&gt;
&lt;br /&gt;
The following directives are used to create and use ''macros'',&lt;br /&gt;
i.e. shortcuts which reduce repetition of information.&lt;br /&gt;
See [[UtilWML]], [[UsefulWMLFragments]] for examples and [http://www.wesnoth.org/macro-reference.xhtml the macro reference] for the predefined core macros.&lt;br /&gt;
* '''#define ''symbol'' [''parameters''] ''newline'' ''substitution'' #enddef''' all subsequent occurences of '''{''symbol'' [''arguments'']}''' (see below) will be replaced by ''substitution'' with all occurences of any parameter {''parameter''} within ''substitution'' replaced by the parameter's corresponding value in ''arguments''.  For example, the UNIT macro used below would be defined:&lt;br /&gt;
&lt;br /&gt;
 #define UNIT TYPE X Y## the ordering is important here;&lt;br /&gt;
                      ## since WML does not distinguish&lt;br /&gt;
                      ## data into different types, only&lt;br /&gt;
                      ## the ordering is used to determine which&lt;br /&gt;
                      ## arguments apply to which parameters.&lt;br /&gt;
 [unit]&lt;br /&gt;
 type={TYPE}## the unit will be of type TYPE, so different&lt;br /&gt;
            ## instantiations&lt;br /&gt;
            ## of this macro can create different units.&lt;br /&gt;
 x={X}&lt;br /&gt;
 y={Y}&lt;br /&gt;
 side=2## the unit will be an enemy, regardless of the parameter&lt;br /&gt;
       ## values. This reduces &amp;quot;repetition of information&amp;quot;,&lt;br /&gt;
       ## since it is no longer necessary to specify&lt;br /&gt;
       ## each created unit as an enemy.&lt;br /&gt;
 [/unit]&lt;br /&gt;
 #enddef&lt;br /&gt;
(See [[SingleUnitWML]] for information on creating units using WML.)&lt;br /&gt;
* '''{''symbol'' [''arguments'']}''' if ''symbol'' is defined, the preprocessor will replace this instruction by the expression ''symbol'' is defined as, using ''arguments'' as parameters.  You can create multiple word arguments by using parentheses to restrain the argument.  For example, while '''{UNIT Wolf Rider 18 24}''' will attempt to create a &amp;quot;Wolf&amp;quot; at (Rider,18), causing Wesnoth to crash, the macro '''{UNIT (Wolf Rider) 18 24}''' will create a &amp;quot;Wolf Rider&amp;quot; at (18,24) as it should. ('''UNIT''' is defined above).  See the ''#define'' preprocessor instruction above for information on defining symbols, including symbols with arguments.  Several symbols are defined in the normal game code; for reference they are listed in [[UtilWML]].&lt;br /&gt;
&lt;br /&gt;
Note: Using the name-string of an existing macro as the name-string of a macro argument will always overwrite the original definition of the macro, e.g.:&lt;br /&gt;
 #define VARIABLE&lt;br /&gt;
 #enddef&lt;br /&gt;
 #define MACRO VARIABLE&lt;br /&gt;
  {VARIABLE} # is calling for the argument, not for the macro above&lt;br /&gt;
 #enddef&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Unlike the other preprocessor directives, #ifdef and #ifndef are not&lt;br /&gt;
mere conveniences.&lt;br /&gt;
They are necessary to distinguish between different modes of play.&lt;br /&gt;
* '''#ifdef ''symbol'' ''substitution-if-stored''  [#else ''substitution-if-not-stored''] #endif'''  If ''symbol'' has been stored, the whole block will be replaced by ''substitution-if-stored''.  If not, it will be replaced by ''substitution-if-not-stored'' if it is available.  ''symbol'' can take the following values:&lt;br /&gt;
** a campaign difficulty level.  Usually '''EASY''', '''NORMAL''', or '''HARD''', it is decided by the key ''difficulties'' (see [[CampaignWML]]).&lt;br /&gt;
** a campaign ID. Each campaign stores a preprocessor ID.  See ''define'', [[CampaignWML]].&lt;br /&gt;
** '''MULTIPLAYER''' is stored when the player is playing or setting up a multiplayer game (i.e. a game with '''scenario_type=multiplayer''').&lt;br /&gt;
** '''DEBUG_MODE''' is stored when the player has launched wesnoth in debug mode (i.e. with '''-d''')&lt;br /&gt;
** '''TUTORIAL''' is stored when the player is playing the tutorial.&lt;br /&gt;
** '''APPLE''' is stored if the computer Wesnoth is being run on is an Apple. (this one is only available to the configuration of the game)&lt;br /&gt;
* '''#ifndef''' behaves exactly like '''#ifdef''', except that it inverts the test sense; guarded text is included only if ''symbol'' has not been stored.&lt;br /&gt;
''#undef'' can be useful too if ''#ifdef'' is not enough.&lt;br /&gt;
* '''#undef ''symbol'' '''  erases ''symbol''&lt;br /&gt;
* '''#ifhave''' {{DevFeature1.9}} checks for the existence of a file. Uses the same relative paths as include directives (see below). Example: '''#ifhave ~add-ons/MyAddon/_main.cfg''' note: For a multiplayer game, the #ifhave directive works only for the host, not for the other clients.&lt;br /&gt;
* '''#ifnhave''' {{DevFeature1.9}} is the inverted version of '''#ifhave'''.&lt;br /&gt;
&lt;br /&gt;
These directives expand a file by including other files, ''filename'' may not contain '..' or the directive will be skipped:&lt;br /&gt;
* '''{''filename''}''' if ''filename'' isn't a predefined symbol (see above), Wesnoth will assume it's a path to a file in the main '''data/''' subdirectory of Wesnoth and include the file it points to here &amp;quot;as is&amp;quot;.  Forward slashes('''/''') should be used to separate directories from their elements, even if your platform uses a different symbol such as colon (''':''') or backslash ('''\''').  &lt;br /&gt;
* '''{~''filename''}''' similar to above, but the preprocessor assumes that the filename is relative to '''data/''' subdirectory of the user data directory.  The ''user data directory'' varies depending on platform. See [[EditingWesnoth#Where_is_my_user_data_directory.3F|Where_is_my_user_data_directory?]]&lt;br /&gt;
&lt;br /&gt;
* '''{./''filename''}''' is similar to the '''{''filename''}''' directive, but is assumed to be relative to the directory which contains the file in which this appears.  For example, if used in game.cfg, it is equivalent to '''{''filename''}'''.&lt;br /&gt;
* If ''filename'' points to a directory, the preprocessor will include all files in the directory ''filename'', except subdirectories, in alphabetical order. Some files in such directories are handled specially.  &lt;br /&gt;
&lt;br /&gt;
If there is a file named ''dir/_main.cfg'' in a directory referenced as '''{''dir''}''', only that ''_main.cfg'' file is processed; it may include other files in itself, of course . This feature is useful for creating WML directories that are self-contained WML packages with their own initializations (like campaigns). This can replace the older convention of having a ''dir.cfg'' at the same level as ''dir'' which does '''{''dir''}''' somewhere in itself.&lt;br /&gt;
&lt;br /&gt;
If there are files named ''dir/*/_main.cfg'' in a directory referenced as '''{''dir''}''', where * is any subdirectories ''dir'', then they all are processed (except if there is also a file named ''dir/_main.cfg''). This means that if you have a layout like this:&lt;br /&gt;
 dir/&lt;br /&gt;
 dir/a/_main.cfg&lt;br /&gt;
 dir/a/other.cfg&lt;br /&gt;
 dir/b/_main.cfg&lt;br /&gt;
 dir/b/other.cfg&lt;br /&gt;
 dir/other.cfg&lt;br /&gt;
Then '''{dir}''' will process (in alphabetical order): dir/a/_main.cfg, dir/b/main.cfg, dir/other.cfg.&lt;br /&gt;
&lt;br /&gt;
If there is a file named ''dir/_final.cfg'' in a directory referenced as '''{''dir''}''' (and no ''main.cfg'', so that all files in the directory are processed normally) the ''_final.cfg'' is guaranteed to be processed ''after'' all other files in the directory.&lt;br /&gt;
&lt;br /&gt;
If there is a file named ''dir/_initial.cfg'' in a directory referenced as '''{''dir''}''' (and no ''main.cfg'', so that all files in the directory are processed normally) the ''_initial.cfg'' is guaranteed to be processed ''before'' all other files in the directory.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Note that the parser was changed various times, so don't expect older Wesnoth version to behave exactly the same.&lt;br /&gt;
&lt;br /&gt;
{{DevFeature1.9}} Including non-existent file is now a fatal error and halts the preprocessing. Use #ifhave to test for the existence of files that aren't a part of your own add-on.&lt;br /&gt;
&lt;br /&gt;
== The preprocessor command line == &lt;br /&gt;
{{DevFeature1.9}} &lt;br /&gt;
&lt;br /&gt;
As of wesnoth 1.9, there is a new command line available:&lt;br /&gt;
 --preprocess[=define1,define2,...] &amp;lt;file/folder&amp;gt; &amp;lt;target directory&amp;gt;&lt;br /&gt;
or the short form:&lt;br /&gt;
 -p[=define1,define2,...] &amp;lt;file/folder&amp;gt; &amp;lt;target directory&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The define1,define2,... is a list of defines, to be added ''before'' anything is preprocessed. &lt;br /&gt;
&lt;br /&gt;
The preprocess command will '''preprocess first''' the common config files in ''data/core'', and afterwards, the specified ones. You can specifiy a single file to be preprocesses (if you want to preprocess multiple separate files, you have to invoke the command separately), or an entire folder (this will be preprocessed on the known preprocessor rules). &lt;br /&gt;
&lt;br /&gt;
The resulted preprocessed files will be written in the target directory. There will be 2 types of files: the .cfg files and .plain files (this contain the line symbols and textdomain changes)&lt;br /&gt;
&lt;br /&gt;
If &amp;lt;file/folder&amp;gt; and &amp;lt;target directory&amp;gt; are not in ''absolute path'' form, they will be treated like relative to the wesnoth's executable path. &lt;br /&gt;
&lt;br /&gt;
Some examples:&lt;br /&gt;
 -p ~/wesnoth/data/campaigns/tutorial ~/result &lt;br /&gt;
will preprocess entire tutorial folder, and write the resulted files in the ~/result folder&lt;br /&gt;
 -p=MULTIPLAYER data/campaigns/my_campaign/some_scenario.cfg data/result&lt;br /&gt;
will add the ''MULTIPLAYER'' define in defines list and then preprocess the scenario config file&lt;br /&gt;
 -p=SINGLEPLAYER,HARD ~/wesnoth/data/campaigns/my_campaign ~/result&lt;br /&gt;
will add the ''SINGLEPLAYER'' and ''HARD'' defines before preprocessing the files.&lt;br /&gt;
&lt;br /&gt;
Note! As you saw in the examples, the '=' character is mandatory if you want to specify any auxiliar defines&lt;br /&gt;
&lt;br /&gt;
If you want a more detailed log, you can simply add the command: &amp;quot;--log-debug=all&amp;quot; or &amp;quot;--log-info=all&amp;quot; before the preprocessing command, so you will see how things are parsed,etc.&lt;br /&gt;
&lt;br /&gt;
== See Also ==&lt;br /&gt;
* [[SyntaxWML]]&lt;br /&gt;
* [[ReferenceWML]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category: WML Reference]]&lt;/div&gt;</summary>
		<author><name>Luther</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.wesnoth.org/index.php?title=LuaWML/Location_set&amp;diff=40186</id>
		<title>LuaWML/Location set</title>
		<link rel="alternate" type="text/html" href="https://wiki.wesnoth.org/index.php?title=LuaWML/Location_set&amp;diff=40186"/>
		<updated>2011-01-20T00:47:26Z</updated>

		<summary type="html">&lt;p&gt;Luther: Clarified intro after seeing the source code&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{DevFeature1.9}}&lt;br /&gt;
&lt;br /&gt;
This page describes the [[LuaWML]] class for handling location sets and location maps. Objects of this class store a set of locations, with some data (boolean ''true'', by default) attached to each of them. It is not possible to associate ''nil'' or ''false'' to a location.&lt;br /&gt;
&lt;br /&gt;
There is one main constructor [[#location_set.create]] and two auxiliary helper constructors [[#location_set.of_pairs]] and [[#location_set.of_wml_var]]. They are provided by the ''lua/location_set.lua'' file. All the other functions are methods from the class and they are available through the ':' operator only.&lt;br /&gt;
&lt;br /&gt;
 local location_set = wesnoth.require &amp;quot;lua/location_set.lua&amp;quot;&lt;br /&gt;
 local a_set = location_set.create()&lt;br /&gt;
 a_set:insert(17, 42, &amp;quot;something&amp;quot;)&lt;br /&gt;
 assert(a_set:get(17, 42) == &amp;quot;something&amp;quot;)&lt;br /&gt;
 local b_set = location_set.of_pairs(wesnoth.get_locations { { &amp;quot;filter_adjacent&amp;quot;, { x=17, y=42 } } })&lt;br /&gt;
 a_set:union(b_set)&lt;br /&gt;
 a_set:to_wml_var &amp;quot;locations&amp;quot;&lt;br /&gt;
&lt;br /&gt;
==== location_set.create ====&lt;br /&gt;
&lt;br /&gt;
Returns an empty location set.&lt;br /&gt;
&lt;br /&gt;
==== location_set.of_pairs ====&lt;br /&gt;
&lt;br /&gt;
Returns a fresh location set filled by [[#location_set:of_pairs]].&lt;br /&gt;
&lt;br /&gt;
==== location_set.of_wml_var ====&lt;br /&gt;
&lt;br /&gt;
Returns a fresh location set filled by [[#location_set:of_wml_var]].&lt;br /&gt;
&lt;br /&gt;
==== location_set:empty ====&lt;br /&gt;
&lt;br /&gt;
Returns ''true'' if the set is empty.&lt;br /&gt;
&lt;br /&gt;
 local some_set = location_set.create()&lt;br /&gt;
 assert(some_set:empty())&lt;br /&gt;
&lt;br /&gt;
==== location_set:size ====&lt;br /&gt;
&lt;br /&gt;
Returns the number of locations in the set.&lt;br /&gt;
&lt;br /&gt;
 some_set:insert(17, 42)&lt;br /&gt;
 assert(some_set:size() == 1)&lt;br /&gt;
&lt;br /&gt;
==== location_set:clear ====&lt;br /&gt;
&lt;br /&gt;
Empties the content of the set.&lt;br /&gt;
&lt;br /&gt;
 some_set:clear()&lt;br /&gt;
 assert(not some_set:get(17, 42))&lt;br /&gt;
&lt;br /&gt;
==== location_set:get ====&lt;br /&gt;
&lt;br /&gt;
Returns the data associated to the given location or ''nil'' if the location is not in the set.&lt;br /&gt;
&lt;br /&gt;
 some_set:insert(17, 42, &amp;quot;something&amp;quot;)&lt;br /&gt;
 assert(some_set:get(17, 42) == &amp;quot;something&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
==== location_set:insert ====&lt;br /&gt;
&lt;br /&gt;
Associates some data to the given location, or ''true'' if there is no data. Previous associated data is lost.&lt;br /&gt;
&lt;br /&gt;
 some_set:insert(17, 42)&lt;br /&gt;
 assert(some_set:get(17, 42))&lt;br /&gt;
&lt;br /&gt;
==== location_set:remove ====&lt;br /&gt;
&lt;br /&gt;
Removes the given location from the set.&lt;br /&gt;
&lt;br /&gt;
 some_set:remove(17, 42)&lt;br /&gt;
&lt;br /&gt;
==== location_set:of_pairs ====&lt;br /&gt;
&lt;br /&gt;
Inserts all the locations from an array containing pairs (arrays with two elements). Previous content of the set is kept, unless overwritten by the content of the array.&lt;br /&gt;
&lt;br /&gt;
 some_set:of_pairs(wesnoth.get_locations { { &amp;quot;filter_adjacent&amp;quot;, { x=17, y=42 } } })&lt;br /&gt;
&lt;br /&gt;
==== location_set:of_wml_var ====&lt;br /&gt;
&lt;br /&gt;
Inserts all the locations from a WML array. If a container has more than just ''x'' and ''y'' attributes, the remaining attributes and children are associated to the location as a WML table. Previous content of the set is kept, unless overwritten by the content of the WML array.&lt;br /&gt;
&lt;br /&gt;
 wesnoth.wml_actions.store_locations { variable=&amp;quot;target&amp;quot;, { &amp;quot;filter_adjacent&amp;quot;, { x=17, y=42 } } }&lt;br /&gt;
 some_set:of_wml_var &amp;quot;target&amp;quot;&lt;br /&gt;
&lt;br /&gt;
==== location_set:to_pairs ====&lt;br /&gt;
&lt;br /&gt;
Returns an array of pairs containing the locations of the set. Associated data are ignored. The order of the locations is not deterministic. If the order actually matters, the [[#location_set:to_stable_pairs]] method should be used instead.&lt;br /&gt;
&lt;br /&gt;
 local size = #(some_set:to_pairs())&lt;br /&gt;
&lt;br /&gt;
==== location_set:to_stable_pairs ====&lt;br /&gt;
&lt;br /&gt;
Returns an array of pairs containing the locations of the set. Contrarily to [[#location_set:to_pairs]], the locations are guaranteed to be sorted and hence synchronized over networks and replays.&lt;br /&gt;
&lt;br /&gt;
==== location_set:to_wml_var ====&lt;br /&gt;
&lt;br /&gt;
Fills a WML array with the content of the set. The order of the elements is safe.&lt;br /&gt;
&lt;br /&gt;
 local some_set = location_set.of_pairs(wesnoth.get_locations { { &amp;quot;filter_adjacent&amp;quot;, { x=17, y=42 } } })&lt;br /&gt;
 some_set:to_wml_var &amp;quot;locations&amp;quot;&lt;br /&gt;
&lt;br /&gt;
==== location_set:union ====&lt;br /&gt;
&lt;br /&gt;
Inserts the locations from the other set, possibly overwriting the associated of data the locations already present.&lt;br /&gt;
&lt;br /&gt;
 a_set:insert(17, 42, &amp;quot;nothing&amp;quot;)&lt;br /&gt;
 b_set:insert(17, 42, &amp;quot;something&amp;quot;)&lt;br /&gt;
 a_set:union(b_set)&lt;br /&gt;
 assert(a_set:get(17, 42) == &amp;quot;something&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
==== location_set:inter ====&lt;br /&gt;
&lt;br /&gt;
Deletes the locations that are not in the other set. Associated data is kept intact if not removed.&lt;br /&gt;
&lt;br /&gt;
 a_set:insert(17, 42, &amp;quot;nothing&amp;quot;)&lt;br /&gt;
 b_set:insert(17, 42, &amp;quot;something&amp;quot;)&lt;br /&gt;
 a_set:inter(b_set)&lt;br /&gt;
 assert(a_set:get(17, 42) == &amp;quot;nothing&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
==== location_set:iter ====&lt;br /&gt;
&lt;br /&gt;
Calls the given function on all the locations of the set. Iteration order is not deterministic. If the order actually matters, the [[#location_set:stable_iter]] method should be used instead.&lt;br /&gt;
&lt;br /&gt;
 some_set:iter(function(x, y, data) wesnoth.message(string.format(&amp;quot;[%d,%d] = %s&amp;quot;, x, y, type(data))) end)&lt;br /&gt;
&lt;br /&gt;
==== location_set:stable_iter ====&lt;br /&gt;
&lt;br /&gt;
Calls the given function on all the locations of the set. Contrarily to [[#location_set:iter]], the iteration is deterministic and hence safe for networks and replays.&lt;br /&gt;
&lt;br /&gt;
 some_set:stable_iter(function(x, y, data) wesnoth.message(string.format(&amp;quot;[%d,%d] = %s&amp;quot;, x, y, type(data))) end)&lt;br /&gt;
&lt;br /&gt;
==== location_set:filter ====&lt;br /&gt;
&lt;br /&gt;
Returns a new set containing all the locations of the set for which the given function returns true.&lt;br /&gt;
&lt;br /&gt;
 local new_set = old_set:filter(function(x, y, v)&lt;br /&gt;
   local d = helper.distance_between(a, b, x, y)&lt;br /&gt;
   return d &amp;lt;= 5 and v == &amp;quot;not found&amp;quot;&lt;br /&gt;
 end)&lt;br /&gt;
 wesnoth.message(string.format(&amp;quot;%d traps in the neighborhood of (%d,%d)&amp;quot;, new_set:size(), a, b))&lt;br /&gt;
&lt;br /&gt;
==== location_set:union_merge ====&lt;br /&gt;
&lt;br /&gt;
Calls the given function for all the locations of the other set and uses the returned values to fill the set. Note: the merge order is not stable.&lt;br /&gt;
&lt;br /&gt;
 -- merge the elements of s2 into s1 but preserve the old data of s1&lt;br /&gt;
 function set_union(s1, s2)&lt;br /&gt;
     s1:union_merge(s2, function(x, y, v1, v2) return v1 or v2 end)&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
 -- remove from s1 the elements of s2&lt;br /&gt;
 function set_difference(s1, s2)&lt;br /&gt;
     -- the nested function is called s2:size() times; note: v2 is never nil&lt;br /&gt;
     s1:union_merge(s2, function(x, y, v1, v2) return nil end)&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
==== location_set:inter_merge ====&lt;br /&gt;
&lt;br /&gt;
Calls the given function for all the locations of the set and uses the returned values to replace it. Note: the merge order is not stable.&lt;br /&gt;
&lt;br /&gt;
 -- compute the intersection of s1 and s2 and put it into s1, but overwrite the data of s1&lt;br /&gt;
 function set_inter(s1, s2)&lt;br /&gt;
     s1:inter_merge(s2, function(x, y, v1, v2) return v2 or v1 end)&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
 -- remove from s1 the elements of s2&lt;br /&gt;
 function set_difference(s1, s2)&lt;br /&gt;
     -- the nested function is called s1:size() times; note: v1 is never nil&lt;br /&gt;
     s1:inter_merge(s2, function(x, y, v1, v2) return not v2 end)&lt;br /&gt;
 end&lt;/div&gt;</summary>
		<author><name>Luther</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.wesnoth.org/index.php?title=Distributing_content&amp;diff=40047</id>
		<title>Distributing content</title>
		<link rel="alternate" type="text/html" href="https://wiki.wesnoth.org/index.php?title=Distributing_content&amp;diff=40047"/>
		<updated>2011-01-12T20:33:12Z</updated>

		<summary type="html">&lt;p&gt;Luther: /* The Add-on Server */ Suggest MyCampaign.pbl as a filename&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== The Forum ==&lt;br /&gt;
&lt;br /&gt;
The [http://www.wesnoth.org/forum/ BFW forum] is a good way to distribute small creations, like single multiplayer maps.  Larger creations, like multiplayer eras or campaigns, should be compressed before uploading them.  Note that you may encounter a size limit on attachments.&lt;br /&gt;
&lt;br /&gt;
Also, there is a [http://www.wesnoth.org/forum/viewtopic.php?t=2014 legal announcement] that you should read before distributing anything on the forum. Basically, by posting you say that you own the license to what you are posting, and that you are licensing it under the [http://www.gnu.org/copyleft/gpl.html General Public License].&lt;br /&gt;
&lt;br /&gt;
== The Add-on Server ==&lt;br /&gt;
&lt;br /&gt;
The add-on server is the preferred way to distribute your creations, but it is more suited for larger projects.  It currently lacks advanced organization features such as reviewing (although it does have a filter text box), so adding hundreds of little things makes it harder to find anything.  Basically, the server should not be used to post single maps, units, songs, or artwork, but map packs, campaigns, entire eras, music packs, and unit packs are fine.&lt;br /&gt;
&lt;br /&gt;
Once you are ready to publish, here is how you access the add-on server:&lt;br /&gt;
# Open Wesnoth&lt;br /&gt;
# Select &amp;quot;Add-ons&amp;quot; from the main menu&lt;br /&gt;
# Connect to the default ''add-ons.wesnoth.org'' add-on server&lt;br /&gt;
# Select &amp;quot;Publish add-on: ''Your Add-on Name''&amp;quot; (the last entry in the list of add-ons)&lt;br /&gt;
&lt;br /&gt;
Anything you distribute on the server will be uploaded from and downloaded to the ''[[EditingWesnoth#Where_is_my_user_data_directory.3F|userdata]]''/data/add-ons directory regardless of what it is (units, maps, campaign, etc).  For this reason, you need three things in the add-ons directory to distribute via the server:&lt;br /&gt;
# A folder, for example MyCampaign&lt;br /&gt;
# A .cfg file MyCampaign/_main.cfg&lt;br /&gt;
# A .pbl file MyCampaign.pbl ''or'' MyCampaign/_server.pbl&lt;br /&gt;
Note that only the contents of your add-on directory (in this case, MyCampaign) will get uploaded, nothing else, so you need to have all the necessary files inside that directory.&lt;br /&gt;
&lt;br /&gt;
The following files and directories will not be uploaded: those that begin with '.' and those that end in '~'. Also, the GNU GPL version 2 will be added in the file COPYING.txt.&lt;br /&gt;
&lt;br /&gt;
==== General Reading ====&lt;br /&gt;
* [[BuildingCampaignsThePBLFile|General information about the .pbl file]] - It has a campaign flavor, but it is adaptable to any content&lt;br /&gt;
* [[PblWML|Syntax reference for the .pbl file]]&lt;br /&gt;
&lt;br /&gt;
==== Content-specific instructions ====&lt;br /&gt;
* Maps - see [[BuildingMaps|Building Maps]]&lt;br /&gt;
** [[BuildingMapsDistribution|About distributing map-packs]]&lt;br /&gt;
* Campaign - see [[BuildingCampaigns|Building Campaigns]]&lt;br /&gt;
** [[BuildingCampaignsDistribution|About distributing campaigns]]&lt;br /&gt;
* Multiplayer era - see [[BuildingFactions#Adding_a_whole_new_era_with_its_own_factions_-_modular|Building MP Era]]&lt;br /&gt;
* Unit pack - see [[BuildingUnits#Distributing_your_unit|Building Units]]&lt;br /&gt;
&lt;br /&gt;
==== License ====&lt;br /&gt;
Whenever you upload or update your content pack, you will have to say &amp;quot;OK&amp;quot; to this statement: &amp;quot;All add-ons uploaded to this server must be licensed under the terms of the GNU General Public License (GPL). By uploading content to this server, you certify that you have the right to place the content under the conditions of the GPL, and choose to do so.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
== See Also ==&lt;br /&gt;
&lt;br /&gt;
* [[Create]]&lt;br /&gt;
* [[BuildingMapsDistribution]]&lt;br /&gt;
* [[BuildingCampaignsDistribution]]&lt;br /&gt;
* [[BuildingCampaignsThePBLFile]]&lt;br /&gt;
* [[PblWML]]&lt;br /&gt;
* [[IGNFileFormat]]&lt;br /&gt;
* [[Wesnoth:Copyrights]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Create]]&lt;/div&gt;</summary>
		<author><name>Luther</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.wesnoth.org/index.php?title=CommandMode&amp;diff=38567</id>
		<title>CommandMode</title>
		<link rel="alternate" type="text/html" href="https://wiki.wesnoth.org/index.php?title=CommandMode&amp;diff=38567"/>
		<updated>2010-09-26T11:11:14Z</updated>

		<summary type="html">&lt;p&gt;Luther: /* Command Mode */ :lua is a debug command&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Command Mode ==&lt;br /&gt;
&lt;br /&gt;
You can access command mode by typing ' ''':''' ' in a single player or multiplayer scenario.&lt;br /&gt;
(Prior to version 1.1.1, you need to type shift - semicolon( ''';''' ). However this isn't possible on all keyboards; if your keyboard doesn't have ':' above ';' you can change the hotkey in the Preferences, or you could edit '''game.cfg''' by hand.')&lt;br /&gt;
&lt;br /&gt;
Note: you can highlight, copy, and paste text in debug mode.&lt;br /&gt;
&lt;br /&gt;
Several vi-like commands are available in command mode. They are defined in ''menu_events.cpp''. In the 1.5 branch, there is a ''':help''' command that lists all available commands, and ''':help ''foo''''' displays more info about command ''foo''. This is more reliable than the list that follows here:&lt;br /&gt;
&lt;br /&gt;
;&amp;lt;nowiki&amp;gt;:q or :q!&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
:quit the scenario (without prompting)&lt;br /&gt;
;&amp;lt;nowiki&amp;gt;:w&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
:save the game (without prompting)&lt;br /&gt;
;&amp;lt;nowiki&amp;gt;:wq&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
:save the game and quit the scenario (without prompting)&lt;br /&gt;
;&amp;lt;nowiki&amp;gt;:refresh&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
:redraw the screen&lt;br /&gt;
;&amp;lt;nowiki&amp;gt;:droid&amp;lt;/nowiki&amp;gt; [''side''] [on|off]&lt;br /&gt;
:toggle player on ''side'' between human and AI player. The player/client who controls that side needs to issue this command. If you don't provide ''side'', the current side is assumed.&lt;br /&gt;
;&amp;lt;nowiki&amp;gt;:muteall&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
:toggles muting/silencing of all observers on/off&lt;br /&gt;
;&amp;lt;nowiki&amp;gt;:mute&amp;lt;/nowiki&amp;gt; [''username'']&lt;br /&gt;
:mute a specific observer. If no ''username'' is supplied the muted usernames are displayed.&lt;br /&gt;
;&amp;lt;nowiki&amp;gt;:unmute&amp;lt;/nowiki&amp;gt; [''username'']&lt;br /&gt;
:unmute a specific observer. If no ''username'' is given everyone is unmuted. (Doesn't effect the muteall setting.)&lt;br /&gt;
;&amp;lt;nowiki&amp;gt;:kick&amp;lt;/nowiki&amp;gt; ''username''&lt;br /&gt;
:kick a user in multiplayer. They will be able to rejoin the game. Generally a friendly way to remove someone who is having connection or other difficulties.&lt;br /&gt;
;&amp;lt;nowiki&amp;gt;:ban&amp;lt;/nowiki&amp;gt; ''username''&lt;br /&gt;
:kick and ban a user in multiplayer by the IP address used by that ''username''. Can be used on users not in the game but on the server. (Of course they won't be kicked then.)&lt;br /&gt;
;&amp;lt;nowiki&amp;gt;:unban&amp;lt;/nowiki&amp;gt; ''username''&lt;br /&gt;
:unban a user by the IP address used by that ''username''. Can be used on users not in the game but on the server.&lt;br /&gt;
;&amp;lt;nowiki&amp;gt;:control&amp;lt;/nowiki&amp;gt; ''side'' ''username''&lt;br /&gt;
:change the controller for ''side'' (write here the number of the side, the side must be controlled by you) to ''username'' (write here the nick of the player or observer)&lt;br /&gt;
;&amp;lt;nowiki&amp;gt;:clear&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
:clear chat messages&lt;br /&gt;
;&amp;lt;nowiki&amp;gt;:debug&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
:switch debug mode on (does not work in multiplayer). Debug mode is turned off by quitting the game or using the :nodebug command.&lt;br /&gt;
;&amp;lt;nowiki&amp;gt;:theme&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
:bring up theme selection menu&lt;br /&gt;
;&amp;lt;nowiki&amp;gt;:nosaves&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
:turns off the autosave function&lt;br /&gt;
;&amp;lt;nowiki&amp;gt;:show_coordinates (or :sc)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
:Overlay x,y coordinates on map tiles. 1.5.5 onwards&lt;br /&gt;
;&amp;lt;nowiki&amp;gt;:show_terrain_codes (or :tc)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
:Overlay terrain codes on visible map tiles. 1.5.5 onwards&lt;br /&gt;
;&amp;lt;nowiki&amp;gt;:discover&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
:Show all hidden unit descriptions in the in-game Help. 1.7.0 onwards&lt;br /&gt;
&lt;br /&gt;
===Extra Debugging Commands===&lt;br /&gt;
[[DebugMode]] enables additional commands in command mode:&lt;br /&gt;
&lt;br /&gt;
;&amp;lt;nowiki&amp;gt;:lua&amp;lt;/nowiki&amp;gt; ''statement''&lt;br /&gt;
:{{DevFeature}} execute a Lua statement&lt;br /&gt;
;&amp;lt;nowiki&amp;gt;:nodebug&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
:disables debug-mode commands&lt;br /&gt;
;&amp;lt;nowiki&amp;gt;:n&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
:skip to next scenario by triggering a win event&lt;br /&gt;
;&amp;lt;nowiki&amp;gt;:shroud&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
:toggles shroud on/off (implemented since 1.3.10)&lt;br /&gt;
;&amp;lt;nowiki&amp;gt;:fog&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
:toggles fog on/off (implemented since 1.3.10)&lt;br /&gt;
;&amp;lt;nowiki&amp;gt;:gold&amp;lt;/nowiki&amp;gt; ''amount''&lt;br /&gt;
:add ''amount'' gold to the current player's side&lt;br /&gt;
;&amp;lt;nowiki&amp;gt;:create&amp;lt;/nowiki&amp;gt; ''unit_type''&lt;br /&gt;
:create a unit of type specified at last selected hex&lt;br /&gt;
;&amp;lt;nowiki&amp;gt;:unit hitpoints=&amp;lt;/nowiki&amp;gt;''amount''&lt;br /&gt;
:edit units hitpoints&lt;br /&gt;
;&amp;lt;nowiki&amp;gt;:unit experience=&amp;lt;/nowiki&amp;gt;''amount''&lt;br /&gt;
:edit units experience&lt;br /&gt;
;&amp;lt;nowiki&amp;gt;:unit&amp;lt;/nowiki&amp;gt; ''attribute=value''&lt;br /&gt;
:when a unit is selected, this will set the unit's ''attribute'' to ''value''. See [[SingleUnitWML]] for possible values.&lt;br /&gt;
;&amp;lt;nowiki&amp;gt;:unit&amp;lt;/nowiki&amp;gt; ''advances=N''&lt;br /&gt;
:{{DevFeature}} when a unit is selected, this will advance (level up) the unit N times.&lt;br /&gt;
;&amp;lt;nowiki&amp;gt;:set_var&amp;lt;/nowiki&amp;gt; ''attribute=value''&lt;br /&gt;
:this will set a WML variable to a given value&lt;br /&gt;
;&amp;lt;nowiki&amp;gt;:show_var&amp;lt;/nowiki&amp;gt; ''attribute''&lt;br /&gt;
:this will display a popup with the content of the variable&lt;br /&gt;
;&amp;lt;nowiki&amp;gt;:throw/fire&amp;lt;/nowiki&amp;gt; ''event_name''&lt;br /&gt;
:throw an event by name, like ''time over'' or ''enemies defeated''. (Only available in 1.3.5 or later.)&lt;br /&gt;
;&amp;lt;nowiki&amp;gt;:inspect&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
:{{DevFeature}} show a gamestate inspector dialog which allows to see variable info, team info, ai info.&lt;br /&gt;
;&amp;lt;nowiki&amp;gt;:cl&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
:pops up a menu that allows you to move directly to a specified scenario.&lt;br /&gt;
;&amp;lt;nowiki&amp;gt;:turn&amp;lt;/nowiki&amp;gt; [''number'']&lt;br /&gt;
:{{DevFeature1.9}} change the current turn to the specified number. If no number is provided, the turn number is increased by one.&lt;br /&gt;
;&amp;lt;nowiki&amp;gt;:turn_limit&amp;lt;/nowiki&amp;gt; [''number'']&lt;br /&gt;
:{{DevFeature1.9}} change the turn limit for the current scenario to the specified number. If no number is provided, or it is -1, the turn limit is switched off.&lt;br /&gt;
;&amp;lt;nowiki&amp;gt;:version&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
:Report version and SVN revision level.&lt;br /&gt;
&lt;br /&gt;
== See Also ==&lt;br /&gt;
&lt;br /&gt;
* [[DebugMode]]&lt;br /&gt;
* [[DeveloperResources]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Playing Wesnoth]]&lt;br /&gt;
[[Category:Development]]&lt;/div&gt;</summary>
		<author><name>Luther</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.wesnoth.org/index.php?title=WesnothRepository&amp;diff=37711</id>
		<title>WesnothRepository</title>
		<link rel="alternate" type="text/html" href="https://wiki.wesnoth.org/index.php?title=WesnothRepository&amp;diff=37711"/>
		<updated>2010-07-26T05:58:29Z</updated>

		<summary type="html">&lt;p&gt;Luther: 1.6 -&amp;gt; 1.8&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Compiling Wesnoth}}&lt;br /&gt;
==  SVN ==&lt;br /&gt;
&lt;br /&gt;
Wesnoth development currently uses the [[SVN|Subversion]] software tool to keep developers in sync with each other. See the [http://svnbook.org SVN book] for more on how to use Subversion.&lt;br /&gt;
&lt;br /&gt;
==  Browse the code  ==&lt;br /&gt;
&lt;br /&gt;
There are currently two main streams of development: trunk (1.9.x) and stable branch (1.8.x). Most other branches are only used for a short time to do some testing without disturbing the main development. You can use your web browser to navigate through the source code:&lt;br /&gt;
&lt;br /&gt;
http://svn.gna.org/viewcvs/wesnoth/&lt;br /&gt;
&lt;br /&gt;
==  Download  ==&lt;br /&gt;
&lt;br /&gt;
To check out trunk into a directory ''wesnoth'' (about 400 MB to download and 960 MB disk space, including .svn dirs, required as of March 30th 2009):&lt;br /&gt;
 svn co http://svn.gna.org/svn/wesnoth/trunk wesnoth&lt;br /&gt;
&lt;br /&gt;
Or, to check out the 1.8 branch (about 400 MB to download and 960 MB to store on disk as of March 30th 2009) into a directory ''wesnoth-1.8'':&lt;br /&gt;
 svn co http://svn.gna.org/svn/wesnoth/branches/1.8 wesnoth-1.8&lt;br /&gt;
&lt;br /&gt;
More info on the repository: https://gna.org/svn/?group=wesnoth&lt;br /&gt;
&lt;br /&gt;
Note that if you are trying for commit access, you must have a developer account on gna, it must be registered as part of the Wesnoth group, and you must check out with&lt;br /&gt;
 svn co svn+ssh://gna_username@svn.gna.org/svn/wesnoth/trunk wesnoth&lt;br /&gt;
&lt;br /&gt;
==  Update  ==&lt;br /&gt;
&lt;br /&gt;
Do this from inside the ''wesnoth'' or ''wesnoth-1.8'' directory where you checked out the repository:&lt;br /&gt;
 svn update&lt;br /&gt;
&lt;br /&gt;
The following is only relevant when relying on the autotools based build system. This is not needed when relying on CMake or SCons as build environment:&lt;br /&gt;
&lt;br /&gt;
Note that when you update from Subversion, you should always run 'autogen.sh' if ''configure.ac'' or any of the ''Makefile.am'' files were changed.  It is safest to 'make clean' before updating, then update and finally run 'autogen.sh', 'configure' and 'make'.&lt;br /&gt;
&lt;br /&gt;
You may be able to skip the 'autogen.sh' and the 'make clean' if the makefiles and ''configure.ac'' have not changed.  If only minor changes were made then even the 'configure' step is optional.&lt;br /&gt;
&lt;br /&gt;
== See Also ==&lt;br /&gt;
&lt;br /&gt;
* [[CompilingWesnoth]]&lt;br /&gt;
* [[UsingAutotools]]&lt;br /&gt;
* [[SVN_on_Windows]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Development]]&lt;/div&gt;</summary>
		<author><name>Luther</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.wesnoth.org/index.php?title=Distributing_content&amp;diff=36429</id>
		<title>Distributing content</title>
		<link rel="alternate" type="text/html" href="https://wiki.wesnoth.org/index.php?title=Distributing_content&amp;diff=36429"/>
		<updated>2010-05-07T06:17:20Z</updated>

		<summary type="html">&lt;p&gt;Luther: /* The Add-on Server */ Corrections for 1.8 and info about what files aren't uploaded&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== The Forum ==&lt;br /&gt;
&lt;br /&gt;
The [http://www.wesnoth.org/forum/ BFW forum] is a good way to distribute small creations, like single multiplayer maps.  Larger creations, like multiplayer eras or campaigns, should be compressed before uploading them.  Note that you may encounter a size limit on attachments.&lt;br /&gt;
&lt;br /&gt;
Also, there is a [http://www.wesnoth.org/forum/viewtopic.php?t=2014 legal announcement] that you should read before distributing anything on the forum. Basically, by posting you say that you own the license to what you are posting, and that you are licensing it under the [http://www.gnu.org/copyleft/gpl.html General Public License].&lt;br /&gt;
&lt;br /&gt;
== The Add-on Server ==&lt;br /&gt;
&lt;br /&gt;
The add-on server is the preferred way to distribute your creations, but it is more suited for larger projects.  It currently lacks advanced organization features such as reviewing (although it does have a filter text box), so adding hundreds of little things makes it harder to find anything.  Basically, the server should not be used to post single maps, units, songs, or artwork, but map packs, campaigns, entire eras, music packs, and unit packs are fine.&lt;br /&gt;
&lt;br /&gt;
Once you are ready to publish, here is how you access the add-on server:&lt;br /&gt;
# Open Wesnoth&lt;br /&gt;
# Select &amp;quot;Add-ons&amp;quot; from the main menu&lt;br /&gt;
# Connect to the default ''add-ons.wesnoth.org'' add-on server&lt;br /&gt;
# Select &amp;quot;Publish add-on: ''Your Add-on Name''&amp;quot; (the last entry in the list of add-ons)&lt;br /&gt;
&lt;br /&gt;
Anything you distribute on the server will be uploaded from and downloaded to the ''userdata''/data/add-ons directory regardless of what it is (units, maps, campaign, etc).  For this reason, you need three things in the add-ons directory to distribute via the server:&lt;br /&gt;
# A folder, for example MyCampaign&lt;br /&gt;
# A .cfg file MyCampaign/_main.cfg&lt;br /&gt;
# A .pbl file MyCampaign/_server.pbl&lt;br /&gt;
Note that only the contents of your add-on directory (in this case, MyCampaign) will get uploaded, nothing else, so you need to have all the necessary files inside that directory.&lt;br /&gt;
&lt;br /&gt;
The following files and directories will not be uploaded: those that begin with '.' and those that end in '~'. Also, the GNU GPL version 2 will be added in the file COPYING.txt.&lt;br /&gt;
&lt;br /&gt;
==== General Reading ====&lt;br /&gt;
* [[BuildingCampaignsThePBLFile|General information about the .pbl file]] - It has a campaign flavor, but it is adaptable to any content&lt;br /&gt;
* [[PblWML|Syntax reference for the .pbl file]]&lt;br /&gt;
&lt;br /&gt;
==== Content-specific instructions ====&lt;br /&gt;
* Maps - see [[BuildingMaps|Building Maps]]&lt;br /&gt;
** [[BuildingMapsDistribution|About distributing map-packs]]&lt;br /&gt;
* Campaign - see [[BuildingCampaigns|Building Campaigns]]&lt;br /&gt;
** [[BuildingCampaignsDistribution|About distributing campaigns]]&lt;br /&gt;
* Multiplayer era - see [[BuildingFactions#Adding_a_whole_new_era_with_its_own_factions_-_modular|Building MP Era]]&lt;br /&gt;
* Unit pack - see [[BuildingUnits#Distributing_your_unit|Building Units]]&lt;br /&gt;
&lt;br /&gt;
==== License ====&lt;br /&gt;
You should note that by uploading anything to the add-on server, you say that you own the license to all content in your upload and that it is under the GPL. Whenever you upload or update your content pack, you will have to say &amp;quot;OK&amp;quot; to this statement: &amp;quot;All add-ons uploaded to this server must be licensed under the terms of the GNU General Public License (GPL). By uploading content to this server, you certify that you have the right to place the content under the conditions of the GPL, and choose to do so.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
== See Also ==&lt;br /&gt;
&lt;br /&gt;
* [[Create]]&lt;br /&gt;
* [[BuildingMapsDistribution]]&lt;br /&gt;
* [[BuildingCampaignsDistribution]]&lt;br /&gt;
* [[BuildingCampaignsThePBLFile]]&lt;br /&gt;
* [[PblWML]]&lt;br /&gt;
* [[IGNFileFormat]]&lt;br /&gt;
* [[Wesnoth:Copyrights]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Create]]&lt;/div&gt;</summary>
		<author><name>Luther</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.wesnoth.org/index.php?title=EventWML&amp;diff=36416</id>
		<title>EventWML</title>
		<link rel="alternate" type="text/html" href="https://wiki.wesnoth.org/index.php?title=EventWML&amp;diff=36416"/>
		<updated>2010-05-06T04:49:59Z</updated>

		<summary type="html">&lt;p&gt;Luther: /* Predefined 'name' Key Values */ Removed {{DevFeature}} from 'prestart'&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 actions which trigger at a certain point in a scenario. When used in a [scenario] tag (also includes [multiplayer], [tutorial] 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;
=== The 'name' Key (Mandatory) ===&lt;br /&gt;
&lt;br /&gt;
Usage:&lt;br /&gt;
 name=&amp;lt;value&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is '''not''' like a normal 'name' key. ''It is a basic description of when the event will trigger.'' It also has a very large number of predefined values, one of which must be used for the key to be valid.&lt;br /&gt;
&lt;br /&gt;
'''Lexicon side note:''' ''It is not uncommon to refer to these values as the 'trigger' for an event and, furthermore, to call an event by its 'trigger' name. For example, in an event containing '''name=moveto''', a person might refer to the event as a ''''moveto''' event' and/or refer to the ''''moveto''' trigger' in the event or even talk about the 'event trigger' when referring to the '''moveto''' value of the 'name' key in that event. Some or all of this usage can, in fact, be found throughout this page.''&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;
 name=attacker misses,defender misses&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;
==== Predefined 'name' Key Values ====&lt;br /&gt;
&lt;br /&gt;
All predefined event types are listed here along with a description of when this value will cause the event to be triggered. Any value ''not'' listed here is a custom event name which can be triggered only by a '''[fire_event]''' tag somewhere else. 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;
; preload&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;
: '''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;
: 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;
: '''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;
: Triggers after the map is shown but before the scenario begins -- before players can 'do' anything.&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;
: 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;
; side turn&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;
: 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;
: '''Note:'''  ''This event currently breaks replays since it is not explicitly saved in a replay and there is no AI involved in replays...''&lt;br /&gt;
&lt;br /&gt;
; turn refresh&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.&lt;br /&gt;
&lt;br /&gt;
; turn ''X''&lt;br /&gt;
: Triggers at the start of turn ''X''. It's the first side initialization event. Side initialization events go in the order of: &lt;br /&gt;
: 1) '''turn ''X''''' 2) '''new turn''' 3) '''side turn''' 4) '''side ''X'' turn''' 5) '''side ''X'' turn ''Y''''' 6) '''turn refresh'''&lt;br /&gt;
&lt;br /&gt;
; side ''X'' turn ''Y''&lt;br /&gt;
: This event triggers at the start of turn ''Y'' of side X  {{DevFeature}}&lt;br /&gt;
&lt;br /&gt;
; side ''X'' turn&lt;br /&gt;
: This event triggers at the start of any turn of side X {{DevFeature}}&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;
: This event triggers at the turn refresh for side X on turn Y {{DevFeature1.9}}&lt;br /&gt;
&lt;br /&gt;
; side ''X'' turn refresh&lt;br /&gt;
: This event triggers at the turn refresh for side X {{DevFeature1.9}}&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;
; time over&lt;br /&gt;
: Triggers on turn ''turns''. (''turns'' is specified in [scenario])&lt;br /&gt;
&lt;br /&gt;
; enemies defeated&lt;br /&gt;
: Triggers when all units with '''canrecruit=yes''' (that is, all leaders) not allied with side 1 are killed.&lt;br /&gt;
&lt;br /&gt;
; victory&lt;br /&gt;
: In this scenario, any tag of the form '''[endlevel] result=victory [/endlevel]''' will be automatically preceded by all actions in this tag. It helps debugging if the victory event allows you to safely advance to any of the possible next maps after using the &amp;quot;:n&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. (See also: [endlevel], [[DirectActionsWML]])&lt;br /&gt;
&lt;br /&gt;
; defeat&lt;br /&gt;
: In this scenario, any tag of the form '''[endlevel] result=defeat [/endlevel]''' will be automatically preceded by all actions in this tag. (See also [endlevel], [[DirectActionsWML]])&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Filters 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]]&lt;br /&gt;
&lt;br /&gt;
; moveto&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.&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 other changes to the game caused by the event. Thus it is up to the scenario designer to use this tag correctly.'' {{DevFeature}} $x2 and $y2 refer to the hex the unit came from.&lt;br /&gt;
&lt;br /&gt;
; sighted&lt;br /&gt;
: Triggers when the primary unit becomes visible to the secondary unit in particular after not being visible to the secondary unit's side (so if the secondary unit's side doesn't have shroud or fog, the event never triggers). This happens both when the primary unit moves into view during its turn, and when the secondary unit moves to a location where it can see the primary unit. (This editor hasn't tested whether the event triggers multiple times if the primary unit moves into view of multiple units at once, or if not, which one gets chosen to be the secondary unit here.) (Note: it appears that when a sighted event is triggered because an enemy unit moves into your field of view, the game engine cannot determine which unit (on your side) sees the unit that moved, and so it fires a ''name=sighted'' event without setting ''$second_unit''. This means that, for example, using ''speaker=second_unit'' inside a message tag may fail.) (Double note: it also appears that the sighted event in more recent versions of the game (1.6 and 1.7, maybe?) does not fire on enemy turns. That is, it only fires for units that become visible as a result of the motion of another unit, not for units that move into the vision of an enemy. This event is also buggy in general... it's usually better to use a moveto event with a [filter_vision] tag than to use a sighted event (and note that the combination of the two can achieve something like the old sighted event)).&lt;br /&gt;
&lt;br /&gt;
; attack&lt;br /&gt;
: Triggers when the primary unit attacks the secondary unit.&lt;br /&gt;
&lt;br /&gt;
; attack end&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;
: 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;
: Same as ''attacker hits'', but is triggered when the attacker misses.&lt;br /&gt;
&lt;br /&gt;
; defender hits&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;
: Same as ''defender hits'', but is triggered when the defender misses.&lt;br /&gt;
&lt;br /&gt;
; stone&lt;br /&gt;
: Triggers when the primary unit is hit by an attack with the 'stones' ability (See ''stones'', [[AbilitiesWML]]) by the secondary unit (the unit with the 'stones' ability). In {{DevFeature}}, this event name is changed to &amp;quot;petrified&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
; last breath&lt;br /&gt;
: Triggers when the primary unit is killed by the secondary unit, but before the death animation is triggered.&lt;br /&gt;
&lt;br /&gt;
; die&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.''&lt;br /&gt;
&lt;br /&gt;
; capture&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.&lt;br /&gt;
&lt;br /&gt;
; recruit&lt;br /&gt;
: Triggers when the primary unit is recruited. (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;
: Triggers when the primary unit is recruited but before it is displayed.&lt;br /&gt;
&lt;br /&gt;
; recall&lt;br /&gt;
: Triggers after a unit is recalled.&lt;br /&gt;
&lt;br /&gt;
; prerecall&lt;br /&gt;
: Triggers when a unit is recalled but before it is displayed.&lt;br /&gt;
&lt;br /&gt;
; advance&lt;br /&gt;
: Triggers just before the primary unit is going to advance to another unit.&lt;br /&gt;
&lt;br /&gt;
; post advance&lt;br /&gt;
: Triggers just after the primary unit has advanced to another unit.&lt;br /&gt;
&lt;br /&gt;
; select&lt;br /&gt;
: Triggers when the primary unit is selected. Also triggers when ending a move, 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;
: 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;
==== 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.&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;
==== [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 for the primary unit and the secondary unit that are not generally available in a standard unit filter. Can be used in events ''attack'', ''attacker hits'', ''attacker misses'', ''defender hits'', ''defender misses'' and ''attack end''. For more information and other filter keys, see [[FilterWML]].&lt;br /&gt;
:* '''name''': the name of the weapon used.&lt;br /&gt;
:* '''range''': the range of the weapon used.&lt;br /&gt;
:* '''special''': filter on the attack's special power.&lt;br /&gt;
&lt;br /&gt;
==== [filter_second_attack] ====&lt;br /&gt;
: Like [filter_attack], but for the secondary unit.&lt;br /&gt;
:* '''name''': the name of the weapon used.&lt;br /&gt;
:* '''range''': the range of the weapon used.&lt;br /&gt;
:* '''special''': filter on the attack's special power.&lt;br /&gt;
&lt;br /&gt;
==== [event] ====&lt;br /&gt;
: A special case 'action', the [event] tag may be used to create a [[#Nested Events|nested event]].&lt;br /&gt;
&lt;br /&gt;
==== delayed_variable_substitution ====&lt;br /&gt;
: This key is only relevant inside of a [[#Delayed Variable Substitution|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 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;
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).&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;
* sighted &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;
* stone&lt;br /&gt;
* last breath &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;
* post_advance &lt;br /&gt;
Events fired from a WML event handler that is synchronized:&lt;br /&gt;
* new turn {{DevFeature}}&lt;br /&gt;
* side turn {{DevFeature}}&lt;br /&gt;
* turn X {{DevFeature}}&lt;br /&gt;
* side X turn {{DevFeature}}&lt;br /&gt;
* side X turn Y {{DevFeature}}&lt;br /&gt;
* turn refresh {{DevFeature}}&lt;br /&gt;
&lt;br /&gt;
There is also the possibility of events that are 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;
It is perfectly possible (and, in fact, useful) to have multiple events with the same predefined name and thus the same trigger condition.  However, it is not defined what order such events will fire in, so you need to code so the order &lt;br /&gt;
will not matter.&lt;br /&gt;
&lt;br /&gt;
Because of the above, 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;
 #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;
&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;
== 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;
 [event]&lt;br /&gt;
     name=die&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;
&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;
 [event]&lt;br /&gt;
     name=turn 10&lt;br /&gt;
 &lt;br /&gt;
     [event]&lt;br /&gt;
         name=moveto&lt;br /&gt;
 &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;
&lt;br /&gt;
An equivalent way of doing this would be to create a single moveto event with an '''[if]''' statement to check for turn number but using nested '''[event]''' tags is a convenient shortcut to accomplish this task without resorting to '''[if]''' statements.&lt;br /&gt;
&lt;br /&gt;
=== Delayed Variable Substitution Example ===&lt;br /&gt;
&lt;br /&gt;
This code will display the turn on which the nested ''moveto'' event happens.&lt;br /&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;
 &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;
&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;
 [event]&lt;br /&gt;
     name=turn 10&lt;br /&gt;
 &lt;br /&gt;
     [event]&lt;br /&gt;
         name=moveto&lt;br /&gt;
 &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;
&lt;br /&gt;
This 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;
 [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;
 &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;
&lt;br /&gt;
Finally, this example is identical to the first two, in that it will display the turn 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;
 [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;
 &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;
&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;
 [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;
&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>Luther</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.wesnoth.org/index.php?title=LuaWML/Misc&amp;diff=34670</id>
		<title>LuaWML/Misc</title>
		<link rel="alternate" type="text/html" href="https://wiki.wesnoth.org/index.php?title=LuaWML/Misc&amp;diff=34670"/>
		<updated>2010-03-20T21:03:43Z</updated>

		<summary type="html">&lt;p&gt;Luther: /* wesnoth. game_config */ Spurious space&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page describes miscellaneous [[LuaWML]] objects and helpers.&lt;br /&gt;
&lt;br /&gt;
==== wesnoth.game_config ====&lt;br /&gt;
&lt;br /&gt;
Contrarily to the other values of the ''wesnoth'' table, ''game_config'' is simply a proxy table. Its fields offer an interface to the global settings of Wesnoth:&lt;br /&gt;
&lt;br /&gt;
* '''version''': string (read only)&lt;br /&gt;
* '''base_income''': integer (read/write)&lt;br /&gt;
* '''village_income''': integer (read/write)&lt;br /&gt;
* '''poison_amount''': integer (read/write)&lt;br /&gt;
* '''rest_heal_amount''': integer (read/write)&lt;br /&gt;
* '''recall_cost''': integer (read/write)&lt;br /&gt;
* '''kill_experience''': integer (read/write)&lt;br /&gt;
* '''debug''': boolean (read only)&lt;br /&gt;
&lt;br /&gt;
 -- Healing, poison, and regeneration, are a bit weak? Let's boost them!&lt;br /&gt;
 wesnoth.game_config.poison_amount = 15&lt;br /&gt;
&lt;br /&gt;
==== wesnoth.current ====&lt;br /&gt;
&lt;br /&gt;
As with ''game_config'', ''current'' is a proxy table. Its fields are getter for game-related properties:&lt;br /&gt;
&lt;br /&gt;
* '''side''': integer (read only)&lt;br /&gt;
* '''turn''': integer (read only)&lt;br /&gt;
* '''event_context''': WML table with attributes ''x1'', ''y1'', ''x2'', ''y2'', and children ''weapon'', ''second_weapon'', describing the trigger for the current event.&lt;br /&gt;
&lt;br /&gt;
 wesnoth.message(string.format(&amp;quot;Turn %d, side %d is playing.&amp;quot;, wesnoth.current.turn, wesnoth.current.side))&lt;br /&gt;
&lt;br /&gt;
==== helper.set_wml_tag_metatable ====&lt;br /&gt;
&lt;br /&gt;
Sets the metable of a table so that it can be used to create subtags with less brackets. Returns the table. The fields of the table are simple wrappers around table constructors.&lt;br /&gt;
&lt;br /&gt;
 T = helper.set_wml_tag_metatable {}&lt;br /&gt;
 W.event { name = &amp;quot;new turn&amp;quot;, T.message { speaker = &amp;quot;narrator&amp;quot;, message = &amp;quot;?&amp;quot; } }&lt;br /&gt;
&lt;br /&gt;
==== helper.modify_unit ====&lt;br /&gt;
&lt;br /&gt;
Modifies all the units satisfying the given filter (argument 1) with some WML attributes/objects (argument 2). This is a Lua implementation of the [http://www.wesnoth.org/macro-reference.xhtml MODIFY_UNIT] macro.&lt;br /&gt;
&lt;br /&gt;
 helper.modify_unit({ id=&amp;quot;Delfador&amp;quot; }, { moves=0 })&lt;br /&gt;
&lt;br /&gt;
==== helper.move_unit_fake ====&lt;br /&gt;
&lt;br /&gt;
Fakes the move of a unit satisfying the given filter (argument 1) to the given position (argument 2). This is a Lua implementation of the [http://www.wesnoth.org/macro-reference.xhtml MOVE_UNIT] macro.&lt;br /&gt;
&lt;br /&gt;
 helper.move_unit_fake({ id=&amp;quot;Delfador&amp;quot; }, 14, 8)&lt;/div&gt;</summary>
		<author><name>Luther</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.wesnoth.org/index.php?title=BuildingMaps&amp;diff=34547</id>
		<title>BuildingMaps</title>
		<link rel="alternate" type="text/html" href="https://wiki.wesnoth.org/index.php?title=BuildingMaps&amp;diff=34547"/>
		<updated>2010-03-15T18:04:23Z</updated>

		<summary type="html">&lt;p&gt;Luther: /* Play your map */ Use -&amp;gt; User&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;A map is just a bunch of terrain strings arranged in a rectangle (the rectangle is known as the &amp;quot;map data&amp;quot;). There are two ways to use this rectangle in a file: as a stand-alone map or within a scenario. The easiest way to create maps is just to use the built-in editor, but if you want to actually understand how maps work, you should read a little about the map data format. This page explains that format, and then has some pointers about the editor, saving files, and how to play on a map once you've made it. For instructions on how to distribute maps, see [[BuildingMapsDistribution]].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Creating a map ==&lt;br /&gt;
&lt;br /&gt;
Wesnoth has a fully functional map editor, accessible from within the game. The map editor should be fairly straightforward, however some helpful hotkeys can be found in the [[WesnothMapEditor]] article. Making good, balanced, interesting maps is another task altogether.  ESR has addressed it in his [http://catb.org/~esr/wesnoth/campaign-design-howto.html Campaign Design How-To]. If you run into trouble with the map editor, go ahead and ask for help on the [http://www.wesnoth.org/forum/viewforum.php?f=15 Multiplayer Development forum].&lt;br /&gt;
&lt;br /&gt;
If you're a programmer, note that while the source code and most binary distributions come with the official graphical map editor, you may have to give the build system a flag or argument to tell it to compile them as well as the main game.&lt;br /&gt;
&lt;br /&gt;
=== Adding units and map descriptions ===&lt;br /&gt;
&lt;br /&gt;
Campaign writers can't write campaigns without scenarios, so campaigns will always use scenario files. Multiplayer mapmakers, however, '''have a choice'''.  If you want to place an object or unit on the map, you must create a scenario file starting with the '''[multiplayer]''' tag and containing the ''map_data'' key therein. The ''map_data'' key can either point to a standalone map file or include the raw map data in quotes inside the scenario file. &lt;br /&gt;
&lt;br /&gt;
Using scenario files for multiplayer maps, you lose the simplicity of the standalone map file, but you gain tremendous power.  With a scenario file, you can add units and objects, include a map description, and set default map settings like allies, starting gold, and experience modifiers. You can even create custom events. Check out [[BuildingScenarios]], [[ScenarioWML]], and [[BuildingMultiplayer]] for more information.&lt;br /&gt;
&lt;br /&gt;
=== Map data format ===&lt;br /&gt;
&lt;br /&gt;
This is not the Matrix.  You normally don't need to look at encoded maps. However, if you would like to use some advanced terrain features or create scenarios and campaigns, you'll have to dive into the map code. The encoding for maps has a specific format in Wesnoth:&lt;br /&gt;
&lt;br /&gt;
* A map starts with a header with the following keys &lt;br /&gt;
** '''usage''', this should be 'map' for a map and 'mask' for an overlay mask&lt;br /&gt;
** '''border_size''', the size of the border, should be 1 for map and 0 for mask. When the border_size is 1 the map border is part of the map data, this means the user can define the border instead of the game taking a guess.&lt;br /&gt;
* Between the header and the data should be 1 empty line&lt;br /&gt;
* A map data file consists of any number of lines, each with the same number of strings.&lt;br /&gt;
* Each string must be a string specified in a ''string'' key specifying a terrain (see [[TerrainLettersWML]]).&lt;br /&gt;
* Each string may be padded with spaces or tabs and must be separated with a comma, except for the last string on a line this one may not have a comma.&lt;br /&gt;
* When the file is interpreted, each string will be replaced by the terrain it refers to.&lt;br /&gt;
* Empty lines are allowed before, after and between lines of characters, between lines is not advised.&lt;br /&gt;
* Terrains may be prefixed with a number followed by one space, these indicate the starting position for side ''n''. ''n'' = 1, 2, 3, ... 9 (more might work but is untested and unsupported). This is a change from the previous system where a starting position was automatically a keep.&lt;br /&gt;
&lt;br /&gt;
It's advised to use spaces for padding and pad each column to be the same width; the game does this when writing a map file.&lt;br /&gt;
 &lt;br /&gt;
Since text file tiles are squares while game tiles are hexes, some tiles must be shifted.&lt;br /&gt;
Tiles in even-numbered columns are shifted down 1/2 of a tile.&lt;br /&gt;
For example, to have a road of connected dirt ('Re') tiles, the map data would look like this:&lt;br /&gt;
&lt;br /&gt;
 usage=map&lt;br /&gt;
 border_size=1&lt;br /&gt;
 &lt;br /&gt;
 Re, Re, Gg, Gg, Gg, Gg, Gg, Gg&lt;br /&gt;
 Gg, Gg, Re, Re, Gg, Gg, Gg, Gg&lt;br /&gt;
 Gg, Gg, Gg, Gg, Re, Re, Gg, Gg&lt;br /&gt;
 Gg, Gg, Gg, Gg, Gg, Gg, Re, Re&lt;br /&gt;
&lt;br /&gt;
== So now what? ==&lt;br /&gt;
&lt;br /&gt;
You've created an awesome map with the map editor and you're ready to test it out. But how can you do this? It's actually quite simple.&lt;br /&gt;
&lt;br /&gt;
=== Play your map ===&lt;br /&gt;
&lt;br /&gt;
If you just want to play the map, maybe against the computer or with a friend, all you have to do is save it into the map editor's folder (the default location). Then, when you launch the game and host a multiplayer game, the map should appear '''at the top''' of the map choices screen.&lt;br /&gt;
&lt;br /&gt;
When creating a game on the multiplayer server, your map will be described to other players as a &amp;quot;User Map&amp;quot; and any replays stored on the server will refer to the game as &amp;quot;User Map.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
For the curious: Saving a map file like this creates a stand-alone file that holds the map data. That file is by default saved in '''''userdata''/editor/maps/''', and maps in that location are added to the top of the multiplayer map selection list.&lt;br /&gt;
&lt;br /&gt;
=== Share your map ===&lt;br /&gt;
&lt;br /&gt;
When you're ready to share your map with the world, post it to the [http://www.wesnoth.org/forum/viewforum.php?f=15 Multiplayer Development forum] or package it to be distributed on the in-game add-ons server. For instructions on how to distribute maps, see [[BuildingMapsDistribution]]&lt;br /&gt;
&lt;br /&gt;
== See Also ==&lt;br /&gt;
&lt;br /&gt;
* [[WesnothMapEditor]]&lt;br /&gt;
* [[TerrainCodesWML]]&lt;br /&gt;
* [[ScenarioWML]]&lt;br /&gt;
* [[ReferenceWML]]&lt;br /&gt;
&lt;br /&gt;
{{Create}}&lt;/div&gt;</summary>
		<author><name>Luther</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.wesnoth.org/index.php?title=InternalActionsWML&amp;diff=34522</id>
		<title>InternalActionsWML</title>
		<link rel="alternate" type="text/html" href="https://wiki.wesnoth.org/index.php?title=InternalActionsWML&amp;diff=34522"/>
		<updated>2010-03-14T18:42:24Z</updated>

		<summary type="html">&lt;p&gt;Luther: /* [store_locations] */ Now returns border hexes&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{WML Tags}}&lt;br /&gt;
&lt;br /&gt;
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 WML variables. The [http://www.wesnoth.org/macro-reference.xhtml#VARIABLE VARIABLE] macro is a quick syntactic shortcut for simple variable creation and the [http://www.wesnoth.org/macro-reference.xhtml#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 dollars signs.&lt;br /&gt;
&lt;br /&gt;
* '''format''': This attribute will be deprecated from 1.7 on. Same behaviour as value.&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. To subtract, add a negative number.&lt;br /&gt;
&lt;br /&gt;
* '''sub''' {{DevFeature}}: subtract the given amount from the variable.&lt;br /&gt;
&lt;br /&gt;
* '''multiply''': multiply the variable by the given number. To divide, multiply by the inverse eg: 4/2 = 4 * 1/2 = 4 * 0.5. To negate, multiply by -1. Floating point values are not rounded.&lt;br /&gt;
&lt;br /&gt;
* '''divide''': divide the variable by the given number. The result is an integer. Floating point results are not rounded. If both variables are integers, [http://en.wikipedia.org/wiki/Division_(mathematics)#Division_of_integers Integer division] is used.&lt;br /&gt;
&lt;br /&gt;
* '''modulo''': returns the remainder of a division.&lt;br /&gt;
&lt;br /&gt;
* '''random''': the variable will be randomly set.&amp;lt;br&amp;gt;You may provide a comma separated list of possibilities, e.g. 'random=Bob,Bill,Bella'.&amp;lt;br&amp;gt;You may provide a range of numbers (integers), e.g. 'random=3..5'.&amp;lt;br&amp;gt;You may combine these, e.g. 'random=100,1..9', in which case there would be 1/10th chance of getting 100, just like for each of 1 to 9.&lt;br /&gt;
&lt;br /&gt;
* '''rand''': does the same as random, but has better MP support. See [[BuildingMultiplayerExamples]] for more info on the MP case. '''It is highly recommended that you use this feature for randomization.'''&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;
* '''[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 comma) of the referenced variable.&lt;br /&gt;
&lt;br /&gt;
* '''fpart''': Assigns the decimal part (the part to the right of the comma) 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;
**'''ceil''': Rounds upward to the nearest integer.&lt;br /&gt;
**'''floor''': Rounds down to the nearest integer.&lt;br /&gt;
&lt;br /&gt;
=== [set_variables] ===&lt;br /&gt;
&lt;br /&gt;
Manipulates a WML array&lt;br /&gt;
&lt;br /&gt;
* '''name''': the name of the container to manipulate&lt;br /&gt;
&lt;br /&gt;
* '''mode''': one of the following values:&lt;br /&gt;
** ''replace'': will clean the array '''name''' and replace it with given data&lt;br /&gt;
** ''append'': will append given data to the current array&lt;br /&gt;
** ''merge'': will merge in the given data into '''name'''&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. '''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 unless the variable already contains data at that index. This limitation may be removed in future versions.&lt;br /&gt;
&lt;br /&gt;
* '''to_variable''': data will be set to the given array&lt;br /&gt;
&lt;br /&gt;
* '''[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;
* '''[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;
*'''[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&lt;br /&gt;
** '''separator''': separator to separate the elements&lt;br /&gt;
** '''remove_empty''': wether to ignore empty elements&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;
* '''side''': (default=1) the side for which the gold should be stored&lt;br /&gt;
&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. You must specify this or no locations will be stored.&lt;br /&gt;
&lt;br /&gt;
* '''variable''': the name of the variable (array) into which to store the locations&lt;br /&gt;
&lt;br /&gt;
* '''terrain''': a comma-sperated list of terrain codes. (See [[TerrainCodesWML]] for possible values.) If present, locations will only be chosen if the code for the terrain type of that location is listed.&lt;br /&gt;
&lt;br /&gt;
* '''radius''': if present, any locations which are within '''radius''' hexes of the location filter will also be stored&lt;br /&gt;
&lt;br /&gt;
* '''[filter]''' with a [[StandardUnitFilter]] as argument. Only locations with units on them that match the filter will be stored. Use a blank filter to only store locations with 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. The variable will contain the member variables 'name', 'team_name', 'gold' and 'income', 'fog', 'shroud', 'hidden', 'user_team_name', 'colour', 'controller', 'village_gold' and 'recruit'.&lt;br /&gt;
&lt;br /&gt;
* '''side''': the side whose information should be stored&lt;br /&gt;
&lt;br /&gt;
* '''variable''': the name of the variable to store the information in&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' (the terrain type for a starting location is always 'K' unless it has been changed) and 'owner_side' (villages only)&lt;br /&gt;
&lt;br /&gt;
* '''side''': the side whose starting location is to be stored&lt;br /&gt;
&lt;br /&gt;
* '''variable''': (default='location'): the name of the variable to store the location in&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;
* '''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_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 [[InternalActionsWMLUnitTags|here]]. 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).&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|[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|[unstore_unit]]] and [http://www.wesnoth.org/macro-reference.xhtml#FOREACH 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.&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 only be cleared if a match is found. If mode is set to ''append'', the variable will not be cleared.&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_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 array has members 'x' and 'y' (the position) and 'terrain' (the terrain type) and 'owner_side'.&lt;br /&gt;
&lt;br /&gt;
* '''owner_side''': a side number. If present, only villages owned by this side will be choosen. If owner_side=0, store the unowned villages. &lt;br /&gt;
&lt;br /&gt;
* '''variable''': the name of the variable (array) into which to store the locations&lt;br /&gt;
&lt;br /&gt;
* '''terrain''': a series of terrain characters. (See [[TerrainLettersWML]] for possible values.) If present, villages will only be chosen if the terrain code of the terrain type of that location is listed.  You may give a comma separated list of terrains.&lt;br /&gt;
&lt;br /&gt;
=== [clear_variable] ===&lt;br /&gt;
&lt;br /&gt;
This will delete the given variable or array. This is good to use to clean up the set of variables -- e.g. a well-behaved scenario will delete any variables that shouldn't be kept for the next scenario before the end of the scenario.&amp;lt;br&amp;gt; Tags and variables of stored units can also be cleared, meaning that [trait]s and [object]s, for example, can be removed.&lt;br /&gt;
&lt;br /&gt;
* '''name''': the name of the variable to clear, multiple comma-separated variable names can be given.&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&lt;br /&gt;
&lt;br /&gt;
* '''name''': the name of event to trigger&lt;br /&gt;
&lt;br /&gt;
* '''[primary_unit]''': ''(Optional)'' Primary unit for the event (usually the attacker). Will never match on a recall list unit. If it matches multiple units, only one will be chosen.&lt;br /&gt;
** '''x,y''': ''(Optional)'' The location of this unit.&lt;br /&gt;
&lt;br /&gt;
* '''[secondary_unit]''': ''(Optional)'' Same as '''[primary_unit]''' except for the secondary unit.&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;
=== [insert_tag] ===&lt;br /&gt;
&lt;br /&gt;
Inserts a variable as WML. In other words, the value of the passed variable will be injected into the game as if they had been written out in WML form. ([[#.5Binsert_tag.5D_Example|See Example]])&lt;br /&gt;
&lt;br /&gt;
*'''name''': The [&amp;quot;name&amp;quot;] to be given to the tag. This must be a valid WML tag name for anything to happen.&lt;br /&gt;
&lt;br /&gt;
*'''variable''': Name of the variable which will have it's value inserted into the tag.&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;
== Examples ==&lt;br /&gt;
&lt;br /&gt;
=== Using [set_variables] to Create Arrays of WML ===&lt;br /&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;
&lt;br /&gt;
This will produce two output messages, first one saying '''bar''' and next one saying '''more'''.&lt;br /&gt;
&lt;br /&gt;
=== [insert_tag] Example ===&lt;br /&gt;
&lt;br /&gt;
 [event]&lt;br /&gt;
     name=moveto&lt;br /&gt;
     &lt;br /&gt;
     [set_variable]&lt;br /&gt;
         name=temp.speaker&lt;br /&gt;
         value=Konrad&lt;br /&gt;
     [/set_variable]&lt;br /&gt;
     &lt;br /&gt;
     [set_variable]&lt;br /&gt;
         name=temp.message&lt;br /&gt;
         value= _ &amp;quot;Yo Kalenz!&amp;quot;&lt;br /&gt;
     [/set_variable]    &lt;br /&gt;
     &lt;br /&gt;
     [insert_tag]&lt;br /&gt;
         name=message&lt;br /&gt;
         variable=temp&lt;br /&gt;
     [/insert_tag]&lt;br /&gt;
 [/event]&lt;br /&gt;
&lt;br /&gt;
This is effectively identical to:&lt;br /&gt;
&lt;br /&gt;
 [event]&lt;br /&gt;
     name=moveto&lt;br /&gt;
     &lt;br /&gt;
     [message]&lt;br /&gt;
         speaker=Konrad&lt;br /&gt;
         message= _ &amp;quot;Yo Kalenz!&amp;quot;&lt;br /&gt;
     [/message]&lt;br /&gt;
 [/event]&lt;br /&gt;
&lt;br /&gt;
== See Also ==&lt;br /&gt;
* [[VariablesWML]]&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>Luther</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.wesnoth.org/index.php?title=InternalActionsWML&amp;diff=34175</id>
		<title>InternalActionsWML</title>
		<link rel="alternate" type="text/html" href="https://wiki.wesnoth.org/index.php?title=InternalActionsWML&amp;diff=34175"/>
		<updated>2010-03-02T00:27:36Z</updated>

		<summary type="html">&lt;p&gt;Luther: /* [store_locations] */ Specify if it stores border tiles&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{WML Tags}}&lt;br /&gt;
&lt;br /&gt;
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 WML variables. The [http://www.wesnoth.org/macro-reference.xhtml#VARIABLE VARIABLE] macro is a quick syntactic shortcut for simple variable creation and the [http://www.wesnoth.org/macro-reference.xhtml#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 dollars signs.&lt;br /&gt;
&lt;br /&gt;
* '''format''': This attribute will be deprecated from 1.7 on. Same behaviour as value.&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. To subtract, add a negative number.&lt;br /&gt;
&lt;br /&gt;
* '''sub''' {{DevFeature}}: subtract the given amount from the variable.&lt;br /&gt;
&lt;br /&gt;
* '''multiply''': multiply the variable by the given number. To divide, multiply by the inverse eg: 4/2 = 4 * 1/2 = 4 * 0.5. To negate, multiply by -1. Floating point values are not rounded.&lt;br /&gt;
&lt;br /&gt;
* '''divide''': divide the variable by the given number. The result is an integer. Floating point results are not rounded. If both variables are integers, [http://en.wikipedia.org/wiki/Division_(mathematics)#Division_of_integers Integer division] is used.&lt;br /&gt;
&lt;br /&gt;
* '''modulo''': returns the remainder of a division.&lt;br /&gt;
&lt;br /&gt;
* '''random''': the variable will be randomly set.&amp;lt;br&amp;gt;You may provide a comma separated list of possibilities, e.g. 'random=Bob,Bill,Bella'.&amp;lt;br&amp;gt;You may provide a range of numbers (integers), e.g. 'random=3..5'.&amp;lt;br&amp;gt;You may combine these, e.g. 'random=100,1..9', in which case there would be 1/10th chance of getting 100, just like for each of 1 to 9.&lt;br /&gt;
&lt;br /&gt;
* '''rand''': does the same as random, but has better MP support. See [[BuildingMultiplayerExamples]] for more info on the MP case. '''It is highly recommended that you use this feature for randomization.'''&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;
* '''[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 comma) of the referenced variable.&lt;br /&gt;
&lt;br /&gt;
* '''fpart''': Assigns the decimal part (the part to the right of the comma) 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;
**'''ceil''': Rounds upward to the nearest integer.&lt;br /&gt;
**'''floor''': Rounds down to the nearest integer.&lt;br /&gt;
&lt;br /&gt;
=== [set_variables] ===&lt;br /&gt;
&lt;br /&gt;
Manipulates a WML array&lt;br /&gt;
&lt;br /&gt;
* '''name''': the name of the container to manipulate&lt;br /&gt;
&lt;br /&gt;
* '''mode''': one of the following values:&lt;br /&gt;
** ''replace'': will clean the array '''name''' and replace it with given data&lt;br /&gt;
** ''append'': will append given data to the current array&lt;br /&gt;
** ''merge'': will merge in the given data into '''name'''&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. '''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 unless the variable already contains data at that index. This limitation may be removed in future versions.&lt;br /&gt;
&lt;br /&gt;
* '''to_variable''': data will be set to the given array&lt;br /&gt;
&lt;br /&gt;
* '''[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;
* '''[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;
*'''[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&lt;br /&gt;
** '''separator''': separator to separate the elements&lt;br /&gt;
** '''remove_empty''': wether to ignore empty elements&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;
* '''side''': (default=1) the side for which the gold should be stored&lt;br /&gt;
&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). Does not store the unreachable border hexes.&lt;br /&gt;
&lt;br /&gt;
* [[StandardLocationFilter]]: a location or location range which specifies the locations to store. You must specify this or no locations will be stored.&lt;br /&gt;
&lt;br /&gt;
* '''variable''': the name of the variable (array) into which to store the locations&lt;br /&gt;
&lt;br /&gt;
* '''terrain''': a comma-sperated list of terrain codes. (See [[TerrainCodesWML]] for possible values.) If present, locations will only be chosen if the code for the terrain type of that location is listed.&lt;br /&gt;
&lt;br /&gt;
* '''radius''': if present, any locations which are within '''radius''' hexes of the location filter will also be stored&lt;br /&gt;
&lt;br /&gt;
* '''[filter]''' with a [[StandardUnitFilter]] as argument. Only locations with units on them that match the filter will be stored. Use a blank filter to only store locations with 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. The variable will contain the member variables 'name', 'team_name', 'gold' and 'income', 'fog', 'shroud', 'hidden', 'user_team_name', 'colour', 'controller', 'village_gold' and 'recruit'.&lt;br /&gt;
&lt;br /&gt;
* '''side''': the side whose information should be stored&lt;br /&gt;
&lt;br /&gt;
* '''variable''': the name of the variable to store the information in&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' (the terrain type for a starting location is always 'K' unless it has been changed) and 'owner_side' (villages only)&lt;br /&gt;
&lt;br /&gt;
* '''side''': the side whose starting location is to be stored&lt;br /&gt;
&lt;br /&gt;
* '''variable''': (default='location'): the name of the variable to store the location in&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;
* '''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_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 [[InternalActionsWMLUnitTags|here]]. 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).&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|[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|[unstore_unit]]] and [http://www.wesnoth.org/macro-reference.xhtml#FOREACH 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.&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 only be cleared if a match is found. If mode is set to ''append'', the variable will not be cleared.&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_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 array has members 'x' and 'y' (the position) and 'terrain' (the terrain type) and 'owner_side'.&lt;br /&gt;
&lt;br /&gt;
* '''owner_side''': a side number. If present, only villages owned by this side will be choosen. If owner_side=0, store the unowned villages. &lt;br /&gt;
&lt;br /&gt;
* '''variable''': the name of the variable (array) into which to store the locations&lt;br /&gt;
&lt;br /&gt;
* '''terrain''': a series of terrain characters. (See [[TerrainLettersWML]] for possible values.) If present, villages will only be chosen if the terrain code of the terrain type of that location is listed.  You may give a comma separated list of terrains.&lt;br /&gt;
&lt;br /&gt;
=== [clear_variable] ===&lt;br /&gt;
&lt;br /&gt;
This will delete the given variable or array. This is good to use to clean up the set of variables -- e.g. a well-behaved scenario will delete any variables that shouldn't be kept for the next scenario before the end of the scenario.&amp;lt;br&amp;gt; Tags and variables of stored units can also be cleared, meaning that [trait]s and [object]s, for example, can be removed.&lt;br /&gt;
&lt;br /&gt;
* '''name''': the name of the variable to clear, multiple comma-separated variable names can be given.&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&lt;br /&gt;
&lt;br /&gt;
* '''name''': the name of event to trigger&lt;br /&gt;
&lt;br /&gt;
* '''[primary_unit]''': ''(Optional)'' Primary unit for the event (usually the attacker). Will never match on a recall list unit. If it matches multiple units, only one will be chosen.&lt;br /&gt;
** '''x,y''': ''(Optional)'' The location of this unit.&lt;br /&gt;
&lt;br /&gt;
* '''[secondary_unit]''': ''(Optional)'' Same as '''[primary_unit]''' except for the secondary unit.&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;
=== [insert_tag] ===&lt;br /&gt;
&lt;br /&gt;
Inserts a variable as WML. In other words, the value of the passed variable will be injected into the game as if they had been written out in WML form. ([[#.5Binsert_tag.5D_Example|See Example]])&lt;br /&gt;
&lt;br /&gt;
*'''name''': The [&amp;quot;name&amp;quot;] to be given to the tag. This must be a valid WML tag name for anything to happen.&lt;br /&gt;
&lt;br /&gt;
*'''variable''': Name of the variable which will have it's value inserted into the tag.&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;
== Examples ==&lt;br /&gt;
&lt;br /&gt;
=== Using [set_variables] to Create Arrays of WML ===&lt;br /&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;
&lt;br /&gt;
This will produce two output messages, first one saying '''bar''' and next one saying '''more'''.&lt;br /&gt;
&lt;br /&gt;
=== [insert_tag] Example ===&lt;br /&gt;
&lt;br /&gt;
 [event]&lt;br /&gt;
     name=moveto&lt;br /&gt;
     &lt;br /&gt;
     [set_variable]&lt;br /&gt;
         name=temp.speaker&lt;br /&gt;
         value=Konrad&lt;br /&gt;
     [/set_variable]&lt;br /&gt;
     &lt;br /&gt;
     [set_variable]&lt;br /&gt;
         name=temp.message&lt;br /&gt;
         value= _ &amp;quot;Yo Kalenz!&amp;quot;&lt;br /&gt;
     [/set_variable]    &lt;br /&gt;
     &lt;br /&gt;
     [insert_tag]&lt;br /&gt;
         name=message&lt;br /&gt;
         variable=temp&lt;br /&gt;
     [/insert_tag]&lt;br /&gt;
 [/event]&lt;br /&gt;
&lt;br /&gt;
This is effectively identical to:&lt;br /&gt;
&lt;br /&gt;
 [event]&lt;br /&gt;
     name=moveto&lt;br /&gt;
     &lt;br /&gt;
     [message]&lt;br /&gt;
         speaker=Konrad&lt;br /&gt;
         message= _ &amp;quot;Yo Kalenz!&amp;quot;&lt;br /&gt;
     [/message]&lt;br /&gt;
 [/event]&lt;br /&gt;
&lt;br /&gt;
== See Also ==&lt;br /&gt;
* [[VariablesWML]]&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>Luther</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.wesnoth.org/index.php?title=Template:WML_Tags&amp;diff=33577</id>
		<title>Template:WML Tags</title>
		<link rel="alternate" type="text/html" href="https://wiki.wesnoth.org/index.php?title=Template:WML_Tags&amp;diff=33577"/>
		<updated>2010-01-08T03:57:28Z</updated>

		<summary type="html">&lt;p&gt;Luther: Changed unit_type to point to UnitTypeWML&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{| class=&amp;quot;gallery&amp;quot; style=&amp;quot;width:225px;float: right;border: 1px solid #B48648; color:#B48648; font-size: 7pt;margin-left;10px;&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
&amp;lt;span style=&amp;quot;float: right;&amp;quot;&amp;gt;&amp;lt;small class=&amp;quot;editlink noprint plainlinksneverexpand&amp;quot;&amp;gt;[{{SERVER}}{{localurl:Template:WML Tags|action=edit}} edit ]&amp;lt;/small&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
'''WML Tags'''&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|''A:'' &lt;br /&gt;
[[AbilitiesWML|abilities]],&lt;br /&gt;
[[CampaignWML|about]],&lt;br /&gt;
[[AdvancedPreferenceWML|advanced_preference]],&lt;br /&gt;
[[UnitTypeWML|advancefrom]],&lt;br /&gt;
[[UnitTypeWML|advancement]],&lt;br /&gt;
[[StatisticalScenarioWML|advances]],&lt;br /&gt;
[[AiWML|ai]],&lt;br /&gt;
[[DirectActionsWML|allow_recruit]],&lt;br /&gt;
[[DirectActionsWML|allow_undo]],&lt;br /&gt;
[[ConditionalActionsWML#Meta_Condition_Tags|and]],&lt;br /&gt;
[[InterfaceActionsWML|animate_unit]],&lt;br /&gt;
[[AnimationWML|animation]],&lt;br /&gt;
[[VariablesWML|array]],&lt;br /&gt;
[[UnitTypeWML|attack]],&lt;br /&gt;
[[AnimationWML|attack_filter]], &lt;br /&gt;
[[StatisticalScenarioWML|attacks]],&lt;br /&gt;
[[AiWML|avoid]];&lt;br /&gt;
|-&lt;br /&gt;
|''B:'' &lt;br /&gt;
[[UnitTypeWML|base_unit]], [[CampaignWML#The_.5Bbinary_path.5D_tag|binary_path]], [[HelpWML|bold]], [[EditorWML|brush]];&lt;br /&gt;
|-&lt;br /&gt;
|''C:'' &lt;br /&gt;
[[CampaignWML#The_.5Bcampaign.5D_tag|campaign]],&lt;br /&gt;
[[DirectActionsWML|capture_village]],&lt;br /&gt;
[[ConditionalActionsWML#.5Bswitch.5D|case]],&lt;br /&gt;
[[ReplayWML|choose]],&lt;br /&gt;
[[InternalActionsWML|clear_variable]],&lt;br /&gt;
[[InterfaceActionsWML|colour_adjust]],&lt;br /&gt;
command([[InterfaceActionsWML|action]], [[ReplayWML|replay]]);&lt;br /&gt;
|-&lt;br /&gt;
|''D:'' &lt;br /&gt;
[[AbilitiesWML|damage]],&lt;br /&gt;
[[StatisticalScenarioWML|deaths]],&lt;br /&gt;
[[InterfaceActionsWML|debug_message]],&lt;br /&gt;
[[AnimationWML|defend]],&lt;br /&gt;
[[StatisticalScenarioWML|defends]],&lt;br /&gt;
[[UnitTypeWML|defense]],&lt;br /&gt;
[[InterfaceActionsWML|delay]],&lt;br /&gt;
[[ReplayWML|destination]],&lt;br /&gt;
[[DirectActionsWML|disallow_recruit]],&lt;br /&gt;
[[ConditionalActionsWML#.5Bwhile.5D|do]];&lt;br /&gt;
|-&lt;br /&gt;
|''E:'' &lt;br /&gt;
[[EditorWML|editor_group]],&lt;br /&gt;
[[EditorWML|editor_music]], &lt;br /&gt;
[[EditorWML|editor_times]],&lt;br /&gt;
[[EditorWML|editor_tool_hint]],&lt;br /&gt;
[[EffectWML|effect]],&lt;br /&gt;
[[ConditionalActionsWML#Conditional_Actions|else]],&lt;br /&gt;
[[DirectActionsWML|endlevel]],&lt;br /&gt;
end_turn&amp;amp;nbsp;([[DirectActionsWML|action]], [[ReplayWML|replay]]),&lt;br /&gt;
[[EraWML|era]],&lt;br /&gt;
[[EventWML|event]],&lt;br /&gt;
[[ThemeWML|expenses]];&lt;br /&gt;
|-&lt;br /&gt;
|''F:'' &lt;br /&gt;
[[EventWML#.5Bfilter.5D|filter]],&lt;br /&gt;
[[FilterWML|filter]],&lt;br /&gt;
[[AnimationWML|filter_attack]],&lt;br /&gt;
[[EventWML#.5Bfilter_attack.5D|filter_attack]],&lt;br /&gt;
[[FilterWML|filter_location]],&lt;br /&gt;
[[EventWML#.5Bfilter_second.5D|filter_second]],&lt;br /&gt;
[[FilterWML|filter_second]],&lt;br /&gt;
[[AnimationWML|filter_second_attack]],&lt;br /&gt;
[[EventWML#.5Bfilter_second_attack.5D|filter_second_attack]],&lt;br /&gt;
[[FilterWML|filter_vision]],&lt;br /&gt;
[[StandardUnitFilter|filter_wml]],&lt;br /&gt;
[[InternalActionsWML|fire_event]],&lt;br /&gt;
[[HelpWML|format]],&lt;br /&gt;
[[AnimationWML|frame]];&lt;br /&gt;
|-&lt;br /&gt;
|''G:'' &lt;br /&gt;
[[GameConfigWML|game_config]],&lt;br /&gt;
[[ScenarioWML|generator]],&lt;br /&gt;
[[DirectActionsWML|gold]],&lt;br /&gt;
[[ThemeWML|gold]];&lt;br /&gt;
|-&lt;br /&gt;
|''H:'' &lt;br /&gt;
[[ConditionalActionsWML#Condition_Tags|have_location]],&lt;br /&gt;
[[ConditionalActionsWML#Condition_Tags|have_unit]],&lt;br /&gt;
[[HelpWML|header]],&lt;br /&gt;
[[DirectActionsWML|heal_unit]],&lt;br /&gt;
[[UnitsWML|hide_help]],&lt;br /&gt;
[[InterfaceActionsWML|hide_unit]];&lt;br /&gt;
|-&lt;br /&gt;
|''I:'' &lt;br /&gt;
[[ConditionalActionsWML#.5Bif.5D|if]],&lt;br /&gt;
[[TimeWML|illuminated_time]],&lt;br /&gt;
[[TerrainGraphicsWML|image]],&lt;br /&gt;
[[HelpWML|img]],&lt;br /&gt;
[[ThemeWML|income]],&lt;br /&gt;
[[ReplayWML|init_side]],&lt;br /&gt;
[[InternalActionsWML|insert_tag]],&lt;br /&gt;
[[HelpWML|italic]],&lt;br /&gt;
[[InterfaceActionsWML|item]];&lt;br /&gt;
|-&lt;br /&gt;
|''J:''&lt;br /&gt;
[[HelpWML|jump]],&lt;br /&gt;
[[InternalActionsWML|join]];&lt;br /&gt;
|-&lt;br /&gt;
|''K:'' &lt;br /&gt;
[[DirectActionsWML|kill]],&lt;br /&gt;
[[StatisticalScenarioWML|killed]];&lt;br /&gt;
|-&lt;br /&gt;
|''L:'' &lt;br /&gt;
[[LabelWML|label]] ([[InterfaceActionsWML|map]], [[ThemeWML|theme]]),&lt;br /&gt;
[[LanguageWML|language]],&lt;br /&gt;
[[AiWML|leader_goal]],&lt;br /&gt;
[[LuaWML|lua]];&lt;br /&gt;
|-&lt;br /&gt;
|''M:'' &lt;br /&gt;
[[ThemeWML|main_map]],&lt;br /&gt;
[[ThemeWML|menu]],&lt;br /&gt;
[[InterfaceActionsWML|message]],&lt;br /&gt;
[[ThemeWML|mini_map]],&lt;br /&gt;
[[AnimationWML|missile_frame]],&lt;br /&gt;
[[SingleUnitWML|modifications]],&lt;br /&gt;
[[DirectActionsWML|modify_side]],&lt;br /&gt;
[[DirectActionsWML|modify_turns]],&lt;br /&gt;
[[ReplayWML|move]],&lt;br /&gt;
[[InterfaceActionsWML|move_unit_fake]],&lt;br /&gt;
[[UnitTypeWML|movement costs]],&lt;br /&gt;
[[UnitsWML|movetype]],&lt;br /&gt;
[[ScenarioWML|multiplayer]],&lt;br /&gt;
[[EraWML|multiplayer_side]],&lt;br /&gt;
[[InterfaceActionsWML|music]];&lt;br /&gt;
|-&lt;br /&gt;
|''N:'' &lt;br /&gt;
[[AnimationWML|neighbour_unit_filter]],&lt;br /&gt;
[[ConditionalActionsWML#Meta_Condition_Tags|not]],&lt;br /&gt;
[[FilterWML|not]],&lt;br /&gt;
[[ThemeWML|num_units]];&lt;br /&gt;
|-&lt;br /&gt;
|''O:'' &lt;br /&gt;
[[DirectActionsWML|object]],&lt;br /&gt;
[[InterfaceActionsWML|objectives]],&lt;br /&gt;
[[InterfaceActionsWML|objective]],&lt;br /&gt;
[[ThemeWML|observers]],&lt;br /&gt;
[[InterfaceActionsWML|open_help]],&lt;br /&gt;
[[InterfaceActionsWML|option]],&lt;br /&gt;
[[ConditionalActionsWML#Meta_Condition_Tags|or]];&lt;br /&gt;
|-&lt;br /&gt;
|''P:'' &lt;br /&gt;
[[ThemeWML|panel]], [[IntroWML|part]], [[DirectActionsWML|place_shroud]], [[ThemeWML|position]],&lt;br /&gt;
[[InterfaceActionsWML|print]], [[AiWML|protect_location]], [[AiWML|protect_unit]];&lt;br /&gt;
|-&lt;br /&gt;
|''R:'' &lt;br /&gt;
[[UnitsWML|race]], [[ReplayWML|random]], recall&amp;amp;nbsp;([[DirectActionsWML|action]], &lt;br /&gt;
[[ReplayWML|replay]]), [[StatisticalScenarioWML|recalls]],&lt;br /&gt;
[[ReplayWML|recruit]], [[StatisticalScenarioWML|recruits]], [[InterfaceActionsWML|redraw]],&lt;br /&gt;
[[HelpWML|ref]], [[DirectActionsWML|remove_shroud]], [[InterfaceActionsWML|remove_unit_overlay]],&lt;br /&gt;
[[InterfaceActionsWML|removeitem]], [[InterfaceActionsWML|remove_sound_source]], &lt;br /&gt;
[[ReplaceMapWML|replace_map]] [[SavefileWML|replay]], [[SavefileWML|replay_start]],&lt;br /&gt;
[[UnitTypeWML|resistance]], [[ThemeWML|resolution]], [[ReplayWML|results]], [[InternalActionsWML|role]];&lt;br /&gt;
|-&lt;br /&gt;
|''S:'' &lt;br /&gt;
[[SavefileWML|save]], [[ScenarioWML|scenario]],&lt;br /&gt;
[[InterfaceActionsWML|scroll]], [[InterfaceActionsWML|scroll_to]],&lt;br /&gt;
[[InterfaceActionsWML|scroll_to_unit]], [[AnimationWML|secondary_attack_filter]], [[AnimationWML|secondary_unit_filter]], [[HelpWML|section]],&lt;br /&gt;
[[InterfaceActionsWML#.5Bset_menu_item.5D_.28SVN_trunk_only.29|set_menu_item]], [[DirectActionsWML|set_recruit]],&lt;br /&gt;
[[InternalActionsWML|set_variable]], [[InternalActionsWML|set_variables]], [[InterfaceActionsWML|show_objectives]],&lt;br /&gt;
[[SideWML|side]], [[ThemeWML|side_playing]], [[SavefileWML|snapshot]],&lt;br /&gt;
[[InterfaceActionsWML|sound]], [[InterfaceActionsWML|sound_source]], [[ReplayWML|source]], [[EventWML|special_filter]], [[EventWML|special_filter_second]],&lt;br /&gt;
[[InternalActionsWML|split]],&lt;br /&gt;
[[StatisticalScenarioWML#The_.5Bstatistics.5D_tag|statistics]],&lt;br /&gt;
[[ThemeWML|status]], [[DirectActionsWML|stone]], [[InternalActionsWML|store_gold]], [[InternalActionsWML|store_locations]],&lt;br /&gt;
[[InternalActionsWML|store_map_dimensions]],&lt;br /&gt;
[[InternalActionsWML|store_side]], [[InternalActionsWML|store_starting_location]], [[InternalActionsWML|store_time_of_day]], [[InternalActionsWML|store_unit]], [[InternalActionsWML|store_villages]] [[IntroWML|story]],&lt;br /&gt;
[[ConditionalActionsWML#.5Bswitch.5D|switch]];&lt;br /&gt;
|-&lt;br /&gt;
|''T:'' &lt;br /&gt;
[[AiWML|target]],&lt;br /&gt;
[[StatisticalScenarioWML#The_.5Bteam.5D_tag|team]],&lt;br /&gt;
[[DirectActionsWML|teleport]], [[AnimationWML|teleport_anim]],&lt;br /&gt;
terrain([[TerrainWML|define]], [[DirectActionsWML|create]]), [[TerrainGraphicsWML|terrain_graphics]], [[TerrainMaskWML|terrain_mask]], [[ScenarioWML#Test_scenario|test]],&lt;br /&gt;
[[WesCamp|textdomain]], [[InterfaceActionsWML|text_input]], [[ThemeWML|theme]], [[ConditionalActionsWML#.5Bif.5D|then]],&lt;br /&gt;
[[TerrainGraphicsWML|tile]], [[TimeWML|time]], time_area&amp;amp;nbsp;([[DirectActionsWML|action]], [[ScenarioWML|scenario]]), &lt;br /&gt;
[[ThemeWML|time_of_day]],&lt;br /&gt;
[[HelpWML|topic]], [[HelpWML|toplevel]], [[SingleUnitWML|trait]], [[ThemeWML|turn]], [[ScenarioWML|tutorial]];&lt;br /&gt;
|-&lt;br /&gt;
|''U:'' &lt;br /&gt;
[[InterfaceActionsWML|unhide_unit]], unit&amp;amp;nbsp;([[UnitTypeWML|define]], [[SingleUnitWML|create]]),&lt;br /&gt;
[[ThemeWML|unit_abilities]], [[ThemeWML|unit_alignment]], [[ThemeWML|unit_description]], [[AnimationWML|unit_filter]], [[ThemeWML|unit_hp]], [[ThemeWML|unit_image]], [[ThemeWML|unit_level]], [[ThemeWML|unit_moves]],&lt;br /&gt;
[[InterfaceActionsWML|unit_overlay]], [[ThemeWML|unit_profile]], [[ThemeWML|unit_status]],&lt;br /&gt;
[[ThemeWML|unit_traits]], [[UnitTypeWML|unit_type]], [[ThemeWML|unit_weapons]], [[ThemeWML|unit_xp]],&lt;br /&gt;
[[UnitsWML|units]], [[DirectActionsWML|unstone]], [[DirectActionsWML|unstore_unit]], [[ThemeWML|upkeep]];&lt;br /&gt;
|-&lt;br /&gt;
| ''V:'' &lt;br /&gt;
[[ConditionalActionsWML#Condition_Tags|variable]],&lt;br /&gt;
[[VariablesWML|variables]],&lt;br /&gt;
[[SideWML|village]],&lt;br /&gt;
[[ThemeWML|villages]];&lt;br /&gt;
|-&lt;br /&gt;
| ''W:'' &lt;br /&gt;
[[ConditionalActionsWML#.5Bwhile.5D|while]],&lt;br /&gt;
[[InterfaceActionsWML|wml_message]];&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Luther</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.wesnoth.org/index.php?title=Download&amp;diff=19514</id>
		<title>Download</title>
		<link rel="alternate" type="text/html" href="https://wiki.wesnoth.org/index.php?title=Download&amp;diff=19514"/>
		<updated>2007-11-27T20:16:53Z</updated>

		<summary type="html">&lt;p&gt;Luther: /* Source code */ Words &amp;quot;current&amp;quot; and &amp;quot;previous&amp;quot; were switched&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Welcome to the Battle for Wesnoth downloads page.  The BFW project team only officially releases the source code.  Binary packages are only provided by community volunteers and hosted here. Torrents are also unofficial.&lt;br /&gt;
&lt;br /&gt;
If the latest binaries are not currently available for your OS, please check back in a few days to see if they have been placed here. Packagers have been informed of the release, please be patient.  In the meantime, read the [[FAQ#A_new_version_is_out.2C_but_where_is_the_download_for_.5BWindows.2C_Mac_OS.2C_etc..5D.3F|FAQ]].&lt;br /&gt;
&lt;br /&gt;
__NOTOC__&lt;br /&gt;
Jump to: [[Download#Stable_.281.2_branch.29|Stable Branch]] | [[Download#Development_.281.3_branch.29|Development Branch]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Stable (1.2 branch) ==&lt;br /&gt;
&lt;br /&gt;
==== Source code ====&lt;br /&gt;
* [http://downloads.sourceforge.net/wesnoth/wesnoth-1.2.8.tar.bz2?download Current stable version] (1.2.8, 69.7 MB)&lt;br /&gt;
* [http://downloads.sourceforge.net/wesnoth/wesnoth-1.2.7.tar.bz2?download Previous stable version] (1.2.7, 69.7 MB)&lt;br /&gt;
* [[CompilingWesnoth|Compiling Guide]] - how to compile the source code&lt;br /&gt;
&lt;br /&gt;
==== [[BeOS]] ====&lt;br /&gt;
* The current version (1.2.8) is not available yet.&lt;br /&gt;
* [http://zeta-games.com/index.php?option=com_remository&amp;amp;Itemid=28&amp;amp;func=fileinfo&amp;amp;id=24 Previous stable version] (1.2.1, 70.11 MB)&lt;br /&gt;
* [http://downloads.sourceforge.net/wesnoth/Wesnoth-1.0.2-BeOS-x86.pkg.zip?download Older stable version, not compatible with 1.2] (1.0.2, 42.3 MB)&lt;br /&gt;
&lt;br /&gt;
==== GNU/Linux ====&lt;br /&gt;
* There are specific binaries for many different GNU/Linux Distributions. Not all are always up to date with the current release. Please have a look at the [[WesnothBinariesLinux|Linux binary page]] for more informations about the binaries for your Distribution.&lt;br /&gt;
&lt;br /&gt;
==== OpenBSD ====&lt;br /&gt;
'''Note:''' OpenBSD-current is required to play with these binaries:&lt;br /&gt;
* The current version (1.2.8) is not available yet.&lt;br /&gt;
* [http://downloads.sourceforge.net/wesnoth/wesnoth-openbsd--1.2.7.tgz?download Previous stable version ] (1.2.7, 75.0 MiB)&lt;br /&gt;
* [ftp://pkg@ftp.enqlave.net/wesnoth-1.2.7.tgz Previous stable version (mirror @ Enqlave) ] (1.2.7, 75.0 MiB)&lt;br /&gt;
&lt;br /&gt;
==== OS/2 &amp;amp; eComStation ====&lt;br /&gt;
* The current version (1.2.8) not available yet.&lt;br /&gt;
* [http://download.smedley.info/wesnoth-1.2.5-os2.zip Previous stable version (1.2.5)] (1.2.5, 70 MB)&lt;br /&gt;
&lt;br /&gt;
==== Mac OS X ====&lt;br /&gt;
Be aware that OSX 10.3.9+ is required to play with these binaries.&lt;br /&gt;
* [http://downloads.sourceforge.net/wesnoth/Wesnoth_MacOSX_1.2.8a.dmg?download Current stable version] (1.2.8, Universal, 81.0 MB)&lt;br /&gt;
* [http://downloads.sourceforge.net/wesnoth/Wesnoth_MacOSX_1.2.8_lite.dmg?download Current stable version - lite] (1.2.8, Universal, no art or music, 51.9 MB)&lt;br /&gt;
* [http://downloads.sourceforge.net/wesnoth/Wesnoth_MacOSX_1.2.7.dmg?download Previous stable version] (1.2.7, Universal, 80.8 MB)&lt;br /&gt;
* [http://downloads.sourceforge.net/wesnoth/Wesnoth_MacOSX_1.2.7_lite.dmg?download Previous stable version - lite] (1.2.7, Universal, no art or music, 51.5 MB)&lt;br /&gt;
&lt;br /&gt;
==== MS Windows ====&lt;br /&gt;
* [http://downloads.sourceforge.net/wesnoth/wesnoth-1.2.8-windows.exe?download Current version] (1.2.8, 63.0 MB)&lt;br /&gt;
* [http://downloads.sourceforge.net/wesnoth/wesnoth-1.2.7-windows.exe?download Previous version] (1.2.7, 63.1 MB)&lt;br /&gt;
&lt;br /&gt;
==== AmigaOS4 ====&lt;br /&gt;
* The current version (1.2.8) is not available yet.&lt;br /&gt;
* [http://os4depot.net/index.php?function=showfile&amp;amp;file=game/strategy/wesnoth.lha Previous stable version ] (1.2.5, 63 MB)&lt;br /&gt;
&lt;br /&gt;
==== Syllable ====&lt;br /&gt;
* The current version (1.2.8) is not available yet.&lt;br /&gt;
* [http://www.syllable-software.info/download.php?view.28 Previous stable version] (1.2.6, 60.8 MB)&lt;br /&gt;
&lt;br /&gt;
==== Miscellaneous ====&lt;br /&gt;
* [http://downloads.sourceforge.net/wesnoth/wesnoth-1.2.8.tar.bz2.md5?download Source code md5sum]&lt;br /&gt;
* [http://www.wesnoth.org/wiki/Download_Xdeltas#Source_code Xdelta for the source code]&lt;br /&gt;
* [http://www.wesnoth.org/wiki/Download_Xdeltas#MS_Windows Xdelta for the Windows binary]&lt;br /&gt;
&lt;br /&gt;
== Development (1.3 branch) ==&lt;br /&gt;
&lt;br /&gt;
Version 1.3.x is the latest development version, boasting updated graphics and new exciting features. However, there may be occasional bugs or performance problems in the development versions since heavy changes are taking place all the time. For balanced and stable gaming, it is recommended you use the latest version of the 1.2.x branch.  This version is recommended for coders and campaign developers, as well as those who want to preview the future of Wesnoth.&lt;br /&gt;
&lt;br /&gt;
==== Source code ====&lt;br /&gt;
* [http://downloads.sourceforge.net/wesnoth/wesnoth-1.3.11.tar.bz2?download Current Version] (1.3.11, 98.2 MB)&lt;br /&gt;
* [http://downloads.sourceforge.net/wesnoth/wesnoth-1.3.10.tar.bz2?download Previous Version] (1.3.10, 98.2 MB)&lt;br /&gt;
&lt;br /&gt;
* [[CompilingWesnoth|Compiling Guide]] - how to compile the source code&lt;br /&gt;
&lt;br /&gt;
==== MS Windows ====&lt;br /&gt;
* [http://downloads.sourceforge.net/wesnoth/wesnoth-1.3.11-windows.exe?download Current version] (1.3.11, 89.8 MB)&lt;br /&gt;
* [http://downloads.sourceforge.net/wesnoth/wesnoth-1.3.10-windows.exe?download Previous Version] (1.3.10, 89.8 MB)&lt;br /&gt;
* [http://www.exong.net/builds/index.php?dir=&amp;amp;sort=date&amp;amp;order=desc Daily SVN snapshots] (only the .exe, in addition you need an SVN checkout to use it)&lt;br /&gt;
&lt;br /&gt;
==== Mac OS X ====&lt;br /&gt;
* [http://downloads.sourceforge.net/wesnoth/Wesnoth_MacOSX_1.3.11.dmg?download Current Version] (1.3.11, Universal, 109.5 MB)&lt;br /&gt;
* [http://downloads.sourceforge.net/wesnoth/Wesnoth_MacOSX_1.3.11_lite.dmg?download Current Version - lite] (1.3.11, Universal, no art or music, 63.4 MB)&lt;br /&gt;
* [http://downloads.sourceforge.net/wesnoth/Wesnoth_MacOSX_1.3.10.dmg?download Previous Version] (1.3.10, Universal, 109.3 MB)&lt;br /&gt;
* [http://downloads.sourceforge.net/wesnoth/Wesnoth_MacOSX_1.3.10_lite.dmg?download Previous Version - lite] (1.3.10, Universal, no art or music, 63.2 MB)&lt;br /&gt;
&lt;br /&gt;
==== GNU/Linux ====&lt;br /&gt;
* There are binaries for many different GNU/Linux Distributions. Not all are always up to date with the current release. Please have a look at the [[WesnothBinariesLinux|Linux binary page]] for more information about the binaries for your Distribution.&lt;br /&gt;
&lt;br /&gt;
==== (Open)Solaris ====&lt;br /&gt;
* The current version (1.3.11) is not available yet.&lt;br /&gt;
* [http://downloads.sourceforge.net/wesnoth/wesnoth-solaris-1.3.8.i386.pkg.bz2?download Older version for x86] (1.3.8, Solaris package for x86, 77.6 MB)&lt;br /&gt;
&lt;br /&gt;
==== AmigaOS4 ====&lt;br /&gt;
* [http://os4depot.net/index.php?function=showfile&amp;amp;file=game/strategy/wesnoth-devel.lha Current Version] (1.3.11, 93 MB)&lt;br /&gt;
&lt;br /&gt;
==== OS/2 &amp;amp; eComStation ====&lt;br /&gt;
* The current version not available.&lt;br /&gt;
* [http://download.smedley.info/wesnoth-1.1.8-os2.zip Older Version] (1.1.8, 66 MB)&lt;br /&gt;
&lt;br /&gt;
==== Syllable ====&lt;br /&gt;
* The current version (1.3.11) is not available yet.&lt;br /&gt;
* [http://www.syllable-software.info/download.php?view.32 Older Version] (1.3.8, 82.2 MB)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Miscellaneous ====&lt;br /&gt;
* [http://downloads.sourceforge.net/wesnoth/wesnoth-1.3.11.tar.bz2.md5?download md5sum for current source code]&lt;br /&gt;
* [http://www.wesnoth.org/wiki/Download_Xdeltas#Source_code Xdelta for the source code]&lt;br /&gt;
* [http://sourceforge.net/project/showfiles.php?group_id=89495 SourceForge page for current and all previous versions]&lt;br /&gt;
&lt;br /&gt;
== License ==&lt;br /&gt;
This program is free software; you can redistribute it and/or modify it under the terms of the [http://www.fsf.org/copyleft/gpl.html GNU General Public License version 2], as published by the [http://www.fsf.org/ Free Software Foundation].&lt;br /&gt;
This program is distributed in the hope that it will be useful, but without any warranty; without even the implied warranty of merchantability or fitness for a particular purpose. See the GNU General Public License for more details.&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
* [http://changelog.wesnoth.org Changelog]&lt;br /&gt;
* [[WesnothBinaries| More binaries]]&lt;br /&gt;
* [[WesnothSVN]] - bleeding edge version from SVN&lt;/div&gt;</summary>
		<author><name>Luther</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.wesnoth.org/index.php?title=BasicStrategy&amp;diff=11975</id>
		<title>BasicStrategy</title>
		<link rel="alternate" type="text/html" href="https://wiki.wesnoth.org/index.php?title=BasicStrategy&amp;diff=11975"/>
		<updated>2006-10-06T16:38:03Z</updated>

		<summary type="html">&lt;p&gt;Luther: /* Don't waste units */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The following basic combat principles and tips are intended to help starting off your career as a wesnothian battle veteran. The minor concrete examples are somewhat tied to the &amp;quot;Heir to the Throne&amp;quot; campaign.&lt;br /&gt;
&lt;br /&gt;
=== Don't waste units ===&lt;br /&gt;
&lt;br /&gt;
Do not send wounded units to a sure death. Once a unit loses more than half of its hit points (HP), you should seriously consider retreating it to safety and either station it in a village for healing or give him to the care of a healer (like Elvish Shamans or White Mages). Healers are very useful!&lt;br /&gt;
&lt;br /&gt;
This is for practical reasons: a heavily wounded unit cannot hold back or kill the enemy. During attack and counterattack, it most often will perish. Further, by sending it to its sure death, its gathered experience points (XP) are lost. Recruiting a replacement may be impossible because the leader is not in its keep or because funds are running low. Even if you can recruit a replacement, it is most often far away from the battle front. So don't waste your units.&lt;br /&gt;
&lt;br /&gt;
=== Out of the enemy's reach ===&lt;br /&gt;
&lt;br /&gt;
How do you guard wounded units? They are best guarded by being out of the adversary's reach. No enemy can attack them if enemies cannot even come near them. The next section about zone of control (ZOC) shows how to restrict the enemy's moves.&lt;br /&gt;
&lt;br /&gt;
In the Action menu, you can select &amp;quot;Show Enemy Moves&amp;quot; to highlight all possible hexes your adversary can actually move to. This takes your zone of control into account. Thus you can check that your near death unit, which is behind, indeed cannot be attacked as the enemy cannot move close to it.&lt;br /&gt;
&lt;br /&gt;
When your armies meet, you may want to try to be the first to attack. So try to end your move out of striking range of the enemy army. He cannot attack but most likely will close into your striking range.&lt;br /&gt;
&lt;br /&gt;
=== Shield with your zone of control (ZOC) ===&lt;br /&gt;
&lt;br /&gt;
Every unit of level 1 or higher maintains a zone of control (ZOC) covering all 6 neighboring hexes. This means that once an enemy moves into one of the six neighboring tiles, it is forced to halt and its movement phase ends (only enemies with the rare skirmisher ability ignore this).&lt;br /&gt;
&lt;br /&gt;
Because of ZOC, an enemy may not slip between two units which are aligned on a north-south or diagonal line and have exactly 1 or 2 hexes between them. By combining these pairs into a long wall or using them in different directions, you can prevent the enemy from reaching a wounded unit behind. He has to defeat the units imposing the ZOC first. If the enemy can barely reach it, even a single unit may shield a small region behind itself.&lt;br /&gt;
&lt;br /&gt;
=== Maintain a defensive line ===&lt;br /&gt;
&lt;br /&gt;
By lining up many units directly adjacent or with at most 1 hex space between them, you can build up a powerful defensive line. Note that, because Wesnoth uses hexes, a east-to-west &amp;quot;line&amp;quot; is not a straight line but a zig-zag curve. The north south line and the diagonals are the &amp;quot;real&amp;quot; lines.&lt;br /&gt;
&lt;br /&gt;
Coming from one side, the enemy may attack any single of your units in the line with only 2 of his units at a time. As a rule of thumb, a healthy unit without particular weakness can withstand an attack from two normal enemy units without getting killed.&lt;br /&gt;
&lt;br /&gt;
Unfortunately, your line often has to bend to form a wedge or to fit the terrain. At these corner points, 3 enemy units may attack. This also happens at the ends of a line if the line is too short. Use units with high hit point on proper terrain or with proper resistances to hold these weak points. These are the most likely to be killed, so use units with no or few experience points (XP) for this purpose.&lt;br /&gt;
&lt;br /&gt;
Lining your troops up also prevents the enemy from surrounding any one of them. For ZOC reasons, a unit with one enemy behind and in front is trapped.&lt;br /&gt;
&lt;br /&gt;
=== Rotate your troops ===&lt;br /&gt;
&lt;br /&gt;
When a unit in the front line is heavily damaged you can move him safely behind your defensive line. To hold up the line, you will most likely have to replace him with a reserve, so hold a couple of units in back of the front line. If you have healers, damaged units in the second line will quickly recover.&lt;br /&gt;
&lt;br /&gt;
Note that your units ''can'' pass through hexes containing your own troops.&lt;br /&gt;
&lt;br /&gt;
=== Use the terrain ===&lt;br /&gt;
&lt;br /&gt;
Try to position your troops so that they are attacking from a hex with high defense against an enemy in a hex with low terrain. Note that different units work better on different terrains. This way, terrain often dictates where you line up your units.&lt;br /&gt;
&lt;br /&gt;
For example, you may position your elves at the end of the forest so that attacking orcs must stand on grassland while your elves enjoy the high forest defenses.&lt;br /&gt;
&lt;br /&gt;
=== Attacking and choosing your targets ===&lt;br /&gt;
&lt;br /&gt;
Advancing and attacking is of course the most interesting part of your way to victory. Kill or weaken enemies in your path and move your defensive line forward. This can become tricky as the enemy gets to attack back on his turn.&lt;br /&gt;
&lt;br /&gt;
Often, you will throw several units at a single enemy unit to finish him off, but these were forming your defensive line which is now partly broken. Maybe this doesn't matter because you are out of reach of the next enemy unit. Maybe it does because you only managed to weaken a very strong enemy and next turn, he is going to strike back. Perhaps a Horseman can deliver the killing blow.&lt;br /&gt;
&lt;br /&gt;
Striking first is an advantage because it allows you the choice of which units will face off. Take advantage of enemy weakness: e.g. direct your ranged attacks against foes without ranged weapons.  Take advantage of weaknesses like Horsemen's vulnerability to pierce. But remember that they get to attack back on their turn, so you might have weaknesses he may exploit.&lt;br /&gt;
&lt;br /&gt;
For example, Horsemen can hold up the line against Orcish Grunts and Troll Whelps very well because they have some resistances against blade and impact. But your Horseman may quite quickly fall to Orcish Archers and Orcish Pikemen.&lt;br /&gt;
&lt;br /&gt;
It usually pays off if you can definitively kill (or almost kill) the faced unit. If you are unsure of finishing off the enemy in one turn, ensure that your unit can weather the return attacks, or that you're willing to lose that unit. To withstand the enemies strikes next turn, it is often wise to attack with the weapon that deals the least damage to you. So use your ranged weapons if the enemy has no ranged attack. The computers default choice only looks for the most damage you deal out.&lt;br /&gt;
&lt;br /&gt;
=== Time of Day ===&lt;br /&gt;
&lt;br /&gt;
Remember that Lawful units like humans fight better at daytime and Chaotic units like orcs or undead fight better at night. Ideally you want to first meet the enemy when you are strong and/or he is weak. When the enemy has its strong time, it often pays off to strengthen your lines and hold a favorable defensive position. When its weak time is about to arise, your advance will push forth.&lt;br /&gt;
&lt;br /&gt;
For example, elves might hold out a forest during a nightly orcish onslaught and advance on  sunrise. You may even note that the computer AI actively retreats his orcs during day.&lt;br /&gt;
&lt;br /&gt;
=== Experience ===&lt;br /&gt;
&lt;br /&gt;
Over the course of a campaign, it is critical that you build up a seasoned force.  Later scenarios will assume you have level 2 and 3 units available for recall.&lt;br /&gt;
&lt;br /&gt;
Your units gain most experience points (XP) from killing an enemy unit (8XP per level of the unit killed).  As such, it often makes sense to have your higher level units weaken an enemy, but cede the kill to a unit more in need of the XP.  Healers in particular are often weak in combat and often need to 'steal' kills in this way to advance levels.&lt;br /&gt;
&lt;br /&gt;
At the beginning (when you probably have no high level units), try to give most kills to a small handful of your units.  This will fast-track them to becoming Level 2 units, and they can then shepherd others.&lt;br /&gt;
&lt;br /&gt;
Don't neglect to earn your leader experience.  You need to keep him safe, but if you coddle him too much he will be too low level to survive future scenarios anyway.&lt;/div&gt;</summary>
		<author><name>Luther</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.wesnoth.org/index.php?title=BasicStrategy&amp;diff=11974</id>
		<title>BasicStrategy</title>
		<link rel="alternate" type="text/html" href="https://wiki.wesnoth.org/index.php?title=BasicStrategy&amp;diff=11974"/>
		<updated>2006-10-06T16:33:56Z</updated>

		<summary type="html">&lt;p&gt;Luther: /* Shield with your zone of control (ZOC) */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The following basic combat principles and tips are intended to help starting off your career as a wesnothian battle veteran. The minor concrete examples are somewhat tied to the &amp;quot;Heir to the Throne&amp;quot; campaign.&lt;br /&gt;
&lt;br /&gt;
=== Don't waste units ===&lt;br /&gt;
&lt;br /&gt;
Do not send wounded units to a sure death. Once a unit loses more than half of its hit points, you should seriously consider retreating it to safety and either station it in a village for healing or give him to the care of a healer (like Elvish Shamans or White Mages). Healers are very useful!&lt;br /&gt;
&lt;br /&gt;
This is for practical reasons: a heavily wounded unit cannot hold back or kill the enemy. During attack and counterattack, it most often will perish. Further, by sending it to its sure death, its gathered experience points (XP) are lost. Recruiting a replacement may be impossible because the leader is not in its keep or because funds are running low. Even if you can recruit a replacement, it is most often far away from the battle front. So don't waste your units.&lt;br /&gt;
&lt;br /&gt;
=== Out of the enemy's reach ===&lt;br /&gt;
&lt;br /&gt;
How do you guard wounded units? They are best guarded by being out of the adversary's reach. No enemy can attack them if enemies cannot even come near them. The next section about zone of control (ZOC) shows how to restrict the enemy's moves.&lt;br /&gt;
&lt;br /&gt;
In the Action menu, you can select &amp;quot;Show Enemy Moves&amp;quot; to highlight all possible hexes your adversary can actually move to. This takes your zone of control into account. Thus you can check that your near death unit, which is behind, indeed cannot be attacked as the enemy cannot move close to it.&lt;br /&gt;
&lt;br /&gt;
When your armies meet, you may want to try to be the first to attack. So try to end your move out of striking range of the enemy army. He cannot attack but most likely will close into your striking range.&lt;br /&gt;
&lt;br /&gt;
=== Shield with your zone of control (ZOC) ===&lt;br /&gt;
&lt;br /&gt;
Every unit of level 1 or higher maintains a zone of control (ZOC) covering all 6 neighboring hexes. This means that once an enemy moves into one of the six neighboring tiles, it is forced to halt and its movement phase ends (only enemies with the rare skirmisher ability ignore this).&lt;br /&gt;
&lt;br /&gt;
Because of ZOC, an enemy may not slip between two units which are aligned on a north-south or diagonal line and have exactly 1 or 2 hexes between them. By combining these pairs into a long wall or using them in different directions, you can prevent the enemy from reaching a wounded unit behind. He has to defeat the units imposing the ZOC first. If the enemy can barely reach it, even a single unit may shield a small region behind itself.&lt;br /&gt;
&lt;br /&gt;
=== Maintain a defensive line ===&lt;br /&gt;
&lt;br /&gt;
By lining up many units directly adjacent or with at most 1 hex space between them, you can build up a powerful defensive line. Note that, because Wesnoth uses hexes, a east-to-west &amp;quot;line&amp;quot; is not a straight line but a zig-zag curve. The north south line and the diagonals are the &amp;quot;real&amp;quot; lines.&lt;br /&gt;
&lt;br /&gt;
Coming from one side, the enemy may attack any single of your units in the line with only 2 of his units at a time. As a rule of thumb, a healthy unit without particular weakness can withstand an attack from two normal enemy units without getting killed.&lt;br /&gt;
&lt;br /&gt;
Unfortunately, your line often has to bend to form a wedge or to fit the terrain. At these corner points, 3 enemy units may attack. This also happens at the ends of a line if the line is too short. Use units with high hit point on proper terrain or with proper resistances to hold these weak points. These are the most likely to be killed, so use units with no or few experience points (XP) for this purpose.&lt;br /&gt;
&lt;br /&gt;
Lining your troops up also prevents the enemy from surrounding any one of them. For ZOC reasons, a unit with one enemy behind and in front is trapped.&lt;br /&gt;
&lt;br /&gt;
=== Rotate your troops ===&lt;br /&gt;
&lt;br /&gt;
When a unit in the front line is heavily damaged you can move him safely behind your defensive line. To hold up the line, you will most likely have to replace him with a reserve, so hold a couple of units in back of the front line. If you have healers, damaged units in the second line will quickly recover.&lt;br /&gt;
&lt;br /&gt;
Note that your units ''can'' pass through hexes containing your own troops.&lt;br /&gt;
&lt;br /&gt;
=== Use the terrain ===&lt;br /&gt;
&lt;br /&gt;
Try to position your troops so that they are attacking from a hex with high defense against an enemy in a hex with low terrain. Note that different units work better on different terrains. This way, terrain often dictates where you line up your units.&lt;br /&gt;
&lt;br /&gt;
For example, you may position your elves at the end of the forest so that attacking orcs must stand on grassland while your elves enjoy the high forest defenses.&lt;br /&gt;
&lt;br /&gt;
=== Attacking and choosing your targets ===&lt;br /&gt;
&lt;br /&gt;
Advancing and attacking is of course the most interesting part of your way to victory. Kill or weaken enemies in your path and move your defensive line forward. This can become tricky as the enemy gets to attack back on his turn.&lt;br /&gt;
&lt;br /&gt;
Often, you will throw several units at a single enemy unit to finish him off, but these were forming your defensive line which is now partly broken. Maybe this doesn't matter because you are out of reach of the next enemy unit. Maybe it does because you only managed to weaken a very strong enemy and next turn, he is going to strike back. Perhaps a Horseman can deliver the killing blow.&lt;br /&gt;
&lt;br /&gt;
Striking first is an advantage because it allows you the choice of which units will face off. Take advantage of enemy weakness: e.g. direct your ranged attacks against foes without ranged weapons.  Take advantage of weaknesses like Horsemen's vulnerability to pierce. But remember that they get to attack back on their turn, so you might have weaknesses he may exploit.&lt;br /&gt;
&lt;br /&gt;
For example, Horsemen can hold up the line against Orcish Grunts and Troll Whelps very well because they have some resistances against blade and impact. But your Horseman may quite quickly fall to Orcish Archers and Orcish Pikemen.&lt;br /&gt;
&lt;br /&gt;
It usually pays off if you can definitively kill (or almost kill) the faced unit. If you are unsure of finishing off the enemy in one turn, ensure that your unit can weather the return attacks, or that you're willing to lose that unit. To withstand the enemies strikes next turn, it is often wise to attack with the weapon that deals the least damage to you. So use your ranged weapons if the enemy has no ranged attack. The computers default choice only looks for the most damage you deal out.&lt;br /&gt;
&lt;br /&gt;
=== Time of Day ===&lt;br /&gt;
&lt;br /&gt;
Remember that Lawful units like humans fight better at daytime and Chaotic units like orcs or undead fight better at night. Ideally you want to first meet the enemy when you are strong and/or he is weak. When the enemy has its strong time, it often pays off to strengthen your lines and hold a favorable defensive position. When its weak time is about to arise, your advance will push forth.&lt;br /&gt;
&lt;br /&gt;
For example, elves might hold out a forest during a nightly orcish onslaught and advance on  sunrise. You may even note that the computer AI actively retreats his orcs during day.&lt;br /&gt;
&lt;br /&gt;
=== Experience ===&lt;br /&gt;
&lt;br /&gt;
Over the course of a campaign, it is critical that you build up a seasoned force.  Later scenarios will assume you have level 2 and 3 units available for recall.&lt;br /&gt;
&lt;br /&gt;
Your units gain most experience points (XP) from killing an enemy unit (8XP per level of the unit killed).  As such, it often makes sense to have your higher level units weaken an enemy, but cede the kill to a unit more in need of the XP.  Healers in particular are often weak in combat and often need to 'steal' kills in this way to advance levels.&lt;br /&gt;
&lt;br /&gt;
At the beginning (when you probably have no high level units), try to give most kills to a small handful of your units.  This will fast-track them to becoming Level 2 units, and they can then shepherd others.&lt;br /&gt;
&lt;br /&gt;
Don't neglect to earn your leader experience.  You need to keep him safe, but if you coddle him too much he will be too low level to survive future scenarios anyway.&lt;/div&gt;</summary>
		<author><name>Luther</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.wesnoth.org/index.php?title=BasicStrategy&amp;diff=11973</id>
		<title>BasicStrategy</title>
		<link rel="alternate" type="text/html" href="https://wiki.wesnoth.org/index.php?title=BasicStrategy&amp;diff=11973"/>
		<updated>2006-10-06T16:08:26Z</updated>

		<summary type="html">&lt;p&gt;Luther: /* Out of the enemy's reach */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The following basic combat principles and tips are intended to help starting off your career as a wesnothian battle veteran. The minor concrete examples are somewhat tied to the &amp;quot;Heir to the Throne&amp;quot; campaign.&lt;br /&gt;
&lt;br /&gt;
=== Don't waste units ===&lt;br /&gt;
&lt;br /&gt;
Do not send wounded units to a sure death. Once a unit loses more than half of its hit points, you should seriously consider retreating it to safety and either station it in a village for healing or give him to the care of a healer (like Elvish Shamans or White Mages). Healers are very useful!&lt;br /&gt;
&lt;br /&gt;
This is for practical reasons: a heavily wounded unit cannot hold back or kill the enemy. During attack and counterattack, it most often will perish. Further, by sending it to its sure death, its gathered experience points (XP) are lost. Recruiting a replacement may be impossible because the leader is not in its keep or because funds are running low. Even if you can recruit a replacement, it is most often far away from the battle front. So don't waste your units.&lt;br /&gt;
&lt;br /&gt;
=== Out of the enemy's reach ===&lt;br /&gt;
&lt;br /&gt;
How do you guard wounded units? They are best guarded by being out of the adversary's reach. No enemy can attack them if enemies cannot even come near them. The next section about zone of control (ZOC) shows how to restrict the enemy's moves.&lt;br /&gt;
&lt;br /&gt;
In the Action menu, you can select &amp;quot;Show Enemy Moves&amp;quot; to highlight all possible hexes your adversary can actually move to. This takes your zone of control into account. Thus you can check that your near death unit, which is behind, indeed cannot be attacked as the enemy cannot move close to it.&lt;br /&gt;
&lt;br /&gt;
When your armies meet, you may want to try to be the first to attack. So try to end your move out of striking range of the enemy army. He cannot attack but most likely will close into your striking range.&lt;br /&gt;
&lt;br /&gt;
=== Shield with your zone of control (ZOC) ===&lt;br /&gt;
&lt;br /&gt;
Every hex tile a unit stands on has 6 neighbors. On these, every unit of level 1 or higher maintains a zone of control (ZOC). This means that once an enemy moves into one of the six aforementioned tiles, it is forced to halt and its movement phase ends (only enemies with the rare skirmisher ability ignore this).&lt;br /&gt;
&lt;br /&gt;
Because of ZOC, an enemy may not slip between two units which are aligned on a north-south or a diagonal line and have exactly 1 or 2 hexes between them. By combining these pairs to a long wall or using them in different directions, you can be prevent the enemy reaching a wounded unit behind. He has to defeat the ZOC imposing units first. If the enemy can barely reach it, even a single unit may shield a small region behind itself.&lt;br /&gt;
&lt;br /&gt;
=== Maintain a defensive line ===&lt;br /&gt;
&lt;br /&gt;
By lining up many units directly adjacent or with at most 1 hex space between them, you can build up a powerful defensive line. Note that, because Wesnoth uses hexes, a east-to-west &amp;quot;line&amp;quot; is not a straight line but a zig-zag curve. The north south line and the diagonals are the &amp;quot;real&amp;quot; lines.&lt;br /&gt;
&lt;br /&gt;
Coming from one side, the enemy may attack any single of your units in the line with only 2 of his units at a time. As a rule of thumb, a healthy unit without particular weakness can withstand an attack from two normal enemy units without getting killed.&lt;br /&gt;
&lt;br /&gt;
Unfortunately, your line often has to bend to form a wedge or to fit the terrain. At these corner points, 3 enemy units may attack. This also happens at the ends of a line if the line is too short. Use units with high hit point on proper terrain or with proper resistances to hold these weak points. These are the most likely to be killed, so use units with no or few experience points (XP) for this purpose.&lt;br /&gt;
&lt;br /&gt;
Lining your troops up also prevents the enemy from surrounding any one of them. For ZOC reasons, a unit with one enemy behind and in front is trapped.&lt;br /&gt;
&lt;br /&gt;
=== Rotate your troops ===&lt;br /&gt;
&lt;br /&gt;
When a unit in the front line is heavily damaged you can move him safely behind your defensive line. To hold up the line, you will most likely have to replace him with a reserve, so hold a couple of units in back of the front line. If you have healers, damaged units in the second line will quickly recover.&lt;br /&gt;
&lt;br /&gt;
Note that your units ''can'' pass through hexes containing your own troops.&lt;br /&gt;
&lt;br /&gt;
=== Use the terrain ===&lt;br /&gt;
&lt;br /&gt;
Try to position your troops so that they are attacking from a hex with high defense against an enemy in a hex with low terrain. Note that different units work better on different terrains. This way, terrain often dictates where you line up your units.&lt;br /&gt;
&lt;br /&gt;
For example, you may position your elves at the end of the forest so that attacking orcs must stand on grassland while your elves enjoy the high forest defenses.&lt;br /&gt;
&lt;br /&gt;
=== Attacking and choosing your targets ===&lt;br /&gt;
&lt;br /&gt;
Advancing and attacking is of course the most interesting part of your way to victory. Kill or weaken enemies in your path and move your defensive line forward. This can become tricky as the enemy gets to attack back on his turn.&lt;br /&gt;
&lt;br /&gt;
Often, you will throw several units at a single enemy unit to finish him off, but these were forming your defensive line which is now partly broken. Maybe this doesn't matter because you are out of reach of the next enemy unit. Maybe it does because you only managed to weaken a very strong enemy and next turn, he is going to strike back. Perhaps a Horseman can deliver the killing blow.&lt;br /&gt;
&lt;br /&gt;
Striking first is an advantage because it allows you the choice of which units will face off. Take advantage of enemy weakness: e.g. direct your ranged attacks against foes without ranged weapons.  Take advantage of weaknesses like Horsemen's vulnerability to pierce. But remember that they get to attack back on their turn, so you might have weaknesses he may exploit.&lt;br /&gt;
&lt;br /&gt;
For example, Horsemen can hold up the line against Orcish Grunts and Troll Whelps very well because they have some resistances against blade and impact. But your Horseman may quite quickly fall to Orcish Archers and Orcish Pikemen.&lt;br /&gt;
&lt;br /&gt;
It usually pays off if you can definitively kill (or almost kill) the faced unit. If you are unsure of finishing off the enemy in one turn, ensure that your unit can weather the return attacks, or that you're willing to lose that unit. To withstand the enemies strikes next turn, it is often wise to attack with the weapon that deals the least damage to you. So use your ranged weapons if the enemy has no ranged attack. The computers default choice only looks for the most damage you deal out.&lt;br /&gt;
&lt;br /&gt;
=== Time of Day ===&lt;br /&gt;
&lt;br /&gt;
Remember that Lawful units like humans fight better at daytime and Chaotic units like orcs or undead fight better at night. Ideally you want to first meet the enemy when you are strong and/or he is weak. When the enemy has its strong time, it often pays off to strengthen your lines and hold a favorable defensive position. When its weak time is about to arise, your advance will push forth.&lt;br /&gt;
&lt;br /&gt;
For example, elves might hold out a forest during a nightly orcish onslaught and advance on  sunrise. You may even note that the computer AI actively retreats his orcs during day.&lt;br /&gt;
&lt;br /&gt;
=== Experience ===&lt;br /&gt;
&lt;br /&gt;
Over the course of a campaign, it is critical that you build up a seasoned force.  Later scenarios will assume you have level 2 and 3 units available for recall.&lt;br /&gt;
&lt;br /&gt;
Your units gain most experience points (XP) from killing an enemy unit (8XP per level of the unit killed).  As such, it often makes sense to have your higher level units weaken an enemy, but cede the kill to a unit more in need of the XP.  Healers in particular are often weak in combat and often need to 'steal' kills in this way to advance levels.&lt;br /&gt;
&lt;br /&gt;
At the beginning (when you probably have no high level units), try to give most kills to a small handful of your units.  This will fast-track them to becoming Level 2 units, and they can then shepherd others.&lt;br /&gt;
&lt;br /&gt;
Don't neglect to earn your leader experience.  You need to keep him safe, but if you coddle him too much he will be too low level to survive future scenarios anyway.&lt;/div&gt;</summary>
		<author><name>Luther</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.wesnoth.org/index.php?title=BasicStrategy&amp;diff=11972</id>
		<title>BasicStrategy</title>
		<link rel="alternate" type="text/html" href="https://wiki.wesnoth.org/index.php?title=BasicStrategy&amp;diff=11972"/>
		<updated>2006-10-06T15:55:54Z</updated>

		<summary type="html">&lt;p&gt;Luther: /* Don't waste units */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The following basic combat principles and tips are intended to help starting off your career as a wesnothian battle veteran. The minor concrete examples are somewhat tied to the &amp;quot;Heir to the Throne&amp;quot; campaign.&lt;br /&gt;
&lt;br /&gt;
=== Don't waste units ===&lt;br /&gt;
&lt;br /&gt;
Do not send wounded units to a sure death. Once a unit loses more than half of its hit points, you should seriously consider retreating it to safety and either station it in a village for healing or give him to the care of a healer (like Elvish Shamans or White Mages). Healers are very useful!&lt;br /&gt;
&lt;br /&gt;
This is for practical reasons: a heavily wounded unit cannot hold back or kill the enemy. During attack and counterattack, it most often will perish. Further, by sending it to its sure death, its gathered experience points (XP) are lost. Recruiting a replacement may be impossible because the leader is not in its keep or because funds are running low. Even if you can recruit a replacement, it is most often far away from the battle front. So don't waste your units.&lt;br /&gt;
&lt;br /&gt;
=== Out of the enemy's reach ===&lt;br /&gt;
&lt;br /&gt;
How do you guard wounded units? They are best guarded by being out of the adversary's reach. No enemy can attack them, just because no enemy cannot even come near to them. The next paragraph about zone of control (ZOC) will shows how to restrict the enemy's moves.&lt;br /&gt;
&lt;br /&gt;
In the Action menu, you can select &amp;quot;Show Enemy Moves&amp;quot; to highlight all possible hexes your adversary can actually move to and which takes your zone of control into account. Thus you can check that your near death unit behind indeed cannot be attacked as the enemy may not move close to it.&lt;br /&gt;
&lt;br /&gt;
When your armies meet, you may want to try to be the first to attack. So try to end your move out of the striking range of the enemy army. He cannot attack but most likely will close in into your striking range.&lt;br /&gt;
&lt;br /&gt;
=== Shield with your zone of control (ZOC) ===&lt;br /&gt;
&lt;br /&gt;
Every hex tile a unit stands on has 6 neighbors. On these, every unit of level 1 or higher maintains a zone of control (ZOC). This means that once an enemy moves into one of the six aforementioned tiles, it is forced to halt and its movement phase ends (only enemies with the rare skirmisher ability ignore this).&lt;br /&gt;
&lt;br /&gt;
Because of ZOC, an enemy may not slip between two units which are aligned on a north-south or a diagonal line and have exactly 1 or 2 hexes between them. By combining these pairs to a long wall or using them in different directions, you can be prevent the enemy reaching a wounded unit behind. He has to defeat the ZOC imposing units first. If the enemy can barely reach it, even a single unit may shield a small region behind itself.&lt;br /&gt;
&lt;br /&gt;
=== Maintain a defensive line ===&lt;br /&gt;
&lt;br /&gt;
By lining up many units directly adjacent or with at most 1 hex space between them, you can build up a powerful defensive line. Note that, because Wesnoth uses hexes, a east-to-west &amp;quot;line&amp;quot; is not a straight line but a zig-zag curve. The north south line and the diagonals are the &amp;quot;real&amp;quot; lines.&lt;br /&gt;
&lt;br /&gt;
Coming from one side, the enemy may attack any single of your units in the line with only 2 of his units at a time. As a rule of thumb, a healthy unit without particular weakness can withstand an attack from two normal enemy units without getting killed.&lt;br /&gt;
&lt;br /&gt;
Unfortunately, your line often has to bend to form a wedge or to fit the terrain. At these corner points, 3 enemy units may attack. This also happens at the ends of a line if the line is too short. Use units with high hit point on proper terrain or with proper resistances to hold these weak points. These are the most likely to be killed, so use units with no or few experience points (XP) for this purpose.&lt;br /&gt;
&lt;br /&gt;
Lining your troops up also prevents the enemy from surrounding any one of them. For ZOC reasons, a unit with one enemy behind and in front is trapped.&lt;br /&gt;
&lt;br /&gt;
=== Rotate your troops ===&lt;br /&gt;
&lt;br /&gt;
When a unit in the front line is heavily damaged you can move him safely behind your defensive line. To hold up the line, you will most likely have to replace him with a reserve, so hold a couple of units in back of the front line. If you have healers, damaged units in the second line will quickly recover.&lt;br /&gt;
&lt;br /&gt;
Note that your units ''can'' pass through hexes containing your own troops.&lt;br /&gt;
&lt;br /&gt;
=== Use the terrain ===&lt;br /&gt;
&lt;br /&gt;
Try to position your troops so that they are attacking from a hex with high defense against an enemy in a hex with low terrain. Note that different units work better on different terrains. This way, terrain often dictates where you line up your units.&lt;br /&gt;
&lt;br /&gt;
For example, you may position your elves at the end of the forest so that attacking orcs must stand on grassland while your elves enjoy the high forest defenses.&lt;br /&gt;
&lt;br /&gt;
=== Attacking and choosing your targets ===&lt;br /&gt;
&lt;br /&gt;
Advancing and attacking is of course the most interesting part of your way to victory. Kill or weaken enemies in your path and move your defensive line forward. This can become tricky as the enemy gets to attack back on his turn.&lt;br /&gt;
&lt;br /&gt;
Often, you will throw several units at a single enemy unit to finish him off, but these were forming your defensive line which is now partly broken. Maybe this doesn't matter because you are out of reach of the next enemy unit. Maybe it does because you only managed to weaken a very strong enemy and next turn, he is going to strike back. Perhaps a Horseman can deliver the killing blow.&lt;br /&gt;
&lt;br /&gt;
Striking first is an advantage because it allows you the choice of which units will face off. Take advantage of enemy weakness: e.g. direct your ranged attacks against foes without ranged weapons.  Take advantage of weaknesses like Horsemen's vulnerability to pierce. But remember that they get to attack back on their turn, so you might have weaknesses he may exploit.&lt;br /&gt;
&lt;br /&gt;
For example, Horsemen can hold up the line against Orcish Grunts and Troll Whelps very well because they have some resistances against blade and impact. But your Horseman may quite quickly fall to Orcish Archers and Orcish Pikemen.&lt;br /&gt;
&lt;br /&gt;
It usually pays off if you can definitively kill (or almost kill) the faced unit. If you are unsure of finishing off the enemy in one turn, ensure that your unit can weather the return attacks, or that you're willing to lose that unit. To withstand the enemies strikes next turn, it is often wise to attack with the weapon that deals the least damage to you. So use your ranged weapons if the enemy has no ranged attack. The computers default choice only looks for the most damage you deal out.&lt;br /&gt;
&lt;br /&gt;
=== Time of Day ===&lt;br /&gt;
&lt;br /&gt;
Remember that Lawful units like humans fight better at daytime and Chaotic units like orcs or undead fight better at night. Ideally you want to first meet the enemy when you are strong and/or he is weak. When the enemy has its strong time, it often pays off to strengthen your lines and hold a favorable defensive position. When its weak time is about to arise, your advance will push forth.&lt;br /&gt;
&lt;br /&gt;
For example, elves might hold out a forest during a nightly orcish onslaught and advance on  sunrise. You may even note that the computer AI actively retreats his orcs during day.&lt;br /&gt;
&lt;br /&gt;
=== Experience ===&lt;br /&gt;
&lt;br /&gt;
Over the course of a campaign, it is critical that you build up a seasoned force.  Later scenarios will assume you have level 2 and 3 units available for recall.&lt;br /&gt;
&lt;br /&gt;
Your units gain most experience points (XP) from killing an enemy unit (8XP per level of the unit killed).  As such, it often makes sense to have your higher level units weaken an enemy, but cede the kill to a unit more in need of the XP.  Healers in particular are often weak in combat and often need to 'steal' kills in this way to advance levels.&lt;br /&gt;
&lt;br /&gt;
At the beginning (when you probably have no high level units), try to give most kills to a small handful of your units.  This will fast-track them to becoming Level 2 units, and they can then shepherd others.&lt;br /&gt;
&lt;br /&gt;
Don't neglect to earn your leader experience.  You need to keep him safe, but if you coddle him too much he will be too low level to survive future scenarios anyway.&lt;/div&gt;</summary>
		<author><name>Luther</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.wesnoth.org/index.php?title=FAQ&amp;diff=11220</id>
		<title>FAQ</title>
		<link rel="alternate" type="text/html" href="https://wiki.wesnoth.org/index.php?title=FAQ&amp;diff=11220"/>
		<updated>2006-08-15T18:47:12Z</updated>

		<summary type="html">&lt;p&gt;Luther: /* There's too much luck in this game! */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Frequently Asked Questions=&lt;br /&gt;
&lt;br /&gt;
== General ==&lt;br /&gt;
&lt;br /&gt;
===What is Battle for Wesnoth?===&lt;br /&gt;
Battle for Wesnoth is a fantasy turn-based strategy game.&lt;br /&gt;
&lt;br /&gt;
===What license is the game distributed under?===&lt;br /&gt;
The project is distributed under the [http://www.fsf.org/copyleft/gpl.html GPL]. All contributors retain copyright on the portions of the project that they contribute.&lt;br /&gt;
&lt;br /&gt;
===How to get informed about new releases?===&lt;br /&gt;
Subscribe to new releases at [http://freshmeat.net/subscribe/38720/?url=%2Fprojects%2Fwesnoth%2F Freshmeat].&lt;br /&gt;
&lt;br /&gt;
===A new version is out, but where is the download for [Windows, Mac OS, etc.]?===&lt;br /&gt;
The downloads are NOT part of the official project.  The BFW team only releases the game's source code.  Binary executables or applications are always contributed by community volunteers.  If not for these volunteers, there would never be any downloads for us to enjoy.  The volunteers compile the game and upload it on their own time, and sometimes they cannot do this in a timely fashion (or at all, at times)  Although there are usual packagers designated for each operating system, there are times when other members of the community are asked to step in and contribute when the usual people cannot.&lt;br /&gt;
&lt;br /&gt;
Every time a new version is released, the usual volunteers are always notified by the project leaders.  '''Please refrain from making forum posts asking where your download is''' because it doesn't help anything - the packagers already know, and they will get to it as soon as they can.  In the past, the Windows and Mac communities have come together to produce home-grown unofficial builds for the community to use, and the renewed interest in community and learning how to compile is generally a good thing.&lt;br /&gt;
&lt;br /&gt;
===Why doesn't Wesnoth have my favorite feature?===&lt;br /&gt;
Because we are building this game for ourselves, to suit our own preferences. We're not building the game for you, in large part because this is our hobby, not our job; whether you like it or not is immaterial to us.&lt;br /&gt;
You may wonder, then, what the point is of soliciting ideas, as we do on the forum.  We, the developers, have certainly come up with many good ideas on our own, but our players often do as well, and generally ones we don't think of ourselves.  If a player comes up with an idea we like, we might implement it.  Not because they asked for it, but because of its own merits as an addition to our game.&lt;br /&gt;
&lt;br /&gt;
The beautiful thing about the license our game is distributed under, as compared to closed-source, commercial games, is that if you want that feature badly enough, you can take the code and art of our game and modify it yourself; you are free to re-use any work in Wesnoth, as long as you follow the rules of the [http://www.fsf.org/copyleft/gpl.html GPL].  From this, you can build a game exactly the way that you like. Just don't expect us to build that game for you.  Building this game is our hobby, not our profession, and you did not pay us to make it; rather, we are the ones who have paid for it, in time and labor.&lt;br /&gt;
&lt;br /&gt;
===Do you want help making this game? How can I help?===&lt;br /&gt;
Yes, we want your help. Whether you're a programmer, artist, musician, writer, translator, level designer, playtester, or just have some great suggestions, you're welcome to contribute. How?  You can:&lt;br /&gt;
* join the [http://www.wesnoth.org/wiki/Project Project]&lt;br /&gt;
* share your point of view at the [http://www.wesnoth.org/forum/ Forum]&lt;br /&gt;
* talk with us on [irc://irc.wesnoth.org/wesnoth IRC]&lt;br /&gt;
* report bugs you find at [[ReportingBugs]]&lt;br /&gt;
* update the wiki&lt;br /&gt;
* play against us via the Multiplayer menu&lt;br /&gt;
* vote for Wesnoth at your favorite gaming web site&lt;br /&gt;
* Spread the word!&lt;br /&gt;
&lt;br /&gt;
=== What are the system requirements? ===&lt;br /&gt;
&lt;br /&gt;
We are not completely certain, but an x86 running at 333MHz with 128MB RAM should be adequate.  Slower machines will have trouble scrolling large maps or processing AI turns with many units.  See the [http://www.wesnoth.org/forum/viewtopic.php?t=7384 forum thread] about minimum and recommended system requirements.&lt;br /&gt;
&lt;br /&gt;
=== I'm bored; how do I speed the game up? ===&lt;br /&gt;
&lt;br /&gt;
There are several preferences you can change to shorten the time that the AI takes to make its moves. &amp;quot;Accelerated Speed&amp;quot; will make units move and fight faster. &amp;quot;Skip AI Moves&amp;quot; will not show the AI's units moving from hex to hex. Finally, you can turn off all combat animations via the &amp;quot;Show Combat&amp;quot; option on the Advanced tab.&lt;br /&gt;
&lt;br /&gt;
=== My computer is too slow; how do I speed the game up? ===&lt;br /&gt;
&lt;br /&gt;
First, turn off the music and sound effects. Turning off the color cursors will make your cursor respond faster. If scrolling the map is slow, run the game in &amp;quot;Full Screen&amp;quot; mode, not in a window.  Turn off combat animations via the &amp;quot;Show Combat&amp;quot; option on the Advanced tab.  You can try turning off halos and combat results, but this might make gameplay more difficult.&lt;br /&gt;
&lt;br /&gt;
== Gameplay and Controls ==&lt;br /&gt;
&lt;br /&gt;
=== How do I learn to play? ===&lt;br /&gt;
&lt;br /&gt;
If you just want to jump right in, start the game and play the tutorial.  If you like reading documentation, see [[WesnothManual]], which is also distributed as a PDF file.  At any time while playing, you can select help from the menu button (or hit F1). The online help is quite extensive and provides information on terrains, weapons, traits, abilities, units and a good overview of how to play.&lt;br /&gt;
&lt;br /&gt;
=== My unit leveled up but didn't improve. What happened? ===&lt;br /&gt;
&lt;br /&gt;
This is called &amp;quot;After Maximum Level Advancement&amp;quot; or AMLA for short. While most level 0, 1, and 2 units can advance, some cannot.  However, some level 3 units can advance to level 4, or even 5. You can see whether a unit can advance further by right clicking and selecting &amp;quot;description.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
After a unit reaches the highest level it can get, every time it gains 100 experience it gains 3 hitpoints. It does not heal when this happens. This is a minor bonus so that experience gained by maxed out units is not altogether wasted. It is generally better to give experience to lower level units, rather than continue to advanced units that have reached their maximum level.&lt;br /&gt;
&lt;br /&gt;
If the unit in question is the Necrophage, this is not a bug.  The Necrophage eats the corpses of the dead, allowing it to periodically completely heal.  Leveling into itself is how this is carried out.&lt;br /&gt;
&lt;br /&gt;
=== I tried to trap an enemy with several weak units, but it still escaped. What happened? ===&lt;br /&gt;
&lt;br /&gt;
Most units exert a zone of control (or ZOC).  IF an enemy moves into one of the six adjacent hexes, the zone of control will prevent it from moving any farther.  However some weak units are level 0, meaning they are so weak that they do not have a ZOC. You can still surround an enemy unit entirely with level 0 units to keep it from escaping, but if there is any gap in your ranks, it could escape.&lt;br /&gt;
&lt;br /&gt;
Also, some units have the &amp;quot;skirmish&amp;quot; ability, which allows them to ignore ZOCs.&lt;br /&gt;
&lt;br /&gt;
=== How can I see where an enemy unit can move next turn? ===&lt;br /&gt;
&lt;br /&gt;
During you turn you can click on an enemy unit. Wesnoth will highlight all the hexes the unit can move to in the next turn. This is useful when trying to arrange your units to block an enemy's movement.&lt;br /&gt;
&lt;br /&gt;
=== There's too much luck in this game! ===&lt;br /&gt;
&lt;br /&gt;
Sooner or later, you will become frustrated when your archmage with four 70% attacks misses all four times.  This does not mean that the AI is cheating or the random number generator is futzed.  It means you are noticing random negative events more than positive ones.  During the development of the game, many mathematicians have done sophisticated statistical analysis of the combat system.  Likewise, programmers have examined the random number generator.  Wesnoth has been deliberately designed so that the streaks of &amp;quot;bad&amp;quot; and &amp;quot;good&amp;quot; luck are a part of the gameplay.&lt;br /&gt;
&lt;br /&gt;
Since Wesnoth is GPLed, it is possible that a new development team will someday &amp;quot;fork&amp;quot; the source and produce a version more like Heroes of Might &amp;amp; Magic, with no randomness.  Until then, don't charge with your horsemen against rock trolls at night...&lt;br /&gt;
&lt;br /&gt;
=== The (random unit) is overpowered/underpowered! ===&lt;br /&gt;
&lt;br /&gt;
The development team has spent years tweaking the units in the game.  Each unit has had its gold cost, attack types, combat damage, defensive values, resistances, upgrade paths, and other stats carefully scrutinized and loudly discussed in the forum.  However, the game code and the units were being modified right up until the 1.0 release, so some unbalanced units may have slipped through.&lt;br /&gt;
&lt;br /&gt;
If you have evidence to back up your claim, search the forum for past discussions about this unit, and then try posting.&lt;br /&gt;
&lt;br /&gt;
=== The (random scenario) is too hard/easy! ===&lt;br /&gt;
&lt;br /&gt;
See above answer about random units.&lt;br /&gt;
&lt;br /&gt;
=== What do the different difficulty levels do? ===&lt;br /&gt;
&lt;br /&gt;
That depends on the scenario. Usually, the opponent will get more money and be able to recruit higher-level units at higher difficulty levels, and you will have fewer turns available.&lt;br /&gt;
&lt;br /&gt;
== Maps, Scenarios and Campaigns ==&lt;br /&gt;
&lt;br /&gt;
=== How do I beat scenario _______ ? ===&lt;br /&gt;
&lt;br /&gt;
If you are stuck on a scenario in a campaign, you'll probably find a walkthrough at [[MainlineScenarios]].  Or check out the &amp;quot;Strategies and Tips&amp;quot; forum at http://www.wesnoth.org/forum/viewforum.php?f=3&lt;br /&gt;
&lt;br /&gt;
=== Are there any tools to help me create maps and scenarios? ===&lt;br /&gt;
Yes, there is a tool called wesnoth_editor. It is a normal map-editor that should be a good help for creating the plain maps. For creating the scenarios there already is a scenario-editor included in the mac build. But this editor is rather outdated and it exists only for MacOS X. At the moment some community members are working on creating a nice and working scenario editor. You can have a look at the [http://www.wesnoth.org/forum/viewtopic.php?t=6925 forum post] about this tool. You will also find more info at [[CampGen]].&lt;br /&gt;
&lt;br /&gt;
=== How do I download user campaigns? ===&lt;br /&gt;
Choose &amp;quot;Campaigns&amp;quot; in the main Wesnoth menu. Then scroll down to the bottom and choose &amp;quot;Get More Campaigns...&amp;quot; or since 1.1.5 there is a &amp;quot;Get add-ons&amp;quot; button in the main menu. This connects you to the campaign server. In the campaign server you can view a list of all available campaigns and download them, as well as posting or deleting your own campaigns.&lt;br /&gt;
&lt;br /&gt;
If you are behind a firewall you may not be able to connect to the campaign server.  In this case try to download the campaign directly from the campaign server through the web interface at http://campaigns.wesnoth.org.  If you know how to change your firewall settings, then you should open port 15003 (version 1.1.1 and up) or port 15002 (versions 1.1.0 and lower).  For added security, you can restrict traffic over those ports to the campaign server's IP address (currently 129.241.104.165).&lt;br /&gt;
&lt;br /&gt;
=== I already created a campaign and published it on the campaign server. How can I get translations for the campaign? ===&lt;br /&gt;
Just have a look at [[WesCamp]]. This project is the easiest way to get translations for your campaign. All the info you need you can find at [[WesCamp]].&lt;br /&gt;
&lt;br /&gt;
===How do I place an object or unit on my map with the map editor?===&lt;br /&gt;
You can't.  You need to make a multiplayer scenario file.  There are more details on the [[BuildingMaps|maps]] page.&lt;br /&gt;
&lt;br /&gt;
== Multiplayer ==&lt;br /&gt;
&lt;br /&gt;
===How do i connect to a multiplayer server, when i sit behind a restrictive Firewall?===&lt;br /&gt;
You have to open port 14999 to play multiplayer games over the internet.  For added security, you can restrict access to the server's IP address (currently 84.207.24.9 for the official server).&lt;br /&gt;
&lt;br /&gt;
===How to find players for multiplayer game?===&lt;br /&gt;
Hang around for a while on multiplayer servers and you might find someone to play with. If you observe other people playing you will get informed when someone joins the servers. Maybe you find someone willing to play in the irc channel dedicated to mp: #wesnoth-mp at irc.freenode.net.&lt;br /&gt;
You can also join #wesnoth at irc.freenode.net.&lt;br /&gt;
&lt;br /&gt;
===How can I make my computer into a dedicated Wesnoth server?===&lt;br /&gt;
&lt;br /&gt;
To setup a dedicated Wesnoth server, you have to compile the game with the &amp;quot;--enable-server&amp;quot; flag, and after you install, simply run wesnothd from the console.  This will start the server, listening on TCP port 15000.  To compile the server only you can use the flags &amp;quot;--disable-game --enable server&amp;quot;.  If you aren't using a linux or mac operating system, there are a few ways you can compile on Windows...here is one way http://www.wesnoth.org/wiki/CompilingWesnoth/CrossCompiling&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Which versions of Wesnoth can play together?===&lt;br /&gt;
&lt;br /&gt;
I'm on a MAC, and my friends are on XP. I would like to play together with them. Is this currently possible? &lt;br /&gt;
&lt;br /&gt;
YES! All you need is to have the same version number.&lt;br /&gt;
&lt;br /&gt;
For a list of Mac-XP-compatible games (including BfW) see: http://www.insidemacgames.com/forum/index.php?showtopic=21818&lt;br /&gt;
&lt;br /&gt;
== Translations ==&lt;br /&gt;
&lt;br /&gt;
===I selected an asian translation and am not able to see the letters correctly. What happened?===&lt;br /&gt;
&lt;br /&gt;
Since the size of the necessary fonts is too large, you'll need to download them separately (if you don't already have them). After that, simply copy the font to the '''fonts/''' directory in your wesnoth installation.&lt;br /&gt;
* Chinese font: [ftp://cle.linux.org.tw/pub/fonts/ttf/unicode/Arphic/gkai00mp.ttf gkai00mp.ttf]&lt;br /&gt;
* Japanese font: [http://cvs.sourceforge.jp/cgi-bin/viewcvs.cgi/sqs-xml/sqs-font/sazanami-gothic.ttf sazanami-gothic.ttf]&lt;br /&gt;
&lt;br /&gt;
If you have futher questions have a look at [[WesnothAsianLanguages|this]] page.&lt;br /&gt;
&lt;br /&gt;
== Other Questions You Have ==&lt;br /&gt;
&lt;br /&gt;
The best way to get answers to less-frequently asked questions is by visiting the [http://www.wesnoth.org/forum BFW forum].  There are plenty of people willing to help.  Make sure you read ALL of the forum sticky notes and announcements before posting.&lt;/div&gt;</summary>
		<author><name>Luther</name></author>
		
	</entry>
</feed>