<?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=Vanfans</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=Vanfans"/>
	<link rel="alternate" type="text/html" href="https://wiki.wesnoth.org/Special:Contributions/Vanfans"/>
	<updated>2026-04-05T21:23:25Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.31.16</generator>
	<entry>
		<id>https://wiki.wesnoth.org/index.php?title=WML_for_Complete_Beginners:_Chapter_1/zh-Hans&amp;diff=58272</id>
		<title>WML for Complete Beginners: Chapter 1/zh-Hans</title>
		<link rel="alternate" type="text/html" href="https://wiki.wesnoth.org/index.php?title=WML_for_Complete_Beginners:_Chapter_1/zh-Hans&amp;diff=58272"/>
		<updated>2017-03-18T11:22:36Z</updated>

		<summary type="html">&lt;p&gt;Vanfans: /* 基本组件：标签和属性 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{| {{Prettytable}}&lt;br /&gt;
|-&lt;br /&gt;
!|其他语言：&lt;br /&gt;
[[WML_for_Complete_Beginners:_Chapter_1|English]]&lt;br /&gt;
[[WML_for_Complete_Beginners:_Chapter_1/zh|简体中文]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==第1章：语法==&lt;br /&gt;
&lt;br /&gt;
首先让我们看看 WML 的''语法''。&lt;br /&gt;
&lt;br /&gt;
对于不了解语言“语法”的朋友，可以把它看作是编写 WML 的规则。这个概念有些混乱，但是，无论您是否意识到，您在日常生活中时时刻刻都在使用语法。比如句子“我喜欢果冻和奶酪三明治”。这句话就包含语法，语法让受众能听懂句子的含义。如果您说“喜欢奶酪我和三明治果冻”，这句话也就失去了意义，因为没人听得懂。&lt;br /&gt;
&lt;br /&gt;
就像英语的语法一样，WML 语法也需要字母、拼写、标点，这样才能让其他人理解您想表达什么。例如，如果您胡略语法，然后写出“一天玛丽和我有去看大象在动物园它是长”，那么大家不会明白您在写什么。但是如果您使用正确的语法：“某日，我和玛丽去动物园看到大象。它的鼻子真的很长”，这就很清楚了，因为这里用到了正确的语法。正如英国人无法理解使用错误语法写出的句子一样，韦诺之战也不会读取语法错误的脚本。&lt;br /&gt;
&lt;br /&gt;
所以我们先看一下 WML 的基本语法。稍后再来介绍更复杂的 WML 语法，但是这些足够您开始学习。&lt;br /&gt;
&lt;br /&gt;
===基本组件：标签和属性===&lt;br /&gt;
&lt;br /&gt;
WML，就像首字母表达的那样，这是一个“[https://zh.wikipedia.org/wiki/%E7%BD%AE%E6%A0%87%E8%AF%AD%E8%A8%80 标记语言]。”这表示整个语言的语法包含两个基本元素：'''tags'''和'''attributes'''。&lt;br /&gt;
====标签====&lt;br /&gt;
&lt;br /&gt;
:标签是由两个方括号扩起来的小写字符串，两端各一个。下面是“campaign”的标签示例：&lt;br /&gt;
&lt;br /&gt;
 [campaign]&lt;br /&gt;
&lt;br /&gt;
:标签只能包含字母和数字和下划线“_”。请注意前面提到的，“标签是''小写''字符串”。这是 WML 语法的基本：所有标签都用小写字母。如果您使用大写字母，WML 引擎会无法理解，并且发出错误。&lt;br /&gt;
&lt;br /&gt;
:和大部分标记语言一样，WML 的标签是成对出现的：一个开始标记和一个结束标记。就像一本书的封面和封底：打开一本书的封面表示开始，到达封底就意味着已经读完了这本书。同样，WML 引擎从开始标签开始。一直执行到结束标签。&lt;br /&gt;
&lt;br /&gt;
:结束标签除了和开始标签一样的关键字以外，还需要在方括号后面加入一个正斜杠“/”。正斜杠表示这个标签是结束标。下面是“campaign”标签的示例：&lt;br /&gt;
&lt;br /&gt;
 [/campaign]&lt;br /&gt;
&lt;br /&gt;
:开始标识和结束标识合起来称作'''标签集'''。标签集有两个标签：开始和结束。例如“campaign”标签集就像这个样子：&lt;br /&gt;
&lt;br /&gt;
 [campaign]&lt;br /&gt;
 [/campaign]&lt;br /&gt;
&lt;br /&gt;
:所以我们现在知道 WML 引擎如何判断开始和结束和书写它们时的语法。这些是 WML 标签的基本概念。之后我们再讨论更复杂的标签；现在请确保您了解这些概念。&lt;br /&gt;
&lt;br /&gt;
:在进入下个章节之前，我们回顾一下这个部分提到的有关标签的内容：&lt;br /&gt;
&lt;br /&gt;
::*标签是使用两个方括号括起来的小写字符串。&lt;br /&gt;
::*结束标签和起始标签相同，只是多了一个斜杠。&lt;br /&gt;
::*起始标签和结束标签一起称为“标签集”。&lt;br /&gt;
::*标签集只能由两个标签组成：起始和结束。&lt;br /&gt;
&lt;br /&gt;
:现在我们了解了起始、结束标签，下面该了解如何使用它们。&lt;br /&gt;
&lt;br /&gt;
====属性====&lt;br /&gt;
&lt;br /&gt;
:属性由两部分组成：''keys''和''values''，书写格式如下：&lt;br /&gt;
&lt;br /&gt;
 key=value&lt;br /&gt;
&lt;br /&gt;
:属性的功能是存储 WML 引擎需要的信息。属性的''key''说明存储什么样的信息，属性的''value''是存储的实际数据。等号左侧的文本作为键，右侧作为值。&lt;br /&gt;
&lt;br /&gt;
:这听起来有些乱，举个实际的例子来说明：&lt;br /&gt;
&lt;br /&gt;
:您想让您的朋友去杂货店买一块面包。您会直接对他说“去”吗？不会，这样他不会明白您让他做什么，您也不会有面包吃。同样，如果您只写一个标签集，等同于告诉 WML 引擎做什么，但是这还不够。如果您的朋友是个 WML 引擎，您让他去杂货店买面包，您可以给他这样的代码（''注意''：这不是真正的 WML 代码，这是教程中使用的伪代码）。&lt;br /&gt;
&lt;br /&gt;
 [go]&lt;br /&gt;
     where=grocery_store&lt;br /&gt;
     get=bread&lt;br /&gt;
 [/go]&lt;br /&gt;
&lt;br /&gt;
:标签告诉 WML 引擎做什么（类似让您的朋友“去”），但是没有属性来指定要做什么（比如告诉朋友什么时候去哪里），如果没有具体的信息，WML 引擎不会做任何事情。如果您让您的朋友“去”，他什么都不会做，因为不知道去哪里做什么。&lt;br /&gt;
&lt;br /&gt;
:*'''Keys'''&lt;br /&gt;
&lt;br /&gt;
::键是小写字母字符串，他告诉游戏处理的是什么信息。键是区分大小写的（虽然不能使用大写），需要正确拼写。&lt;br /&gt;
&lt;br /&gt;
:*'''Values'''&lt;br /&gt;
&lt;br /&gt;
::WML 的键只会处理一个类型的数据，也就是''字符串''。字符串是 ASCII 字符序列，包括键盘上的任何字符。字符串分成两类：标准和数字。&lt;br /&gt;
&lt;br /&gt;
::'''1. Standard Strings'''&lt;br /&gt;
&lt;br /&gt;
::A standard string is simply a sequence of ASCII characters that is neither a numerical nor a translatable string. For example, this is a standard string:&lt;br /&gt;
 x&lt;br /&gt;
::as is this:&lt;br /&gt;
 blue&lt;br /&gt;
&lt;br /&gt;
::If a standard string includes whitespaces, it must be enclosed within double quotes:&lt;br /&gt;
 &amp;quot;Everything in these double quotes is a single string. This is the number one: 1. Hooray! :) We are now coming to the end of this string.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
::Everything within the double quotes (including the colon and parenthesis emoticon) is considered to one long string by the game.&lt;br /&gt;
&lt;br /&gt;
::Sometimes you will want to mark a standard string as translatable so that it can be translated into other languages. The only difference between a translatable sting and a non-translatable is that translatable strings are marked so that translators know that they need to translate that string, and non-translatable strings are not marked, so the translators know that they don't translate those strings.&lt;br /&gt;
&lt;br /&gt;
::To mark a string as translatable, all you have to do is add an underscore before the first double quote that marks the beginning of the string. Example of a translatable string:&lt;br /&gt;
&lt;br /&gt;
  _ &amp;quot;This is a translatable string.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
::If the WML engine does not find an underscore in front of the string, it will assume the string is non-translatable.&lt;br /&gt;
&lt;br /&gt;
::Although not strictly necessary, it is generally considered a good practice to include a space before and after the underscore that marks a string as translatable. For instance, if we were to assign the translatable string &amp;quot;Hello World!&amp;quot; to this key, it would be considered good syntax to write&lt;br /&gt;
 key= _ &amp;quot;Hello World!&amp;quot;&lt;br /&gt;
::rather than&lt;br /&gt;
 key=_&amp;quot;Hello World!&amp;quot;&lt;br /&gt;
::However, the game considers both of the above strings to be equivalent, and will therefore recognize both as translatable strings. Adding whitespaces just allows for better human readability in your WML code.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
::'''2. Numerical Strings'''&lt;br /&gt;
&lt;br /&gt;
::Unsurprisingly, numerical strings are strings that contain only numbers, decimal points, or minus signs &amp;quot;-&amp;quot;. If a string contains anything other than numbers, decimal points and/or a minus sign, the string becomes a standard string instead of a numerical one. Numerical strings can be either a single numeric character like this:&lt;br /&gt;
 2&lt;br /&gt;
::a sequence of numeric characters, like this:&lt;br /&gt;
 230001&lt;br /&gt;
&lt;br /&gt;
::or floating-point values (that's just a fancy way of saying that they can contain decimal points), like these two examples:&lt;br /&gt;
 2.6&lt;br /&gt;
 395667.49382345&lt;br /&gt;
&lt;br /&gt;
::or negative numbers, like these examples:&lt;br /&gt;
 -49&lt;br /&gt;
 -594.932&lt;br /&gt;
&lt;br /&gt;
::For all intents and purposes, you can treat numerical strings just as you would numbers in real life. You can add, divide, and otherwise mathematically employ them in mathematical computations (we'll go over this in-depth in chapter [FIXME HERE]). Just remember that if you include any characters other than numbers, decimal points, or minus signs, the string will cease to be a numeric string and will become a standard string, which means you won't be able to use it in mathematical calculations.&lt;br /&gt;
&lt;br /&gt;
::Directory paths are simply special strings that tell the game where to find a specific file or folder. Here is an example of a directory path:&lt;br /&gt;
 {data/add-ons/my_first_campaign}&lt;br /&gt;
This directory path tells the game where the folder &amp;quot;my_first_campaign&amp;quot; is located.&lt;br /&gt;
&lt;br /&gt;
===More About Tags===&lt;br /&gt;
&lt;br /&gt;
So now you should understand the basics about tags and attributes. As I promised earlier, we will now discuss some of the more involved aspects of tags.&lt;br /&gt;
&lt;br /&gt;
====Nested Tags: Parents and Children====&lt;br /&gt;
&lt;br /&gt;
:A fundamental aspect of markup languages is that you can use tagsets inside other tagsets. Tagsets located inside other tagsets are called nested tagsets. In the example below, the &amp;quot;side&amp;quot; tagset is nested inside the &amp;quot;scenario&amp;quot; tagset:&lt;br /&gt;
&lt;br /&gt;
 [scenario]&lt;br /&gt;
     [side]&lt;br /&gt;
     [/side]&lt;br /&gt;
 [/scenario]&lt;br /&gt;
&lt;br /&gt;
:When referring to nested tagsets, the tagset located inside the other is called the ''child'' tagset, and the tagset that encloses the child tagset is known ast he ''parent'' tagset. To illustrate with pseudocode:&lt;br /&gt;
&lt;br /&gt;
 [parent]&lt;br /&gt;
     [child]&lt;br /&gt;
     [/child]&lt;br /&gt;
 [/parent]&lt;br /&gt;
&lt;br /&gt;
:Tagsets that are not child tagsets of any other tagsets are called ''toplevel'' tagsets. In this next example, the [scenario] tagset is a toplevel tagset, because it is not the child tagset of any other tagset. The  [event] tagset is the child tagset of [scenario], because it is located inside the [scenario] tagset. The tagset [event] is also the parent tagset of the [message] tagset, because the [message] tagset is located inside the [event] tagset. That means that since [event] is the parent of [message], [message] is the child tagset of [event].&lt;br /&gt;
&lt;br /&gt;
 [scenario]&lt;br /&gt;
     [event]&lt;br /&gt;
         [message]&lt;br /&gt;
         [/message]&lt;br /&gt;
     [/event]&lt;br /&gt;
 [/scenario]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Indentation and Levels====&lt;br /&gt;
&lt;br /&gt;
:You may have noticed that in the examples above, the child tagsets are indented four spaces further to the right than are their parent tagsets. Why is this? It's because proper indentation (although not technically required by the WML engine) makes you code a lot easier to read and maintain. It's like writing an outline for a school paper, where you would write something like this:&lt;br /&gt;
&lt;br /&gt;
 I.&lt;br /&gt;
     A.&lt;br /&gt;
     B.&lt;br /&gt;
     C.&lt;br /&gt;
 II.&lt;br /&gt;
     A.&lt;br /&gt;
         1.&lt;br /&gt;
         2.&lt;br /&gt;
     B.&lt;br /&gt;
     C.&lt;br /&gt;
&lt;br /&gt;
:Indentation makes it much easier to see whether tagset is the child or parent of other tagsets. The amount of indentation before a tagset determines in what level that tagset is located. If the tagset is a toplevel tagset (i.e. has no spaces in front of it because it is not the child of any other tagset), that tagset is located at level one. Tagsets with an indentation of four spaces in front of them are located in level 2, because they are the children of the toplevel (level 1) tagset. Tagsets that are children of level 2 tagsets are called level 3 tagsets (and are indented 8 spaces), tagsets inside level 3 tagsets are called level 4 tagsets (and are indented 12 spaces), etc. As a general rule, all the attributes of a tagset, along with any child tagsets of that tagset, are indented one level deeper than that tagset. To illustrate in pseudocode:&lt;br /&gt;
&lt;br /&gt;
 [toplevel_tagset]&lt;br /&gt;
     level_2_attribute=value&lt;br /&gt;
     [level_2_tagset]&lt;br /&gt;
         level_3_attribute=value&lt;br /&gt;
         [level 3 tagset]&lt;br /&gt;
             level_4_attribute=value&lt;br /&gt;
         [/level 3 tagset]&lt;br /&gt;
     [/level_2_tagset]&lt;br /&gt;
 [/toplevel_tagset]&lt;br /&gt;
&lt;br /&gt;
:Indenting tagsets and attributes into levels like this makes it much easier for you (and others) to read, fix and maintain your code. It is strongly recommended that you indent exactly four spaces for each new level, although you can also use tabs instead of hitting the space key 4 times, if you'd prefer.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;注意：&amp;lt;/b&amp;gt;本文翻译质量不佳&lt;br /&gt;
&lt;br /&gt;
Next Chapter:&lt;br /&gt;
[[WML for Complete Beginners: Chapter 2]]&lt;br /&gt;
&lt;br /&gt;
Return to introduction:&lt;br /&gt;
[[WML for Complete Beginners: Introduction]]&lt;br /&gt;
&lt;br /&gt;
Return to Main Index:&lt;br /&gt;
[[WML for Complete Beginners]]&lt;br /&gt;
&lt;br /&gt;
[[Category:WML_for_Complete_Beginners]]&lt;/div&gt;</summary>
		<author><name>Vanfans</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.wesnoth.org/index.php?title=WML_for_Complete_Beginners:_Chapter_1/zh-Hans&amp;diff=58262</id>
		<title>WML for Complete Beginners: Chapter 1/zh-Hans</title>
		<link rel="alternate" type="text/html" href="https://wiki.wesnoth.org/index.php?title=WML_for_Complete_Beginners:_Chapter_1/zh-Hans&amp;diff=58262"/>
		<updated>2017-03-16T20:07:38Z</updated>

		<summary type="html">&lt;p&gt;Vanfans: Created page with &amp;quot;{| {{Prettytable}} |- !|其他语言： English 简体中文 |}  ==第1章：语法==...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{| {{Prettytable}}&lt;br /&gt;
|-&lt;br /&gt;
!|其他语言：&lt;br /&gt;
[[WML_for_Complete_Beginners:_Chapter_1|English]]&lt;br /&gt;
[[WML_for_Complete_Beginners:_Chapter_1/zh|简体中文]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==第1章：语法==&lt;br /&gt;
&lt;br /&gt;
首先让我们看看 WML 的''语法''。&lt;br /&gt;
&lt;br /&gt;
对于不了解语言“语法”的朋友，可以把它看作是编写 WML 的规则。这个概念有些混乱，但是，无论您是否意识到，您在日常生活中时时刻刻都在使用语法。比如句子“我喜欢果冻和奶酪三明治”。这句话就包含语法，语法让受众能听懂句子的含义。如果您说“喜欢奶酪我和三明治果冻”，这句话也就失去了意义，因为没人听得懂。&lt;br /&gt;
&lt;br /&gt;
就像英语的语法一样，WML 语法也需要字母、拼写、标点，这样才能让其他人理解您想表达什么。例如，如果您胡略语法，然后写出“一天玛丽和我有去看大象在动物园它是长”，那么大家不会明白您在写什么。但是如果您使用正确的语法：“某日，我和玛丽去动物园看到大象。它的鼻子真的很长”，这就很清楚了，因为这里用到了正确的语法。正如英国人无法理解使用错误语法写出的句子一样，韦诺之战也不会读取语法错误的脚本。&lt;br /&gt;
&lt;br /&gt;
所以我们先看一下 WML 的基本语法。稍后再来介绍更复杂的 WML 语法，但是这些足够您开始学习。&lt;br /&gt;
&lt;br /&gt;
===基本组件：标签和属性===&lt;br /&gt;
&lt;br /&gt;
WML，就像首字母表达的那样，这是一个“[https://zh.wikipedia.org/wiki/%E7%BD%AE%E6%A0%87%E8%AF%AD%E8%A8%80 标记语言]。”这表示整个语言的语法包含两个基本元素：'''tags'''和'''attributes'''。&lt;br /&gt;
====标签====&lt;br /&gt;
&lt;br /&gt;
:标签是由两个方括号扩起来的小写字符串，两端各一个。下面是“campaign”的标签示例：&lt;br /&gt;
&lt;br /&gt;
 [campaign]&lt;br /&gt;
&lt;br /&gt;
:标签只能包含字母和数字和下划线“_”。请注意前面提到的，“标签是''小写''字符串”。这是 WML 语法的基本：所有标签都用小写字母。如果您使用大写字母，WML 引擎会无法理解，并且发出错误。&lt;br /&gt;
&lt;br /&gt;
:和大部分标记语言一样，WML 的标签是成对出现的：一个开始标记和一个结束标记。就像一本书的封面和封底：打开一本书的封面表示开始，到达封底就意味着已经读完了这本书。同样，WML 引擎从开始标签开始。一直执行到结束标签。&lt;br /&gt;
&lt;br /&gt;
:结束标签除了和开始标签一样的关键字以外，还需要在方括号后面加入一个正斜杠“/”。正斜杠表示这个标签是结束标。下面是“campaign”标签的示例：&lt;br /&gt;
&lt;br /&gt;
 [/campaign]&lt;br /&gt;
&lt;br /&gt;
:The opening and closing tag together are referred to as a '''tagset'''. A tagset always contains exactly two tags: the opening tag and the closing tag. For example, the &amp;quot;campaign&amp;quot; tagset would look like this:&lt;br /&gt;
 [campaign]&lt;br /&gt;
 [/campaign]&lt;br /&gt;
&lt;br /&gt;
:所以我们现在知道 WML 引擎如何判断开始和结束。这些是 WML 标签的基本概念。之后我们再讨论更复杂的标签；现在请确保您了解这些概念。&lt;br /&gt;
&lt;br /&gt;
:在进入下个章节之前，我们回顾一下这个部分提到的有关标签的内容：&lt;br /&gt;
&lt;br /&gt;
::*标签是使用两个方括号括起来的小写字符串。&lt;br /&gt;
::*结束标签和起始标签相同，只是多了一个斜杠。&lt;br /&gt;
::*起始标签和结束标签一起称为“标签集”。&lt;br /&gt;
::*标签集只能由两个标签组成：起始和结束。&lt;br /&gt;
&lt;br /&gt;
:现在我们了解了起始、结束标签，下面该了解如何使用它们。&lt;br /&gt;
&lt;br /&gt;
====属性====&lt;br /&gt;
&lt;br /&gt;
:属性由两部分组成：''keys''和''values''，书写格式如下：&lt;br /&gt;
&lt;br /&gt;
 key=value&lt;br /&gt;
&lt;br /&gt;
:属性的功能是存储 WML 引擎需要的信息。属性的''key''说明存储什么样的信息，属性的''value''是存储的实际数据。等号左侧的文本作为键，右侧作为值。&lt;br /&gt;
&lt;br /&gt;
:这听起来有些乱，举个实际的例子来说明：&lt;br /&gt;
&lt;br /&gt;
:您想让您的朋友去杂货店买一块面包。您会直接对他说“去”吗？不会，这样他不会明白您让他做什么，您也不会有面包吃。同样，如果您只写一个标签集，等同于告诉 WML 引擎做什么，但是这还不够。如果您的朋友是个 WML 引擎，您让他去杂货店买面包，您可以给他这样的代码（''注意''：这不是真正的 WML 代码，这是教程中使用的伪代码）。&lt;br /&gt;
&lt;br /&gt;
 [go]&lt;br /&gt;
     where=grocery_store&lt;br /&gt;
     get=bread&lt;br /&gt;
 [/go]&lt;br /&gt;
&lt;br /&gt;
:标签告诉 WML 引擎做什么（类似让您的朋友“去”），但是没有属性来指定要做什么（比如告诉朋友什么时候去哪里），如果没有具体的信息，WML 引擎不会做任何事情。如果您让您的朋友“去”，他什么都不会做，因为不知道去哪里做什么。&lt;br /&gt;
&lt;br /&gt;
:*'''Keys'''&lt;br /&gt;
&lt;br /&gt;
::键是小写字母字符串，他告诉游戏处理的是什么信息。键是区分大小写的（虽然不能使用大写），需要正确拼写。&lt;br /&gt;
&lt;br /&gt;
:*'''Values'''&lt;br /&gt;
&lt;br /&gt;
::WML 的键只会处理一个类型的数据，也就是''字符串''。字符串是 ASCII 字符序列，包括键盘上的任何字符。字符串分成两类：标准和数字。&lt;br /&gt;
&lt;br /&gt;
::'''1. Standard Strings'''&lt;br /&gt;
&lt;br /&gt;
::A standard string is simply a sequence of ASCII characters that is neither a numerical nor a translatable string. For example, this is a standard string:&lt;br /&gt;
 x&lt;br /&gt;
::as is this:&lt;br /&gt;
 blue&lt;br /&gt;
&lt;br /&gt;
::If a standard string includes whitespaces, it must be enclosed within double quotes:&lt;br /&gt;
 &amp;quot;Everything in these double quotes is a single string. This is the number one: 1. Hooray! :) We are now coming to the end of this string.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
::Everything within the double quotes (including the colon and parenthesis emoticon) is considered to one long string by the game.&lt;br /&gt;
&lt;br /&gt;
::Sometimes you will want to mark a standard string as translatable so that it can be translated into other languages. The only difference between a translatable sting and a non-translatable is that translatable strings are marked so that translators know that they need to translate that string, and non-translatable strings are not marked, so the translators know that they don't translate those strings.&lt;br /&gt;
&lt;br /&gt;
::To mark a string as translatable, all you have to do is add an underscore before the first double quote that marks the beginning of the string. Example of a translatable string:&lt;br /&gt;
&lt;br /&gt;
  _ &amp;quot;This is a translatable string.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
::If the WML engine does not find an underscore in front of the string, it will assume the string is non-translatable.&lt;br /&gt;
&lt;br /&gt;
::Although not strictly necessary, it is generally considered a good practice to include a space before and after the underscore that marks a string as translatable. For instance, if we were to assign the translatable string &amp;quot;Hello World!&amp;quot; to this key, it would be considered good syntax to write&lt;br /&gt;
 key= _ &amp;quot;Hello World!&amp;quot;&lt;br /&gt;
::rather than&lt;br /&gt;
 key=_&amp;quot;Hello World!&amp;quot;&lt;br /&gt;
::However, the game considers both of the above strings to be equivalent, and will therefore recognize both as translatable strings. Adding whitespaces just allows for better human readability in your WML code.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
::'''2. Numerical Strings'''&lt;br /&gt;
&lt;br /&gt;
::Unsurprisingly, numerical strings are strings that contain only numbers, decimal points, or minus signs &amp;quot;-&amp;quot;. If a string contains anything other than numbers, decimal points and/or a minus sign, the string becomes a standard string instead of a numerical one. Numerical strings can be either a single numeric character like this:&lt;br /&gt;
 2&lt;br /&gt;
::a sequence of numeric characters, like this:&lt;br /&gt;
 230001&lt;br /&gt;
&lt;br /&gt;
::or floating-point values (that's just a fancy way of saying that they can contain decimal points), like these two examples:&lt;br /&gt;
 2.6&lt;br /&gt;
 395667.49382345&lt;br /&gt;
&lt;br /&gt;
::or negative numbers, like these examples:&lt;br /&gt;
 -49&lt;br /&gt;
 -594.932&lt;br /&gt;
&lt;br /&gt;
::For all intents and purposes, you can treat numerical strings just as you would numbers in real life. You can add, divide, and otherwise mathematically employ them in mathematical computations (we'll go over this in-depth in chapter [FIXME HERE]). Just remember that if you include any characters other than numbers, decimal points, or minus signs, the string will cease to be a numeric string and will become a standard string, which means you won't be able to use it in mathematical calculations.&lt;br /&gt;
&lt;br /&gt;
::Directory paths are simply special strings that tell the game where to find a specific file or folder. Here is an example of a directory path:&lt;br /&gt;
 {data/add-ons/my_first_campaign}&lt;br /&gt;
This directory path tells the game where the folder &amp;quot;my_first_campaign&amp;quot; is located.&lt;br /&gt;
&lt;br /&gt;
===More About Tags===&lt;br /&gt;
&lt;br /&gt;
So now you should understand the basics about tags and attributes. As I promised earlier, we will now discuss some of the more involved aspects of tags.&lt;br /&gt;
&lt;br /&gt;
====Nested Tags: Parents and Children====&lt;br /&gt;
&lt;br /&gt;
:A fundamental aspect of markup languages is that you can use tagsets inside other tagsets. Tagsets located inside other tagsets are called nested tagsets. In the example below, the &amp;quot;side&amp;quot; tagset is nested inside the &amp;quot;scenario&amp;quot; tagset:&lt;br /&gt;
&lt;br /&gt;
 [scenario]&lt;br /&gt;
     [side]&lt;br /&gt;
     [/side]&lt;br /&gt;
 [/scenario]&lt;br /&gt;
&lt;br /&gt;
:When referring to nested tagsets, the tagset located inside the other is called the ''child'' tagset, and the tagset that encloses the child tagset is known ast he ''parent'' tagset. To illustrate with pseudocode:&lt;br /&gt;
&lt;br /&gt;
 [parent]&lt;br /&gt;
     [child]&lt;br /&gt;
     [/child]&lt;br /&gt;
 [/parent]&lt;br /&gt;
&lt;br /&gt;
:Tagsets that are not child tagsets of any other tagsets are called ''toplevel'' tagsets. In this next example, the [scenario] tagset is a toplevel tagset, because it is not the child tagset of any other tagset. The  [event] tagset is the child tagset of [scenario], because it is located inside the [scenario] tagset. The tagset [event] is also the parent tagset of the [message] tagset, because the [message] tagset is located inside the [event] tagset. That means that since [event] is the parent of [message], [message] is the child tagset of [event].&lt;br /&gt;
&lt;br /&gt;
 [scenario]&lt;br /&gt;
     [event]&lt;br /&gt;
         [message]&lt;br /&gt;
         [/message]&lt;br /&gt;
     [/event]&lt;br /&gt;
 [/scenario]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Indentation and Levels====&lt;br /&gt;
&lt;br /&gt;
:You may have noticed that in the examples above, the child tagsets are indented four spaces further to the right than are their parent tagsets. Why is this? It's because proper indentation (although not technically required by the WML engine) makes you code a lot easier to read and maintain. It's like writing an outline for a school paper, where you would write something like this:&lt;br /&gt;
&lt;br /&gt;
 I.&lt;br /&gt;
     A.&lt;br /&gt;
     B.&lt;br /&gt;
     C.&lt;br /&gt;
 II.&lt;br /&gt;
     A.&lt;br /&gt;
         1.&lt;br /&gt;
         2.&lt;br /&gt;
     B.&lt;br /&gt;
     C.&lt;br /&gt;
&lt;br /&gt;
:Indentation makes it much easier to see whether tagset is the child or parent of other tagsets. The amount of indentation before a tagset determines in what level that tagset is located. If the tagset is a toplevel tagset (i.e. has no spaces in front of it because it is not the child of any other tagset), that tagset is located at level one. Tagsets with an indentation of four spaces in front of them are located in level 2, because they are the children of the toplevel (level 1) tagset. Tagsets that are children of level 2 tagsets are called level 3 tagsets (and are indented 8 spaces), tagsets inside level 3 tagsets are called level 4 tagsets (and are indented 12 spaces), etc. As a general rule, all the attributes of a tagset, along with any child tagsets of that tagset, are indented one level deeper than that tagset. To illustrate in pseudocode:&lt;br /&gt;
&lt;br /&gt;
 [toplevel_tagset]&lt;br /&gt;
     level_2_attribute=value&lt;br /&gt;
     [level_2_tagset]&lt;br /&gt;
         level_3_attribute=value&lt;br /&gt;
         [level 3 tagset]&lt;br /&gt;
             level_4_attribute=value&lt;br /&gt;
         [/level 3 tagset]&lt;br /&gt;
     [/level_2_tagset]&lt;br /&gt;
 [/toplevel_tagset]&lt;br /&gt;
&lt;br /&gt;
:Indenting tagsets and attributes into levels like this makes it much easier for you (and others) to read, fix and maintain your code. It is strongly recommended that you indent exactly four spaces for each new level, although you can also use tabs instead of hitting the space key 4 times, if you'd prefer.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;注意：&amp;lt;/b&amp;gt;本文翻译质量不佳&lt;br /&gt;
&lt;br /&gt;
Next Chapter:&lt;br /&gt;
[[WML for Complete Beginners: Chapter 2]]&lt;br /&gt;
&lt;br /&gt;
Return to introduction:&lt;br /&gt;
[[WML for Complete Beginners: Introduction]]&lt;br /&gt;
&lt;br /&gt;
Return to Main Index:&lt;br /&gt;
[[WML for Complete Beginners]]&lt;br /&gt;
&lt;br /&gt;
[[Category:WML_for_Complete_Beginners]]&lt;/div&gt;</summary>
		<author><name>Vanfans</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.wesnoth.org/index.php?title=WML_for_Complete_Beginners:_Chapter_1&amp;diff=58261</id>
		<title>WML for Complete Beginners: Chapter 1</title>
		<link rel="alternate" type="text/html" href="https://wiki.wesnoth.org/index.php?title=WML_for_Complete_Beginners:_Chapter_1&amp;diff=58261"/>
		<updated>2017-03-16T19:29:01Z</updated>

		<summary type="html">&lt;p&gt;Vanfans: /* Chapter 1: Syntax */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{| {{Prettytable}}&lt;br /&gt;
|-&lt;br /&gt;
!|其他语言：&lt;br /&gt;
[[WML_for_Complete_Beginners:_Chapter_1|English]]&lt;br /&gt;
[[WML_for_Complete_Beginners:_Chapter_1/zh|简体中文]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Chapter 1: Syntax==&lt;br /&gt;
&lt;br /&gt;
First things first; let's go over the ''syntax'' of WML.&lt;br /&gt;
&lt;br /&gt;
For those of you who might not know what the &amp;quot;syntax&amp;quot; of a language is, think of it as a set of rules for how WML needs to be written in order for the game to understand it. This concept may sound a bit confusing, but whether you realize it or not you have been using the concept of syntax your entire life! Think of the structure of a sentence in English: &amp;quot;I like jelly and cheese sandwiches.&amp;quot; That sentence uses a certain set of rules, or ''syntax'' in order to make sense to people who hear or read it. If you said instead, &amp;quot;Like cheese I and sandwiches jelly&amp;quot;, that would make no sense, and no one would understand what you were saying. Likewise, if you said &amp;quot;I like cheese sandwiches and jelly&amp;quot;, that would change the entire meaning of the sentence! &lt;br /&gt;
&lt;br /&gt;
Just like the syntax of the English language, WML syntax also requires proper capitalization, spelling, grammar and punctuation in order for others to understand what you're saying or writing. For example, if you decided to ignore the syntax of the English language and wrote something like this: &amp;quot;won day mary and i had went to seen the elefant at the zoo it's trunc was reely long&amp;quot;, chances are people would not understand much of what you wrote. On the other hand, if you used the correct syntax and wrote: &amp;quot;One day Mary and I went to see the elephant at the zoo. Its trunk was really long!&amp;quot;, people can easily understand what you wrote because it is written in the syntax they recognize and understand. Just as English-reading people would be unable to understand something were it not written in the correct English syntax, the Battle for Wesnoth game is unable to read any WML that is not written in the correct WML syntax.&lt;br /&gt;
&lt;br /&gt;
So now let's go over the basics of WML syntax. Later on you will be gradually introduced to more complex WML syntax, but for now we'll just go over the basic stuff, enough to get you started.&lt;br /&gt;
&lt;br /&gt;
===Basic Components: Tags and Attributes===&lt;br /&gt;
&lt;br /&gt;
WML, as one can infer from the meaning of the acronym, is a &amp;quot;[http://en.wikipedia.org/wiki/Markup_language markup language].&amp;quot; This means that the syntax of the entire language consists of two fundamental elements: '''tags''' and '''attributes'''.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Tags====&lt;br /&gt;
:A tag is a string of lowercase text encapsulated by two square brackets, one at either end. This is an example of a &amp;quot;campaign&amp;quot; tag:&lt;br /&gt;
 [campaign]&lt;br /&gt;
&lt;br /&gt;
:Tags can only contain alphanumeric characters (letters and numbers) and underscores &amp;quot;_&amp;quot;. Notice I said earlier that &amp;quot;a tag is a string of ''lowercase'' text&amp;quot;. This is a fundamental aspect of the WML syntax: all tags are always written in lowercase letters. If you try using capital letters (even just one), the WML engine won't be able to understand what tag you're trying to use and will give you an error when it tries to read the incorrect tag. &lt;br /&gt;
&lt;br /&gt;
:As with most markup languages, in WML tags are always used in pairs: one opening tag and one closing tag. Think of the opening tag and the closing tag like the covers of a book: when you open the front cover, you know you're at the beginning. When you reach the back cover, you know you're done reading the book. Likewise, when the WML engine finds an opening tag, it realizes it's at the beginning of a task. When it reaches the closing tag, it realizes it has finished the task.&lt;br /&gt;
&lt;br /&gt;
:Closing tags are exactly the same as opening tags except for one key component: closing tags always have a forward slash &amp;quot;/&amp;quot; immediately after the first square bracket. This forward slash tells the WML engine that this tag is a closing tag and not another opening tag. Here is an example of the closing &amp;quot;campaign&amp;quot; tag:&lt;br /&gt;
 [/campaign]&lt;br /&gt;
&lt;br /&gt;
:The opening and closing tag together are referred to as a '''tagset'''. A tagset always contains exactly two tags: the opening tag and the closing tag. For example, the &amp;quot;campaign&amp;quot; tagset would look like this:&lt;br /&gt;
 [campaign]&lt;br /&gt;
 [/campaign]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
:So now we know how the WML engine knows where the beginning and end of a task are, and what syntax to use when writing them. These are the basics of tags in WML. Later on we'll go over the more complicated aspects of tags; for now though, make sure you understand the concepts introduced here. &lt;br /&gt;
&lt;br /&gt;
:Before we move on to the next section, let's review the points we've learned in this section about tags:&lt;br /&gt;
::*A tag is a string of lowercase text encapsulated by two square brackets, one at either end.&lt;br /&gt;
::*A closing tag is exactly the same as an opening tag, except a closing tag has a forward slash immediately following the first square bracket.&lt;br /&gt;
::*The opening tag and the closing tag together are called a &amp;quot;tagset&amp;quot;.&lt;br /&gt;
::*A tagset can only ever consist of exactly two tags: the opening tag and the closing tag.&lt;br /&gt;
&lt;br /&gt;
:Now we know how to tell the WML engine where the beginning and the end of a task are, but what about actually making it do the task? This is where attributes come in.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Attributes====&lt;br /&gt;
&lt;br /&gt;
:Attributes consist of two principal elements: ''keys'' and ''values'', and are written like so:&lt;br /&gt;
 key=value&lt;br /&gt;
&lt;br /&gt;
:The basic function of attributes is to store information that is needed by the WML engine. The ''key'' of the attribute specifies what kind of information is stored, and the ''value'' of the attribute is the actual data that is stored. All text to the left of the equals sign &amp;quot;=&amp;quot; is considered to be the key, and all text to the right of the equals sign is considered to be the value of the key.&lt;br /&gt;
&lt;br /&gt;
:This may sound rather confusing, so let's illustrate by a practical example:&lt;br /&gt;
&lt;br /&gt;
:Let's say you wanted your friend to go to the grocery store and pick you up a loaf of bread. Would you just say to him, &amp;quot;Go&amp;quot;? Of course not! He wouldn't understand what you wanted him to do, which means you'd have no bread for dinner. Likewise, if you only write a tagset, that's equivalent to telling the WML engine to &amp;quot;do&amp;quot;, but that's not enough. You will need to be more specific about exactly what the WML engine should do. If your friend were a human WML engine and you wanted him to go to the grocery store to get some bread, you might give him this code to read (''note'': this code isn't actually real WML, it is &amp;quot;pseudocode&amp;quot;, i.e. made up code for the purpose of illustration. If I ever use pseudocode during this tutorial I will tell you that it is pseudocode before you read the example, like I am doing now.):&lt;br /&gt;
 [go]&lt;br /&gt;
     where=grocery_store&lt;br /&gt;
     get=bread&lt;br /&gt;
 [/go]&lt;br /&gt;
&lt;br /&gt;
:Tags tell the WML engine what to do generally (like telling your friend to &amp;quot;go&amp;quot;), but without attributes to specify ''exactly'' what to do (like telling your friend where and when to go, and what to do when he gets there), the WML engine won't be able to do anything because you haven't given it enough specific information. If you told your friend, &amp;quot;Go,&amp;quot; he'd understand that you want him to go somewhere, but he'd be unable to actually perform the task because he doesn't know ''where'' to go or what to do when he gets there.&lt;br /&gt;
&lt;br /&gt;
:*'''Keys'''&lt;br /&gt;
::Keys are sequences of lowercase alphabetic characters that tell the game what kind of information it is dealing with when it reads the attribute. Keys are case-sensetive (i.e., you can't use capital letters) and must be spelled correctly.&lt;br /&gt;
&lt;br /&gt;
:*'''Values'''&lt;br /&gt;
&lt;br /&gt;
::WML keys deal with one and only one type of data, called ''strings''. A string is simply a sequence of ASCII characters that can include pretty much any character on your keyboard. Strings may be divided into two categories: Standard and Numerical.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
::'''1. Standard Strings'''&lt;br /&gt;
&lt;br /&gt;
::A standard string is simply a sequence of ASCII characters that is neither a numerical nor a translatable string. For example, this is a standard string:&lt;br /&gt;
 x&lt;br /&gt;
::as is this:&lt;br /&gt;
 blue&lt;br /&gt;
&lt;br /&gt;
::If a standard string includes whitespaces, it must be enclosed within double quotes:&lt;br /&gt;
 &amp;quot;Everything in these double quotes is a single string. This is the number one: 1. Hooray! :) We are now coming to the end of this string.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
::Everything within the double quotes (including the colon and parenthesis emoticon) is considered to one long string by the game.&lt;br /&gt;
&lt;br /&gt;
::Sometimes you will want to mark a standard string as translatable so that it can be translated into other languages. The only difference between a translatable sting and a non-translatable is that translatable strings are marked so that translators know that they need to translate that string, and non-translatable strings are not marked, so the translators know that they don't translate those strings.&lt;br /&gt;
&lt;br /&gt;
::To mark a string as translatable, all you have to do is add an underscore before the first double quote that marks the beginning of the string. Example of a translatable string:&lt;br /&gt;
&lt;br /&gt;
  _ &amp;quot;This is a translatable string.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
::If the WML engine does not find an underscore in front of the string, it will assume the string is non-translatable.&lt;br /&gt;
&lt;br /&gt;
::Although not strictly necessary, it is generally considered a good practice to include a space before and after the underscore that marks a string as translatable. For instance, if we were to assign the translatable string &amp;quot;Hello World!&amp;quot; to this key, it would be considered good syntax to write&lt;br /&gt;
 key= _ &amp;quot;Hello World!&amp;quot;&lt;br /&gt;
::rather than&lt;br /&gt;
 key=_&amp;quot;Hello World!&amp;quot;&lt;br /&gt;
::However, the game considers both of the above strings to be equivalent, and will therefore recognize both as translatable strings. Adding whitespaces just allows for better human readability in your WML code.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
::'''2. Numerical Strings'''&lt;br /&gt;
&lt;br /&gt;
::Unsurprisingly, numerical strings are strings that contain only numbers, decimal points, or minus signs &amp;quot;-&amp;quot;. If a string contains anything other than numbers, decimal points and/or a minus sign, the string becomes a standard string instead of a numerical one. Numerical strings can be either a single numeric character like this:&lt;br /&gt;
 2&lt;br /&gt;
::a sequence of numeric characters, like this:&lt;br /&gt;
 230001&lt;br /&gt;
&lt;br /&gt;
::or floating-point values (that's just a fancy way of saying that they can contain decimal points), like these two examples:&lt;br /&gt;
 2.6&lt;br /&gt;
 395667.49382345&lt;br /&gt;
&lt;br /&gt;
::or negative numbers, like these examples:&lt;br /&gt;
 -49&lt;br /&gt;
 -594.932&lt;br /&gt;
&lt;br /&gt;
::For all intents and purposes, you can treat numerical strings just as you would numbers in real life. You can add, divide, and otherwise mathematically employ them in mathematical computations (we'll go over this in-depth in chapter [FIXME HERE]). Just remember that if you include any characters other than numbers, decimal points, or minus signs, the string will cease to be a numeric string and will become a standard string, which means you won't be able to use it in mathematical calculations.&lt;br /&gt;
&lt;br /&gt;
::Directory paths are simply special strings that tell the game where to find a specific file or folder. Here is an example of a directory path:&lt;br /&gt;
 {data/add-ons/my_first_campaign}&lt;br /&gt;
This directory path tells the game where the folder &amp;quot;my_first_campaign&amp;quot; is located.&lt;br /&gt;
&lt;br /&gt;
===More About Tags===&lt;br /&gt;
&lt;br /&gt;
So now you should understand the basics about tags and attributes. As I promised earlier, we will now discuss some of the more involved aspects of tags.&lt;br /&gt;
&lt;br /&gt;
====Nested Tags: Parents and Children====&lt;br /&gt;
&lt;br /&gt;
:A fundamental aspect of markup languages is that you can use tagsets inside other tagsets. Tagsets located inside other tagsets are called nested tagsets. In the example below, the &amp;quot;side&amp;quot; tagset is nested inside the &amp;quot;scenario&amp;quot; tagset:&lt;br /&gt;
&lt;br /&gt;
 [scenario]&lt;br /&gt;
     [side]&lt;br /&gt;
     [/side]&lt;br /&gt;
 [/scenario]&lt;br /&gt;
&lt;br /&gt;
:When referring to nested tagsets, the tagset located inside the other is called the ''child'' tagset, and the tagset that encloses the child tagset is known ast he ''parent'' tagset. To illustrate with pseudocode:&lt;br /&gt;
&lt;br /&gt;
 [parent]&lt;br /&gt;
     [child]&lt;br /&gt;
     [/child]&lt;br /&gt;
 [/parent]&lt;br /&gt;
&lt;br /&gt;
:Tagsets that are not child tagsets of any other tagsets are called ''toplevel'' tagsets. In this next example, the [scenario] tagset is a toplevel tagset, because it is not the child tagset of any other tagset. The  [event] tagset is the child tagset of [scenario], because it is located inside the [scenario] tagset. The tagset [event] is also the parent tagset of the [message] tagset, because the [message] tagset is located inside the [event] tagset. That means that since [event] is the parent of [message], [message] is the child tagset of [event].&lt;br /&gt;
&lt;br /&gt;
 [scenario]&lt;br /&gt;
     [event]&lt;br /&gt;
         [message]&lt;br /&gt;
         [/message]&lt;br /&gt;
     [/event]&lt;br /&gt;
 [/scenario]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Indentation and Levels====&lt;br /&gt;
&lt;br /&gt;
:You may have noticed that in the examples above, the child tagsets are indented four spaces further to the right than are their parent tagsets. Why is this? It's because proper indentation (although not technically required by the WML engine) makes you code a lot easier to read and maintain. It's like writing an outline for a school paper, where you would write something like this:&lt;br /&gt;
&lt;br /&gt;
 I.&lt;br /&gt;
     A.&lt;br /&gt;
     B.&lt;br /&gt;
     C.&lt;br /&gt;
 II.&lt;br /&gt;
     A.&lt;br /&gt;
         1.&lt;br /&gt;
         2.&lt;br /&gt;
     B.&lt;br /&gt;
     C.&lt;br /&gt;
&lt;br /&gt;
:Indentation makes it much easier to see whether tagset is the child or parent of other tagsets. The amount of indentation before a tagset determines in what level that tagset is located. If the tagset is a toplevel tagset (i.e. has no spaces in front of it because it is not the child of any other tagset), that tagset is located at level one. Tagsets with an indentation of four spaces in front of them are located in level 2, because they are the children of the toplevel (level 1) tagset. Tagsets that are children of level 2 tagsets are called level 3 tagsets (and are indented 8 spaces), tagsets inside level 3 tagsets are called level 4 tagsets (and are indented 12 spaces), etc. As a general rule, all the attributes of a tagset, along with any child tagsets of that tagset, are indented one level deeper than that tagset. To illustrate in pseudocode:&lt;br /&gt;
&lt;br /&gt;
 [toplevel_tagset]&lt;br /&gt;
     level_2_attribute=value&lt;br /&gt;
     [level_2_tagset]&lt;br /&gt;
         level_3_attribute=value&lt;br /&gt;
         [level 3 tagset]&lt;br /&gt;
             level_4_attribute=value&lt;br /&gt;
         [/level 3 tagset]&lt;br /&gt;
     [/level_2_tagset]&lt;br /&gt;
 [/toplevel_tagset]&lt;br /&gt;
&lt;br /&gt;
:Indenting tagsets and attributes into levels like this makes it much easier for you (and others) to read, fix and maintain your code. It is strongly recommended that you indent exactly four spaces for each new level, although you can also use tabs instead of hitting the space key 4 times, if you'd prefer.&lt;br /&gt;
&lt;br /&gt;
Next Chapter:&lt;br /&gt;
[[WML for Complete Beginners: Chapter 2]]&lt;br /&gt;
&lt;br /&gt;
Return to introduction:&lt;br /&gt;
[[WML for Complete Beginners: Introduction]]&lt;br /&gt;
&lt;br /&gt;
Return to Main Index:&lt;br /&gt;
[[WML for Complete Beginners]]&lt;br /&gt;
&lt;br /&gt;
[[Category:WML_for_Complete_Beginners]]&lt;/div&gt;</summary>
		<author><name>Vanfans</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.wesnoth.org/index.php?title=WML_for_Complete_Beginners:_Introduction/zh-Hans&amp;diff=58255</id>
		<title>WML for Complete Beginners: Introduction/zh-Hans</title>
		<link rel="alternate" type="text/html" href="https://wiki.wesnoth.org/index.php?title=WML_for_Complete_Beginners:_Introduction/zh-Hans&amp;diff=58255"/>
		<updated>2017-03-15T16:34:02Z</updated>

		<summary type="html">&lt;p&gt;Vanfans: Created page with &amp;quot;{| {{Prettytable}} |- !|其他语言： English 简体中文 |}  ==介绍==  各...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{| {{Prettytable}}&lt;br /&gt;
|-&lt;br /&gt;
!|其他语言：&lt;br /&gt;
[[WML_for_Complete_Beginners:_Introduction|English]]&lt;br /&gt;
[[WML_for_Complete_Beginners:_Introduction/zh|简体中文]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==介绍==&lt;br /&gt;
&lt;br /&gt;
各位！&lt;br /&gt;
&lt;br /&gt;
我猜，如果您读到这里，您应该已经了解韦诺之战是什么了。如果您不知道，我建议您在阅读本教程之前先了解一下。&lt;br /&gt;
&lt;br /&gt;
可能有人想知道这个教程的目的。您可能会说“[[ReferenceWML]]部分已经涵盖了 WML 的所有方面”。但是 WML 参考部分只是参考，而非教程。这个页面的目的是向初学者完整地介绍 WML 而不必在参考中查找一天。&lt;br /&gt;
&lt;br /&gt;
===教程是为谁准备的===&lt;br /&gt;
&lt;br /&gt;
本教程针对没有编程知识的用户。教程假定您对计算机有基本的了解和简单的操作能力，例如可以编辑文本文件，以及能够找到特定的目录。在本教程中，您会通过从零开始建立一个简单的单人战役来了解 WML。&lt;br /&gt;
&lt;br /&gt;
===您需要什么工具===&lt;br /&gt;
&lt;br /&gt;
对于 WML 您只需要一个基本的文本编辑器。不需要花哨的文字处理工具（应该说建议您不要使用文字处理工具）；用一个简单的程序，比如 Windows 的文本编辑器或者 Mac OS X 的 TextEdit。对于 Linux，有一个非常好的文本编辑程序 Kate，可以语法高亮显示 WML。此外，还有专门的编写 WML 的程序，您可以在这里找到[http://eclipse.wesnoth.org eclipse.wesnoth.org]&lt;br /&gt;
&lt;br /&gt;
显然，您还需要安装韦诺之战。&lt;br /&gt;
&lt;br /&gt;
===什么是 WML？===&lt;br /&gt;
&lt;br /&gt;
WML 是“韦诺标记语言”的缩写，韦诺标记语言可以让玩家创建和修改韦诺之战的内容，而不需学习更复杂的语言，比如 Lua 和 C++。现在我要说：不要觉得一夜之间就可以学会 WML。虽然 WML 容易学习，但是要花一定的精力曲理解。&lt;br /&gt;
&lt;br /&gt;
===准备开始吗？===&lt;br /&gt;
&lt;br /&gt;
当您准备开始，我们就可以进入 [[WML for Complete Beginners: Chapter 1]]！&lt;br /&gt;
&lt;br /&gt;
返回目录：&lt;br /&gt;
[[WML for Complete Beginners|WML 新手指南]]&lt;br /&gt;
&lt;br /&gt;
[[Category:WML_for_Complete_Beginners]]&lt;/div&gt;</summary>
		<author><name>Vanfans</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.wesnoth.org/index.php?title=WML_for_Complete_Beginners:_Introduction&amp;diff=58254</id>
		<title>WML for Complete Beginners: Introduction</title>
		<link rel="alternate" type="text/html" href="https://wiki.wesnoth.org/index.php?title=WML_for_Complete_Beginners:_Introduction&amp;diff=58254"/>
		<updated>2017-03-15T16:31:17Z</updated>

		<summary type="html">&lt;p&gt;Vanfans: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{| {{Prettytable}}&lt;br /&gt;
|-&lt;br /&gt;
!|其他语言：&lt;br /&gt;
[[WML_for_Complete_Beginners:_Introduction|English]]&lt;br /&gt;
[[WML_for_Complete_Beginners:_Introduction/zh|简体中文]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
&lt;br /&gt;
Hey there!&lt;br /&gt;
&lt;br /&gt;
Now I'm guessing that, if you're reading this, you already know what The Battle for Wesnoth is. If you don't, I suggest finding out before you read this tutorial.&lt;br /&gt;
&lt;br /&gt;
Some people may wonder about the purpose of this tutorial. &amp;quot;We already have almost every aspect of WML covered in the [[ReferenceWML]] section,&amp;quot; these people might say. But the information contained in the WML reference section is just that: a reference. Not a tutorial. This page aims to introduce complete beginners to WML without their having to sift for days through &amp;quot;references&amp;quot; until WML finally begins to vuagely make some sort of sense.&lt;br /&gt;
&lt;br /&gt;
===Who This Tutorial is For===&lt;br /&gt;
The specific demographic for which this tutorial is intended is users with no previous programming knowledge. This tutorial does assume that you have a certain level of competence in basic computer skills and concepts, such as opening and editing text files, and being able to follow folder paths and locate specific directories. In this tutorial you will learn the fundamentals of WML by building a short single-player campaign from the ground up.&lt;br /&gt;
&lt;br /&gt;
===What Tools You Will Need===&lt;br /&gt;
&lt;br /&gt;
Programming in WML requires only one tool: a basic text editor. You don't need a fancy word processor to program WML (in fact, it is recommended that you ''avoid'' using those fancy word processors); a simple program like Windows Notepad or Mac OS X TextEdit will work just fine. For Linux, there is a very nice text editing application called Kate that actually comes with syntax highlighting for WML.  In addition, some very helpful people put together a program specifically designed to help you write WML, which you can find at [http://eclipse.wesnoth.org eclipse.wesnoth.org]&lt;br /&gt;
&lt;br /&gt;
Obviously, you will also need The Battle for Wesnoth installed on your computer.&lt;br /&gt;
&lt;br /&gt;
===So What Exactly is WML?===&lt;br /&gt;
&lt;br /&gt;
WML is an acronym for the &amp;quot;Wesnoth Markup Language&amp;quot;, a custom scripting language that The Battle For Wesnoth uses to allow players to create and modify content without being required to learn a much more complex language like Lua or C++. Now I'm going to say this here and now: don't think you can learn WML overnight. Although WML is relatively easy to learn, it will take a certain amount of effort, time and dedication on your part to fully understand the ins and outs of the language.&lt;br /&gt;
&lt;br /&gt;
===Ready to Get Started?===&lt;br /&gt;
&lt;br /&gt;
When you are ready, head on over to [[WML for Complete Beginners: Chapter 1]] and let's get started!&lt;br /&gt;
&lt;br /&gt;
Return to Main Index:&lt;br /&gt;
[[WML for Complete Beginners]]&lt;br /&gt;
&lt;br /&gt;
[[Category:WML_for_Complete_Beginners]]&lt;/div&gt;</summary>
		<author><name>Vanfans</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.wesnoth.org/index.php?title=WML_for_Complete_Beginners/zh-Hans&amp;diff=58244</id>
		<title>WML for Complete Beginners/zh-Hans</title>
		<link rel="alternate" type="text/html" href="https://wiki.wesnoth.org/index.php?title=WML_for_Complete_Beginners/zh-Hans&amp;diff=58244"/>
		<updated>2017-03-14T17:04:23Z</updated>

		<summary type="html">&lt;p&gt;Vanfans: /* 目录 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{| {{Prettytable}}&lt;br /&gt;
|-&lt;br /&gt;
!|其他语言：&lt;br /&gt;
[[WML_for_Complete_Beginners|English]]&lt;br /&gt;
[[WML_for_Complete_Beginners/zh|简体中文]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
欢迎来到 WML 新手指南！在这里，您可以直达[[WML for Complete Beginners: Introduction|简介]]部分，或者阅读其他章节。&lt;br /&gt;
&lt;br /&gt;
==注意事项：==&lt;br /&gt;
&lt;br /&gt;
这套新手指南正在编写中。&lt;br /&gt;
小的修改不会立刻提交给读者。&lt;br /&gt;
-------------&lt;br /&gt;
&lt;br /&gt;
TODO:&lt;br /&gt;
&lt;br /&gt;
1. Add to the numbers definition that numbers can include decimal point values (and reference the fact that WML will remove any unnecessary 0's when it performs the calculations or accesses the numerical value in question).&lt;br /&gt;
&lt;br /&gt;
2. Finish chapters 6-11 (Partially Complete)&lt;br /&gt;
&lt;br /&gt;
-------------&lt;br /&gt;
&lt;br /&gt;
=目录=&lt;br /&gt;
&lt;br /&gt;
[[WML_for_Complete_Beginners:_Introduction|WML 新手指南：简介]]&lt;br /&gt;
&lt;br /&gt;
[[WML_for_Complete_Beginners:_Chapter_1|WML 新手指南：第1章]]&lt;br /&gt;
&lt;br /&gt;
[[WML_for_Complete_Beginners:_Chapter_2|WML 新手指南：第2章]]&lt;br /&gt;
&lt;br /&gt;
[[WML_for_Complete_Beginners:_Chapter_3|WML 新手指南：第3章]]&lt;br /&gt;
&lt;br /&gt;
[[WML_for_Complete_Beginners:_Chapter_4|WML 新手指南：第4章]]&lt;br /&gt;
&lt;br /&gt;
[[WML_for_Complete_Beginners:_Chapter_5|WML 新手指南：第5章]]&lt;br /&gt;
&lt;br /&gt;
[[WML_for_Complete_Beginners:_Chapter_6|WML 新手指南：第6章]]&lt;br /&gt;
&lt;br /&gt;
[[WML_for_Complete_Beginners:_Chapter_7|WML 新手指南：第7章]]&lt;br /&gt;
&lt;br /&gt;
[[WML_for_Complete_Beginners:_Chapter_8|WML 新手指南：第8章]]&lt;br /&gt;
&lt;br /&gt;
[[WML_for_Complete_Beginners:_Chapter_9|WML 新手指南：第9章]]&lt;br /&gt;
&lt;br /&gt;
[[WML_for_Complete_Beginners:_Chapter_10|WML 新手指南：第10章]]&lt;br /&gt;
&lt;br /&gt;
[[WML_for_Complete_Beginners:_Chapter_11|WML 新手指南：第11章]]&lt;br /&gt;
&lt;br /&gt;
[[WML_for_Complete_Beginners:_Conclusion]]&lt;br /&gt;
&lt;br /&gt;
[[Category:WML_for_Complete_Beginners]]&lt;/div&gt;</summary>
		<author><name>Vanfans</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.wesnoth.org/index.php?title=WML_for_Complete_Beginners/zh-Hans&amp;diff=58243</id>
		<title>WML for Complete Beginners/zh-Hans</title>
		<link rel="alternate" type="text/html" href="https://wiki.wesnoth.org/index.php?title=WML_for_Complete_Beginners/zh-Hans&amp;diff=58243"/>
		<updated>2017-03-14T17:03:08Z</updated>

		<summary type="html">&lt;p&gt;Vanfans: Created page with &amp;quot;{| {{Prettytable}} |- !|其他语言： English 简体中文 |}  欢迎来到 WML 新手指南！在这里，...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{| {{Prettytable}}&lt;br /&gt;
|-&lt;br /&gt;
!|其他语言：&lt;br /&gt;
[[WML_for_Complete_Beginners|English]]&lt;br /&gt;
[[WML_for_Complete_Beginners/zh|简体中文]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
欢迎来到 WML 新手指南！在这里，您可以直达[[WML for Complete Beginners: Introduction|简介]]部分，或者阅读其他章节。&lt;br /&gt;
&lt;br /&gt;
==注意事项：==&lt;br /&gt;
&lt;br /&gt;
这套新手指南正在编写中。&lt;br /&gt;
小的修改不会立刻提交给读者。&lt;br /&gt;
-------------&lt;br /&gt;
&lt;br /&gt;
TODO:&lt;br /&gt;
&lt;br /&gt;
1. Add to the numbers definition that numbers can include decimal point values (and reference the fact that WML will remove any unnecessary 0's when it performs the calculations or accesses the numerical value in question).&lt;br /&gt;
&lt;br /&gt;
2. Finish chapters 6-11 (Partially Complete)&lt;br /&gt;
&lt;br /&gt;
-------------&lt;br /&gt;
&lt;br /&gt;
=目录=&lt;br /&gt;
&lt;br /&gt;
[[WML_for_Complete_Beginners:_Introduction|WML 新手指南：简介]]&lt;br /&gt;
&lt;br /&gt;
[[WML_for_Complete_Beginners:_Chapter_1|WML 新手指南：第1章]]&lt;br /&gt;
&lt;br /&gt;
[[WML_for_Complete_Beginners:_Chapter_2|WML 新手指南：第2章]]&lt;br /&gt;
&lt;br /&gt;
[[WML_for_Complete_Beginners:_Chapter_3|WML 新手指南：第3章]]&lt;br /&gt;
&lt;br /&gt;
[[WML_for_Complete_Beginners:_Chapter_4|WML 新手指南：第4章]]&lt;br /&gt;
&lt;br /&gt;
[[WML_for_Complete_Beginners:_Chapter_5|WML 新手指南：第5章]]&lt;br /&gt;
&lt;br /&gt;
[[WML_for_Complete_Beginners:_Chapter_6|WML 新手指南：第6章]]&lt;br /&gt;
&lt;br /&gt;
[[WML_for_Complete_Beginners:_Chapter_7|WML 新手指南：第7章]]&lt;br /&gt;
&lt;br /&gt;
[[WML_for_Complete_Beginners:_Chapter_8|WML 新手指南：第8章]]&lt;br /&gt;
&lt;br /&gt;
[[WML_for_Complete_Beginners:_Chapter_9|WML 新手指南：第9章]]&lt;br /&gt;
&lt;br /&gt;
[[WML_for_Complete_Beginners:_Chapter_10|WML 新手指南：第10章]]&lt;br /&gt;
&lt;br /&gt;
[[WML_for_Complete_Beginners:_Chapter_11|WML 新手指南：第11章]]&lt;br /&gt;
&lt;br /&gt;
[[WML_for_Complete_Beginners:_Conclusion]]&lt;/div&gt;</summary>
		<author><name>Vanfans</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.wesnoth.org/index.php?title=WML_for_Complete_Beginners&amp;diff=58242</id>
		<title>WML for Complete Beginners</title>
		<link rel="alternate" type="text/html" href="https://wiki.wesnoth.org/index.php?title=WML_for_Complete_Beginners&amp;diff=58242"/>
		<updated>2017-03-14T16:52:02Z</updated>

		<summary type="html">&lt;p&gt;Vanfans: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{| {{Prettytable}}&lt;br /&gt;
|-&lt;br /&gt;
!|Other languages:&lt;br /&gt;
[[WML_for_Complete_Beginners|English]]&lt;br /&gt;
[[WML_for_Complete_Beginners/zh|简体中文]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Welcome to the WML Guide for Complete Beginners!  From here, you can get started directly by heading to the [[WML for Complete Beginners: Introduction|Introduction]] or you can continue from the chapter you left off.  &lt;br /&gt;
&lt;br /&gt;
==Important Notes:==&lt;br /&gt;
This is a work in progress.&lt;br /&gt;
Minor edits will not cause the edit to be shown immediately on a page to viewers.&lt;br /&gt;
-------------&lt;br /&gt;
&lt;br /&gt;
TODO:&lt;br /&gt;
1. Add to the numbers definition that numbers can include decimal point values (and reference the fact that WML will remove any unnecessary 0's when it performs the calculations or accesses the numerical value in question).&lt;br /&gt;
&lt;br /&gt;
2. Finish chapters 6-11 (Partially Complete)&lt;br /&gt;
&lt;br /&gt;
-------------&lt;br /&gt;
&lt;br /&gt;
=Main Index=&lt;br /&gt;
&lt;br /&gt;
[[WML_for_Complete_Beginners:_Introduction]]&lt;br /&gt;
&lt;br /&gt;
[[WML_for_Complete_Beginners:_Chapter_1]]&lt;br /&gt;
&lt;br /&gt;
[[WML_for_Complete_Beginners:_Chapter_2]]&lt;br /&gt;
&lt;br /&gt;
[[WML_for_Complete_Beginners:_Chapter_3]]&lt;br /&gt;
&lt;br /&gt;
[[WML_for_Complete_Beginners:_Chapter_4]]&lt;br /&gt;
&lt;br /&gt;
[[WML_for_Complete_Beginners:_Chapter_5]]&lt;br /&gt;
&lt;br /&gt;
[[WML_for_Complete_Beginners:_Chapter_6]]&lt;br /&gt;
&lt;br /&gt;
[[WML_for_Complete_Beginners:_Chapter_7]]&lt;br /&gt;
&lt;br /&gt;
[[WML_for_Complete_Beginners:_Chapter_8]]&lt;br /&gt;
&lt;br /&gt;
[[WML_for_Complete_Beginners:_Chapter_9]]&lt;br /&gt;
&lt;br /&gt;
[[WML_for_Complete_Beginners:_Chapter_10]]&lt;br /&gt;
&lt;br /&gt;
[[WML_for_Complete_Beginners:_Chapter_11]]&lt;br /&gt;
&lt;br /&gt;
[[WML_for_Complete_Beginners:_Conclusion]]&lt;br /&gt;
&lt;br /&gt;
[[Category:WML_for_Complete_Beginners]]&lt;/div&gt;</summary>
		<author><name>Vanfans</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.wesnoth.org/index.php?title=AddonStructure/zh-Hans&amp;diff=58241</id>
		<title>AddonStructure/zh-Hans</title>
		<link rel="alternate" type="text/html" href="https://wiki.wesnoth.org/index.php?title=AddonStructure/zh-Hans&amp;diff=58241"/>
		<updated>2017-03-14T16:48:36Z</updated>

		<summary type="html">&lt;p&gt;Vanfans: /* 目录结构 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Create}}&lt;br /&gt;
&lt;br /&gt;
{| {{Prettytable}}&lt;br /&gt;
|-&lt;br /&gt;
!|Other languages:&lt;br /&gt;
[[AddonStructure|English]]&lt;br /&gt;
[[AddonStructure/zh|简体中文]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
如果您想为韦诺创建自定义内容，您需要在 userdata/data/add-ons/ 中设置一个文件夹。如果您没有找到您的 userdata 目录，请阅读[[EditingWesnoth]]章节。本页面将讲解插件的结构。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;这个页面假设您已经了解在哪里找到 userdata 目录。&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== 主文件 ==&lt;br /&gt;
&lt;br /&gt;
作为示例，我们建立一个名为 &amp;lt;b&amp;gt;A Simple Addon&amp;lt;/b&amp;gt; 的插件。&lt;br /&gt;
&lt;br /&gt;
*建立一个路径为 &amp;lt;b&amp;gt;&amp;lt;i&amp;gt;userdata&amp;lt;/i&amp;gt;/data/add-ons/A_Simple_Addon&amp;lt;/b&amp;gt; 的空目录。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;重要提示：&amp;lt;/b&amp;gt;所有目录和文件名都要使用下划线而不是空格。否则会无法正常工作。&lt;br /&gt;
&lt;br /&gt;
*在 A_Simple_Addon 文件夹中，建立一个名为 &amp;lt;b&amp;gt;_main.cfg&amp;lt;/b&amp;gt; 的文件。&lt;br /&gt;
&lt;br /&gt;
_main.cfg 文件决定游戏如何加载您的内容。这里展示了一个非常简单的示例。&lt;br /&gt;
&lt;br /&gt;
 #textdomain wesnoth-A_Simple_Addon&lt;br /&gt;
 [textdomain]&lt;br /&gt;
     name=&amp;quot;wesnoth-A_Simple_Addon&amp;quot;&lt;br /&gt;
     path=&amp;quot;data/add-ons/A_Simple_Addon/translations&amp;quot;&lt;br /&gt;
 [/textdomain]&lt;br /&gt;
 &lt;br /&gt;
 #ifdef MULTIPLAYER&lt;br /&gt;
 [binary_path]&lt;br /&gt;
     path=data/add-ons/A_Simple_Addon&lt;br /&gt;
 [/binary_path]&lt;br /&gt;
 &lt;br /&gt;
 {~add-ons/A_Simple_Addon/scenarios}&lt;br /&gt;
 #endif&lt;br /&gt;
&lt;br /&gt;
[textdomain] WML 标签指定了组件中字符串的翻译。textdomain 应该是组件的目录名，需要添加前缀&amp;lt;b&amp;gt;“wesnoth-”&amp;lt;/b&amp;gt;来确保不会和其他文本冲突，并和 [[WesCamp]] 兼容。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;注意：&amp;lt;/b&amp;gt;只有在您的组件需要翻译时，才需要 textdomain。如果是音乐包或者其他情况，并不需要 textdomain。&lt;br /&gt;
&lt;br /&gt;
所有的 [campaign] 和 [textdomain] 标签&amp;lt;b&amp;gt;必须&amp;lt;/b&amp;gt; 包含在 &amp;lt;b&amp;gt;#ifdef&amp;lt;/b&amp;gt; 预处理条件中，包括替换条件（详见 [[PreprocessorRef]]）。这是为了确保您的内容在正确的时间加载，并且不和其他插件冲突。在上面的示例中，您的场景会在多人模式下被加载。在战役中，您可以设置特定标记，让只在战役中被加载。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Note：&amp;lt;/b&amp;gt;只有&amp;lt;b&amp;gt;代码&amp;lt;/b&amp;gt;必须放在这个文件里。您&amp;lt;b&amp;gt;不需要&amp;lt;/b&amp;gt;将二进制内容（例如声音、图片、音乐）放在这里。您可以通过指定相对于 [binary_path] 的路径来引用内容。此外，&amp;lt;b&amp;gt;units&amp;lt;/b&amp;gt; 目录不能通过简单的引用路径；它必须使用 &amp;lt;b&amp;gt;[+units][/units]&amp;lt;/b&amp;gt;（&amp;lt;b&amp;gt;+&amp;lt;/b&amp;gt;非常重要！）标签包裹，就象这样：&lt;br /&gt;
&lt;br /&gt;
 [+units]&lt;br /&gt;
     {~add-ons/A_Simple_Addon/units}&lt;br /&gt;
 [/units]&lt;br /&gt;
&lt;br /&gt;
== 目录结构 ==&lt;br /&gt;
&lt;br /&gt;
接下来创建的取决于类型。例如战役和地图包会有 &amp;lt;b&amp;gt;scenarios&amp;lt;/b&amp;gt; 和 &amp;lt;b&amp;gt;maps&amp;lt;/b&amp;gt; 目录，音乐包只需要 &amp;lt;b&amp;gt;music&amp;lt;/b&amp;gt;。我们假设您在创建一个战役或者单人场景组件。&lt;br /&gt;
&lt;br /&gt;
请建立如下目录：&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;b&amp;gt;&amp;lt;i&amp;gt;userdata&amp;lt;/i&amp;gt;/data/add-ons/A_Simple_Addon/scenarios&amp;lt;/b&amp;gt;&lt;br /&gt;
*&amp;lt;b&amp;gt;&amp;lt;i&amp;gt;userdata&amp;lt;/i&amp;gt;/data/add-ons/A_Simple_Addon/maps&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
场景中使用的所有地图文件都在 &amp;lt;b&amp;gt;maps&amp;lt;/b&amp;gt; 当中（详见[[BuildingMaps]]）。所有场景的的配置文件（.cfg）文件都在 &amp;lt;b&amp;gt;scenarios&amp;lt;/b&amp;gt; 当中（详见[[BuildingScenarios]]）。&lt;br /&gt;
&lt;br /&gt;
如果您有一些自定义的内容，比如图片或者单位，请建立如下内容：&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;b&amp;gt;&amp;lt;i&amp;gt;userdata&amp;lt;/i&amp;gt;/data/add-ons/A_Simple_Addon/macros&amp;lt;/b&amp;gt;&lt;br /&gt;
*&amp;lt;b&amp;gt;&amp;lt;i&amp;gt;userdata&amp;lt;/i&amp;gt;/data/add-ons/A_Simple_Addon/units&amp;lt;/b&amp;gt;&lt;br /&gt;
*&amp;lt;b&amp;gt;&amp;lt;i&amp;gt;userdata&amp;lt;/i&amp;gt;/data/add-ons/A_Simple_Addon/images&amp;lt;/b&amp;gt;&lt;br /&gt;
*&amp;lt;b&amp;gt;&amp;lt;i&amp;gt;userdata&amp;lt;/i&amp;gt;/data/add-ons/A_Simple_Addon/music&amp;lt;/b&amp;gt;&lt;br /&gt;
*&amp;lt;b&amp;gt;&amp;lt;i&amp;gt;userdata&amp;lt;/i&amp;gt;/data/add-ons/A_Simple_Addon/sounds&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;注意：&amp;lt;/b&amp;gt;您可以命名包含代码的目录（例如 &amp;lt;b&amp;gt;scenarios&amp;lt;/b&amp;gt; 和 &amp;lt;b&amp;gt;macros&amp;lt;/b&amp;gt;）为任意名称，但是三个二进制内容目录（&amp;lt;b&amp;gt;images&amp;lt;/b&amp;gt;、&amp;lt;b&amp;gt;music&amp;lt;/b&amp;gt;、&amp;lt;b&amp;gt;sounds&amp;lt;/b&amp;gt;）&amp;lt;b&amp;gt;必须&amp;lt;/b&amp;gt;是这个名字，并且相对于 [binary_path] 指定的路径。游戏尝试解析图像、音乐、声音路径时，会在 [binary_path] 下查找。&lt;br /&gt;
&lt;br /&gt;
如果您设置了 textdomain，则要建立 &amp;lt;b&amp;gt;translations&amp;lt;/b&amp;gt; 目录，即便是空的也要建立。否则会在 stderr 中生成警告。路径&amp;lt;b&amp;gt;必须&amp;lt;/b&amp;gt;和 [textdomain] 标签指定的一致。&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;b&amp;gt;&amp;lt;i&amp;gt;userdata&amp;lt;/i&amp;gt;/data/add-ons/A_Simple_Addon/translations&amp;lt;/b&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
&amp;lt;b&amp;gt;注意！&amp;lt;/b&amp;gt;译文质量不佳。&lt;br /&gt;
&lt;br /&gt;
==参见==&lt;br /&gt;
&lt;br /&gt;
* [[Create]]&lt;br /&gt;
* [[BinaryPathWML]]&lt;br /&gt;
* [[BuildingCampaignsTheCampaignFile]]&lt;br /&gt;
* [[WesCamp]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Create]]&lt;/div&gt;</summary>
		<author><name>Vanfans</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.wesnoth.org/index.php?title=AddonStructure/zh-Hans&amp;diff=58240</id>
		<title>AddonStructure/zh-Hans</title>
		<link rel="alternate" type="text/html" href="https://wiki.wesnoth.org/index.php?title=AddonStructure/zh-Hans&amp;diff=58240"/>
		<updated>2017-03-14T16:47:53Z</updated>

		<summary type="html">&lt;p&gt;Vanfans: /* The Directory Structure */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Create}}&lt;br /&gt;
&lt;br /&gt;
{| {{Prettytable}}&lt;br /&gt;
|-&lt;br /&gt;
!|Other languages:&lt;br /&gt;
[[AddonStructure|English]]&lt;br /&gt;
[[AddonStructure/zh|简体中文]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
如果您想为韦诺创建自定义内容，您需要在 userdata/data/add-ons/ 中设置一个文件夹。如果您没有找到您的 userdata 目录，请阅读[[EditingWesnoth]]章节。本页面将讲解插件的结构。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;这个页面假设您已经了解在哪里找到 userdata 目录。&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== 主文件 ==&lt;br /&gt;
&lt;br /&gt;
作为示例，我们建立一个名为 &amp;lt;b&amp;gt;A Simple Addon&amp;lt;/b&amp;gt; 的插件。&lt;br /&gt;
&lt;br /&gt;
*建立一个路径为 &amp;lt;b&amp;gt;&amp;lt;i&amp;gt;userdata&amp;lt;/i&amp;gt;/data/add-ons/A_Simple_Addon&amp;lt;/b&amp;gt; 的空目录。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;重要提示：&amp;lt;/b&amp;gt;所有目录和文件名都要使用下划线而不是空格。否则会无法正常工作。&lt;br /&gt;
&lt;br /&gt;
*在 A_Simple_Addon 文件夹中，建立一个名为 &amp;lt;b&amp;gt;_main.cfg&amp;lt;/b&amp;gt; 的文件。&lt;br /&gt;
&lt;br /&gt;
_main.cfg 文件决定游戏如何加载您的内容。这里展示了一个非常简单的示例。&lt;br /&gt;
&lt;br /&gt;
 #textdomain wesnoth-A_Simple_Addon&lt;br /&gt;
 [textdomain]&lt;br /&gt;
     name=&amp;quot;wesnoth-A_Simple_Addon&amp;quot;&lt;br /&gt;
     path=&amp;quot;data/add-ons/A_Simple_Addon/translations&amp;quot;&lt;br /&gt;
 [/textdomain]&lt;br /&gt;
 &lt;br /&gt;
 #ifdef MULTIPLAYER&lt;br /&gt;
 [binary_path]&lt;br /&gt;
     path=data/add-ons/A_Simple_Addon&lt;br /&gt;
 [/binary_path]&lt;br /&gt;
 &lt;br /&gt;
 {~add-ons/A_Simple_Addon/scenarios}&lt;br /&gt;
 #endif&lt;br /&gt;
&lt;br /&gt;
[textdomain] WML 标签指定了组件中字符串的翻译。textdomain 应该是组件的目录名，需要添加前缀&amp;lt;b&amp;gt;“wesnoth-”&amp;lt;/b&amp;gt;来确保不会和其他文本冲突，并和 [[WesCamp]] 兼容。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;注意：&amp;lt;/b&amp;gt;只有在您的组件需要翻译时，才需要 textdomain。如果是音乐包或者其他情况，并不需要 textdomain。&lt;br /&gt;
&lt;br /&gt;
所有的 [campaign] 和 [textdomain] 标签&amp;lt;b&amp;gt;必须&amp;lt;/b&amp;gt; 包含在 &amp;lt;b&amp;gt;#ifdef&amp;lt;/b&amp;gt; 预处理条件中，包括替换条件（详见 [[PreprocessorRef]]）。这是为了确保您的内容在正确的时间加载，并且不和其他插件冲突。在上面的示例中，您的场景会在多人模式下被加载。在战役中，您可以设置特定标记，让只在战役中被加载。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Note：&amp;lt;/b&amp;gt;只有&amp;lt;b&amp;gt;代码&amp;lt;/b&amp;gt;必须放在这个文件里。您&amp;lt;b&amp;gt;不需要&amp;lt;/b&amp;gt;将二进制内容（例如声音、图片、音乐）放在这里。您可以通过指定相对于 [binary_path] 的路径来引用内容。此外，&amp;lt;b&amp;gt;units&amp;lt;/b&amp;gt; 目录不能通过简单的引用路径；它必须使用 &amp;lt;b&amp;gt;[+units][/units]&amp;lt;/b&amp;gt;（&amp;lt;b&amp;gt;+&amp;lt;/b&amp;gt;非常重要！）标签包裹，就象这样：&lt;br /&gt;
&lt;br /&gt;
 [+units]&lt;br /&gt;
     {~add-ons/A_Simple_Addon/units}&lt;br /&gt;
 [/units]&lt;br /&gt;
&lt;br /&gt;
== 目录结构 ==&lt;br /&gt;
&lt;br /&gt;
接下来创建的取决于类型。例如战役和地图包会有 &amp;lt;b&amp;gt;scenarios&amp;lt;/b&amp;gt; 和 &amp;lt;b&amp;gt;maps&amp;lt;/b&amp;gt; 目录，音乐包只需要 &amp;lt;b&amp;gt;music&amp;lt;/b&amp;gt;。我们假设您在创建一个战役或者单人场景组件。&lt;br /&gt;
&lt;br /&gt;
请建立如下目录：&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;b&amp;gt;&amp;lt;i&amp;gt;userdata&amp;lt;/i&amp;gt;/data/add-ons/A_Simple_Addon/scenarios&amp;lt;/b&amp;gt;&lt;br /&gt;
*&amp;lt;b&amp;gt;&amp;lt;i&amp;gt;userdata&amp;lt;/i&amp;gt;/data/add-ons/A_Simple_Addon/maps&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
场景中使用的所有地图文件都在 &amp;lt;b&amp;gt;maps&amp;lt;/b&amp;gt; 当中（详见[[BuildingMaps]]）。所有场景的的配置文件（.cfg）文件都在 &amp;lt;b&amp;gt;scenarios&amp;lt;/b&amp;gt; 当中（详见[[BuildingScenarios]]）。&lt;br /&gt;
&lt;br /&gt;
如果您有一些自定义的内容，比如图片或者单位，请建立如下内容：&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;b&amp;gt;&amp;lt;i&amp;gt;userdata&amp;lt;/i&amp;gt;/data/add-ons/A_Simple_Addon/macros&amp;lt;/b&amp;gt;&lt;br /&gt;
*&amp;lt;b&amp;gt;&amp;lt;i&amp;gt;userdata&amp;lt;/i&amp;gt;/data/add-ons/A_Simple_Addon/units&amp;lt;/b&amp;gt;&lt;br /&gt;
*&amp;lt;b&amp;gt;&amp;lt;i&amp;gt;userdata&amp;lt;/i&amp;gt;/data/add-ons/A_Simple_Addon/images&amp;lt;/b&amp;gt;&lt;br /&gt;
*&amp;lt;b&amp;gt;&amp;lt;i&amp;gt;userdata&amp;lt;/i&amp;gt;/data/add-ons/A_Simple_Addon/music&amp;lt;/b&amp;gt;&lt;br /&gt;
*&amp;lt;b&amp;gt;&amp;lt;i&amp;gt;userdata&amp;lt;/i&amp;gt;/data/add-ons/A_Simple_Addon/sounds&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;注意：&amp;lt;/b&amp;gt;您可以命名包含代码的目录（例如 &amp;lt;b&amp;gt;scenarios&amp;lt;/b&amp;gt; 和 &amp;lt;b&amp;gt;macros&amp;lt;/b&amp;gt;）为任意名称，但是三个二进制内容目录（&amp;lt;b&amp;gt;images&amp;lt;/b&amp;gt;、&amp;lt;b&amp;gt;music&amp;lt;/b&amp;gt;、&amp;lt;b&amp;gt;sounds&amp;lt;/b&amp;gt;）&amp;lt;b&amp;gt;必须&amp;lt;/b&amp;gt;是这个名字，并且相对于 [binary_path] 指定的路径。游戏尝试解析图像、音乐、声音路径时，会在 [binary_path] 下查找。&lt;br /&gt;
&lt;br /&gt;
如果您设置了 textdomain，则要建立 &amp;lt;b&amp;gt;translations&amp;lt;/b&amp;gt; 目录，即便是空的也要建立。否则会在 stderr 中生成警告。路径&amp;lt;b&amp;gt;必须&amp;lt;/b&amp;gt;和 [textdomain] 标签指定的一致。&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;b&amp;gt;&amp;lt;i&amp;gt;userdata&amp;lt;/i&amp;gt;/data/add-ons/A_Simple_Addon/translations&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==参见==&lt;br /&gt;
&lt;br /&gt;
* [[Create]]&lt;br /&gt;
* [[BinaryPathWML]]&lt;br /&gt;
* [[BuildingCampaignsTheCampaignFile]]&lt;br /&gt;
* [[WesCamp]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Create]]&lt;/div&gt;</summary>
		<author><name>Vanfans</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.wesnoth.org/index.php?title=AddonStructure/zh-Hans&amp;diff=58239</id>
		<title>AddonStructure/zh-Hans</title>
		<link rel="alternate" type="text/html" href="https://wiki.wesnoth.org/index.php?title=AddonStructure/zh-Hans&amp;diff=58239"/>
		<updated>2017-03-14T16:46:35Z</updated>

		<summary type="html">&lt;p&gt;Vanfans: /* The Main File */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Create}}&lt;br /&gt;
&lt;br /&gt;
{| {{Prettytable}}&lt;br /&gt;
|-&lt;br /&gt;
!|Other languages:&lt;br /&gt;
[[AddonStructure|English]]&lt;br /&gt;
[[AddonStructure/zh|简体中文]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
如果您想为韦诺创建自定义内容，您需要在 userdata/data/add-ons/ 中设置一个文件夹。如果您没有找到您的 userdata 目录，请阅读[[EditingWesnoth]]章节。本页面将讲解插件的结构。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;这个页面假设您已经了解在哪里找到 userdata 目录。&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== 主文件 ==&lt;br /&gt;
&lt;br /&gt;
作为示例，我们建立一个名为 &amp;lt;b&amp;gt;A Simple Addon&amp;lt;/b&amp;gt; 的插件。&lt;br /&gt;
&lt;br /&gt;
*建立一个路径为 &amp;lt;b&amp;gt;&amp;lt;i&amp;gt;userdata&amp;lt;/i&amp;gt;/data/add-ons/A_Simple_Addon&amp;lt;/b&amp;gt; 的空目录。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;重要提示：&amp;lt;/b&amp;gt;所有目录和文件名都要使用下划线而不是空格。否则会无法正常工作。&lt;br /&gt;
&lt;br /&gt;
*在 A_Simple_Addon 文件夹中，建立一个名为 &amp;lt;b&amp;gt;_main.cfg&amp;lt;/b&amp;gt; 的文件。&lt;br /&gt;
&lt;br /&gt;
_main.cfg 文件决定游戏如何加载您的内容。这里展示了一个非常简单的示例。&lt;br /&gt;
&lt;br /&gt;
 #textdomain wesnoth-A_Simple_Addon&lt;br /&gt;
 [textdomain]&lt;br /&gt;
     name=&amp;quot;wesnoth-A_Simple_Addon&amp;quot;&lt;br /&gt;
     path=&amp;quot;data/add-ons/A_Simple_Addon/translations&amp;quot;&lt;br /&gt;
 [/textdomain]&lt;br /&gt;
 &lt;br /&gt;
 #ifdef MULTIPLAYER&lt;br /&gt;
 [binary_path]&lt;br /&gt;
     path=data/add-ons/A_Simple_Addon&lt;br /&gt;
 [/binary_path]&lt;br /&gt;
 &lt;br /&gt;
 {~add-ons/A_Simple_Addon/scenarios}&lt;br /&gt;
 #endif&lt;br /&gt;
&lt;br /&gt;
[textdomain] WML 标签指定了组件中字符串的翻译。textdomain 应该是组件的目录名，需要添加前缀&amp;lt;b&amp;gt;“wesnoth-”&amp;lt;/b&amp;gt;来确保不会和其他文本冲突，并和 [[WesCamp]] 兼容。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;注意：&amp;lt;/b&amp;gt;只有在您的组件需要翻译时，才需要 textdomain。如果是音乐包或者其他情况，并不需要 textdomain。&lt;br /&gt;
&lt;br /&gt;
所有的 [campaign] 和 [textdomain] 标签&amp;lt;b&amp;gt;必须&amp;lt;/b&amp;gt; 包含在 &amp;lt;b&amp;gt;#ifdef&amp;lt;/b&amp;gt; 预处理条件中，包括替换条件（详见 [[PreprocessorRef]]）。这是为了确保您的内容在正确的时间加载，并且不和其他插件冲突。在上面的示例中，您的场景会在多人模式下被加载。在战役中，您可以设置特定标记，让只在战役中被加载。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Note：&amp;lt;/b&amp;gt;只有&amp;lt;b&amp;gt;代码&amp;lt;/b&amp;gt;必须放在这个文件里。您&amp;lt;b&amp;gt;不需要&amp;lt;/b&amp;gt;将二进制内容（例如声音、图片、音乐）放在这里。您可以通过指定相对于 [binary_path] 的路径来引用内容。此外，&amp;lt;b&amp;gt;units&amp;lt;/b&amp;gt; 目录不能通过简单的引用路径；它必须使用 &amp;lt;b&amp;gt;[+units][/units]&amp;lt;/b&amp;gt;（&amp;lt;b&amp;gt;+&amp;lt;/b&amp;gt;非常重要！）标签包裹，就象这样：&lt;br /&gt;
&lt;br /&gt;
 [+units]&lt;br /&gt;
     {~add-ons/A_Simple_Addon/units}&lt;br /&gt;
 [/units]&lt;br /&gt;
&lt;br /&gt;
== The Directory Structure ==&lt;br /&gt;
&lt;br /&gt;
What to create next depend on what type of content you are creating. For example, campaigns or map packs will have &amp;lt;b&amp;gt;scenarios&amp;lt;/b&amp;gt; and &amp;lt;b&amp;gt;maps&amp;lt;/b&amp;gt; directories, while a music pack would have only &amp;lt;b&amp;gt;music&amp;lt;/b&amp;gt;. Here we will assume you are creating a campaign or single-scenario add-on.&lt;br /&gt;
&lt;br /&gt;
Create the following directories:&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;b&amp;gt;&amp;lt;i&amp;gt;userdata&amp;lt;/i&amp;gt;/data/add-ons/A_Simple_Addon/scenarios&amp;lt;/b&amp;gt;&lt;br /&gt;
*&amp;lt;b&amp;gt;&amp;lt;i&amp;gt;userdata&amp;lt;/i&amp;gt;/data/add-ons/A_Simple_Addon/maps&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
场景中使用的所有地图文件都在 &amp;lt;b&amp;gt;maps&amp;lt;/b&amp;gt; 当中（详见[[BuildingMaps]]）。所有场景的的配置文件（.cfg）文件都在 &amp;lt;b&amp;gt;scenarios&amp;lt;/b&amp;gt; 当中（详见[[BuildingScenarios]]）。&lt;br /&gt;
&lt;br /&gt;
如果您有一些自定义的内容，比如图片或者单位，请建立如下内容：&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;b&amp;gt;&amp;lt;i&amp;gt;userdata&amp;lt;/i&amp;gt;/data/add-ons/A_Simple_Addon/macros&amp;lt;/b&amp;gt;&lt;br /&gt;
*&amp;lt;b&amp;gt;&amp;lt;i&amp;gt;userdata&amp;lt;/i&amp;gt;/data/add-ons/A_Simple_Addon/units&amp;lt;/b&amp;gt;&lt;br /&gt;
*&amp;lt;b&amp;gt;&amp;lt;i&amp;gt;userdata&amp;lt;/i&amp;gt;/data/add-ons/A_Simple_Addon/images&amp;lt;/b&amp;gt;&lt;br /&gt;
*&amp;lt;b&amp;gt;&amp;lt;i&amp;gt;userdata&amp;lt;/i&amp;gt;/data/add-ons/A_Simple_Addon/music&amp;lt;/b&amp;gt;&lt;br /&gt;
*&amp;lt;b&amp;gt;&amp;lt;i&amp;gt;userdata&amp;lt;/i&amp;gt;/data/add-ons/A_Simple_Addon/sounds&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;注意：&amp;lt;/b&amp;gt;您可以命名包含代码的目录（例如 &amp;lt;b&amp;gt;scenarios&amp;lt;/b&amp;gt; 和 &amp;lt;b&amp;gt;macros&amp;lt;/b&amp;gt;）为任意名称，但是三个二进制内容目录（&amp;lt;b&amp;gt;images&amp;lt;/b&amp;gt;、&amp;lt;b&amp;gt;music&amp;lt;/b&amp;gt;、&amp;lt;b&amp;gt;sounds&amp;lt;/b&amp;gt;）&amp;lt;b&amp;gt;必须&amp;lt;/b&amp;gt;是这个名字，并且相对于 [binary_path] 指定的路径。游戏尝试解析图像、音乐、声音路径时，会在 [binary_path] 下查找。&lt;br /&gt;
&lt;br /&gt;
如果您设置了 textdomain，则要建立 &amp;lt;b&amp;gt;translations&amp;lt;/b&amp;gt; 目录，即便是空的也要建立。否则会在 stderr 中生成警告。路径&amp;lt;b&amp;gt;必须&amp;lt;/b&amp;gt;和 [textdomain] 标签指定的一致。&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;b&amp;gt;&amp;lt;i&amp;gt;userdata&amp;lt;/i&amp;gt;/data/add-ons/A_Simple_Addon/translations&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==参见==&lt;br /&gt;
&lt;br /&gt;
* [[Create]]&lt;br /&gt;
* [[BinaryPathWML]]&lt;br /&gt;
* [[BuildingCampaignsTheCampaignFile]]&lt;br /&gt;
* [[WesCamp]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Create]]&lt;/div&gt;</summary>
		<author><name>Vanfans</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.wesnoth.org/index.php?title=AddonStructure/zh-Hans&amp;diff=58238</id>
		<title>AddonStructure/zh-Hans</title>
		<link rel="alternate" type="text/html" href="https://wiki.wesnoth.org/index.php?title=AddonStructure/zh-Hans&amp;diff=58238"/>
		<updated>2017-03-14T16:46:09Z</updated>

		<summary type="html">&lt;p&gt;Vanfans: /* See also */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Create}}&lt;br /&gt;
&lt;br /&gt;
{| {{Prettytable}}&lt;br /&gt;
|-&lt;br /&gt;
!|Other languages:&lt;br /&gt;
[[AddonStructure|English]]&lt;br /&gt;
[[AddonStructure/zh|简体中文]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
如果您想为韦诺创建自定义内容，您需要在 userdata/data/add-ons/ 中设置一个文件夹。如果您没有找到您的 userdata 目录，请阅读[[EditingWesnoth]]章节。本页面将讲解插件的结构。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;这个页面假设您已经了解在哪里找到 userdata 目录。&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== The Main File ==&lt;br /&gt;
&lt;br /&gt;
作为示例，我们建立一个名为 &amp;lt;b&amp;gt;A Simple Addon&amp;lt;/b&amp;gt; 的插件。&lt;br /&gt;
&lt;br /&gt;
*建立一个路径为 &amp;lt;b&amp;gt;&amp;lt;i&amp;gt;userdata&amp;lt;/i&amp;gt;/data/add-ons/A_Simple_Addon&amp;lt;/b&amp;gt; 的空目录。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;重要提示：&amp;lt;/b&amp;gt;所有目录和文件名都要使用下划线而不是空格。否则会无法正常工作。&lt;br /&gt;
&lt;br /&gt;
*在 A_Simple_Addon 文件夹中，建立一个名为 &amp;lt;b&amp;gt;_main.cfg&amp;lt;/b&amp;gt; 的文件。&lt;br /&gt;
&lt;br /&gt;
_main.cfg 文件决定游戏如何加载您的内容。这里展示了一个非常简单的示例。&lt;br /&gt;
&lt;br /&gt;
 #textdomain wesnoth-A_Simple_Addon&lt;br /&gt;
 [textdomain]&lt;br /&gt;
     name=&amp;quot;wesnoth-A_Simple_Addon&amp;quot;&lt;br /&gt;
     path=&amp;quot;data/add-ons/A_Simple_Addon/translations&amp;quot;&lt;br /&gt;
 [/textdomain]&lt;br /&gt;
 &lt;br /&gt;
 #ifdef MULTIPLAYER&lt;br /&gt;
 [binary_path]&lt;br /&gt;
     path=data/add-ons/A_Simple_Addon&lt;br /&gt;
 [/binary_path]&lt;br /&gt;
 &lt;br /&gt;
 {~add-ons/A_Simple_Addon/scenarios}&lt;br /&gt;
 #endif&lt;br /&gt;
&lt;br /&gt;
[textdomain] WML 标签指定了组件中字符串的翻译。textdomain 应该是组件的目录名，需要添加前缀&amp;lt;b&amp;gt;“wesnoth-”&amp;lt;/b&amp;gt;来确保不会和其他文本冲突，并和 [[WesCamp]] 兼容。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;注意：&amp;lt;/b&amp;gt;只有在您的组件需要翻译时，才需要 textdomain。如果是音乐包或者其他情况，并不需要 textdomain。&lt;br /&gt;
&lt;br /&gt;
所有的 [campaign] 和 [textdomain] 标签&amp;lt;b&amp;gt;必须&amp;lt;/b&amp;gt; 包含在 &amp;lt;b&amp;gt;#ifdef&amp;lt;/b&amp;gt; 预处理条件中，包括替换条件（详见 [[PreprocessorRef]]）。这是为了确保您的内容在正确的时间加载，并且不和其他插件冲突。在上面的示例中，您的场景会在多人模式下被加载。在战役中，您可以设置特定标记，让只在战役中被加载。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Note：&amp;lt;/b&amp;gt;只有&amp;lt;b&amp;gt;代码&amp;lt;/b&amp;gt;必须放在这个文件里。您&amp;lt;b&amp;gt;不需要&amp;lt;/b&amp;gt;将二进制内容（例如声音、图片、音乐）放在这里。您可以通过指定相对于 [binary_path] 的路径来引用内容。此外，&amp;lt;b&amp;gt;units&amp;lt;/b&amp;gt; 目录不能通过简单的引用路径；它必须使用 &amp;lt;b&amp;gt;[+units][/units]&amp;lt;/b&amp;gt;（&amp;lt;b&amp;gt;+&amp;lt;/b&amp;gt;非常重要！）标签包裹，就象这样：&lt;br /&gt;
&lt;br /&gt;
 [+units]&lt;br /&gt;
     {~add-ons/A_Simple_Addon/units}&lt;br /&gt;
 [/units]&lt;br /&gt;
&lt;br /&gt;
== The Directory Structure ==&lt;br /&gt;
&lt;br /&gt;
What to create next depend on what type of content you are creating. For example, campaigns or map packs will have &amp;lt;b&amp;gt;scenarios&amp;lt;/b&amp;gt; and &amp;lt;b&amp;gt;maps&amp;lt;/b&amp;gt; directories, while a music pack would have only &amp;lt;b&amp;gt;music&amp;lt;/b&amp;gt;. Here we will assume you are creating a campaign or single-scenario add-on.&lt;br /&gt;
&lt;br /&gt;
Create the following directories:&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;b&amp;gt;&amp;lt;i&amp;gt;userdata&amp;lt;/i&amp;gt;/data/add-ons/A_Simple_Addon/scenarios&amp;lt;/b&amp;gt;&lt;br /&gt;
*&amp;lt;b&amp;gt;&amp;lt;i&amp;gt;userdata&amp;lt;/i&amp;gt;/data/add-ons/A_Simple_Addon/maps&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
场景中使用的所有地图文件都在 &amp;lt;b&amp;gt;maps&amp;lt;/b&amp;gt; 当中（详见[[BuildingMaps]]）。所有场景的的配置文件（.cfg）文件都在 &amp;lt;b&amp;gt;scenarios&amp;lt;/b&amp;gt; 当中（详见[[BuildingScenarios]]）。&lt;br /&gt;
&lt;br /&gt;
如果您有一些自定义的内容，比如图片或者单位，请建立如下内容：&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;b&amp;gt;&amp;lt;i&amp;gt;userdata&amp;lt;/i&amp;gt;/data/add-ons/A_Simple_Addon/macros&amp;lt;/b&amp;gt;&lt;br /&gt;
*&amp;lt;b&amp;gt;&amp;lt;i&amp;gt;userdata&amp;lt;/i&amp;gt;/data/add-ons/A_Simple_Addon/units&amp;lt;/b&amp;gt;&lt;br /&gt;
*&amp;lt;b&amp;gt;&amp;lt;i&amp;gt;userdata&amp;lt;/i&amp;gt;/data/add-ons/A_Simple_Addon/images&amp;lt;/b&amp;gt;&lt;br /&gt;
*&amp;lt;b&amp;gt;&amp;lt;i&amp;gt;userdata&amp;lt;/i&amp;gt;/data/add-ons/A_Simple_Addon/music&amp;lt;/b&amp;gt;&lt;br /&gt;
*&amp;lt;b&amp;gt;&amp;lt;i&amp;gt;userdata&amp;lt;/i&amp;gt;/data/add-ons/A_Simple_Addon/sounds&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;注意：&amp;lt;/b&amp;gt;您可以命名包含代码的目录（例如 &amp;lt;b&amp;gt;scenarios&amp;lt;/b&amp;gt; 和 &amp;lt;b&amp;gt;macros&amp;lt;/b&amp;gt;）为任意名称，但是三个二进制内容目录（&amp;lt;b&amp;gt;images&amp;lt;/b&amp;gt;、&amp;lt;b&amp;gt;music&amp;lt;/b&amp;gt;、&amp;lt;b&amp;gt;sounds&amp;lt;/b&amp;gt;）&amp;lt;b&amp;gt;必须&amp;lt;/b&amp;gt;是这个名字，并且相对于 [binary_path] 指定的路径。游戏尝试解析图像、音乐、声音路径时，会在 [binary_path] 下查找。&lt;br /&gt;
&lt;br /&gt;
如果您设置了 textdomain，则要建立 &amp;lt;b&amp;gt;translations&amp;lt;/b&amp;gt; 目录，即便是空的也要建立。否则会在 stderr 中生成警告。路径&amp;lt;b&amp;gt;必须&amp;lt;/b&amp;gt;和 [textdomain] 标签指定的一致。&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;b&amp;gt;&amp;lt;i&amp;gt;userdata&amp;lt;/i&amp;gt;/data/add-ons/A_Simple_Addon/translations&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==参见==&lt;br /&gt;
&lt;br /&gt;
* [[Create]]&lt;br /&gt;
* [[BinaryPathWML]]&lt;br /&gt;
* [[BuildingCampaignsTheCampaignFile]]&lt;br /&gt;
* [[WesCamp]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Create]]&lt;/div&gt;</summary>
		<author><name>Vanfans</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.wesnoth.org/index.php?title=Create/zh-Hans&amp;diff=58230</id>
		<title>Create/zh-Hans</title>
		<link rel="alternate" type="text/html" href="https://wiki.wesnoth.org/index.php?title=Create/zh-Hans&amp;diff=58230"/>
		<updated>2017-03-13T14:20:17Z</updated>

		<summary type="html">&lt;p&gt;Vanfans: /* 我能创作什么，如何创作？ */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Create/Translations}}&lt;br /&gt;
{| style=&amp;quot;float:right&amp;quot;&lt;br /&gt;
|&lt;br /&gt;
__TOC__&lt;br /&gt;
|}&lt;br /&gt;
对创作自己的场景和战役感兴趣？韦诺最引人入胜的特点之一就是它的可扩展性。&lt;br /&gt;
玩家可以创建新地图、单位、种族、场景、图像、音乐甚至完整的战役。&lt;br /&gt;
&lt;br /&gt;
接触游戏的”内部秘密“既是简单又是困难的； 你只需要一个 UTF-8文本编辑器就足以创建你自己的世界。不过学习韦诺标记语言Wesnoth Markup Language (WML)很耗费精力。本章将会指引创作和发布你自己的内容的过程。&lt;br /&gt;
&lt;br /&gt;
同时要注意的是，'''在韦诺核心的美工方面我们需要大量帮助。'''  我们正在工作的非即时项目表[http://www.wesnoth.org/forum/viewtopic.php?t=2014&amp;amp;start=0&amp;amp;postdays=0&amp;amp;postorder=asc&amp;amp;highlight= 列于此]. 如果你也把自己的问题放在里面，我们很乐于帮助你。&lt;br /&gt;
&lt;br /&gt;
== 先读这个！ ==&lt;br /&gt;
在你修改或在添加任何东西前， 去了解游戏如何储存和组织数据是很重要的。这篇文章会解释游戏目录结构，并介绍”用户数据userdata“ 目录。 &lt;br /&gt;
* [[EditingWesnoth|编辑韦诺]]&lt;br /&gt;
&lt;br /&gt;
== 我能创作什么，如何创作？==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- artisticdude: As of 2/4/12, the screenshot was updated to 1.10 (it had been at least 1.6, possibly even earlier). Links to previous screenshots (main image and thumb): http://www.wesnoth.org/images/sshots/wesnoth-1.4-4.jpg http://www.wesnoth.org/images/sshots/wesnoth-1.4-4-175.jpg --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;thumb tright&amp;quot;&amp;gt;&amp;lt;div&amp;gt;&lt;br /&gt;
[http://img837.imageshack.us/img837/865/screenshot20120205at529.png http://img26.imageshack.us/img26/8613/thumbhav.png]&lt;br /&gt;
&amp;lt;div class=&amp;quot;thumbcaption&amp;quot;&amp;gt;韦诺之战 1.10 地图编辑器&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* [[WML_for_Complete_Beginners|WML教程]] - WML的介绍（未完成）&lt;br /&gt;
* [[BuildingMaps|地图]] - 地砖式的地形布局&lt;br /&gt;
&lt;br /&gt;
* [[BuildingScenarios|场景]] - 场景就是让地图上的事情发生，让它可以玩&lt;br /&gt;
* [[BuildingCampaigns|战役]] - 把场景组织起来成为战役&lt;br /&gt;
* [[MultiplayerContent|多人游戏战役]] - 使战役用在多人游戏里  '''(过时)'''&lt;br /&gt;
* [[BuildingUnits|单位]]&lt;br /&gt;
* [[BuildingFactions|多人游戏派系和时代]]&lt;br /&gt;
&lt;br /&gt;
* [[Create Art|美工]] - 和'''教程'''一起工作！&lt;br /&gt;
* [[Create Music|音乐]]&lt;br /&gt;
* [[Create Writing|写作]]&lt;br /&gt;
* [[WesnothTranslations|翻译]] - 进行韦诺的翻译工作&lt;br /&gt;
* [[Practical Guide to Modifying AI Behavior|电脑AI]] - 怎样创建和改变AI行为 &lt;br /&gt;
&lt;br /&gt;
* [[Distributing content|发布内容]] - 关于战役服务器&lt;br /&gt;
* [[Authoring tools|创作工具]] -  帮助你编写战役WML的工具&lt;br /&gt;
* [[Maintenance tools|维护工具]] - 帮你全面检查和维护战役的工具&lt;br /&gt;
&amp;lt;!-- artisticdude: This next link serves no real purpose, it can probably be deleted entirely. For now, I'm hiding it as a comment. --&amp;gt;&lt;br /&gt;
&amp;lt;!-- * [[Clueless Guides]] - half-baked guides that wait for improvement --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== 其他人做了什么？ ==&lt;br /&gt;
&lt;br /&gt;
在[http://www.wesnoth.org/forum 韦诺论坛]上有众多的多人游戏派系和时代、多人游戏地图和战役讨论。&lt;br /&gt;
* [http://forums.wesnoth.org/viewforum.php?f=19 派系和时代开发论坛]&lt;br /&gt;
* [http://www.wesnoth.org/forum/viewforum.php?f=15 多人游戏开发论坛]&lt;br /&gt;
* [http://www.wesnoth.org/forum/viewforum.php?f=8 场景和战役开发论坛]&lt;br /&gt;
* [[Faction|完整的派系列表]]&lt;br /&gt;
&lt;br /&gt;
如果你不是想要创作一整个新战役，查看这个帖子[http://www.wesnoth.org/forum/viewtopic.php?t=17171  遗弃的战役]。 你可以从中挑选一个然后完成它，比做一个全新的战役轻松得多。&lt;br /&gt;
&lt;br /&gt;
== 韦诺的世界 ==&lt;br /&gt;
不是所有战役都发生在韦诺，不过大多数是。让战役发生在韦诺世界里一定很有味道。挑选一个时期或地图上的位置，再来创作故事。&lt;br /&gt;
* [[Timeline of Wesnoth|韦诺时间线]]&lt;br /&gt;
* [[Geography of Wesnoth/zh-Hans|韦诺地理学]]&lt;br /&gt;
* [[Races|韦诺的生物种族]]&lt;br /&gt;
* [[Poetry of Wesnoth|韦诺的诗歌]]&lt;br /&gt;
&lt;br /&gt;
== 杂项 ==&lt;br /&gt;
* [[ExternalUtilities|外部工具]] - 一些额外的工具帮助创作&lt;br /&gt;
* [[ReferenceWML|WML参考]] - 快捷链接&lt;br /&gt;
* [[FAQ#Maps.2C_Scenarios_and_Campaigns|常见问题]] - 如果你有问题，发个帖子吧&lt;br /&gt;
* 插件服务器 [http://addons.wesnoth.org 网页界面] - 下载用户自制内容的一个可选方式&lt;br /&gt;
&lt;br /&gt;
[[Category:Create|*]]&lt;/div&gt;</summary>
		<author><name>Vanfans</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.wesnoth.org/index.php?title=AddonStructure/zh-Hans&amp;diff=58229</id>
		<title>AddonStructure/zh-Hans</title>
		<link rel="alternate" type="text/html" href="https://wiki.wesnoth.org/index.php?title=AddonStructure/zh-Hans&amp;diff=58229"/>
		<updated>2017-03-13T13:20:36Z</updated>

		<summary type="html">&lt;p&gt;Vanfans: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Create}}&lt;br /&gt;
&lt;br /&gt;
{| {{Prettytable}}&lt;br /&gt;
|-&lt;br /&gt;
!|Other languages:&lt;br /&gt;
[[AddonStructure|English]]&lt;br /&gt;
[[AddonStructure/zh|简体中文]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
如果您想为韦诺创建自定义内容，您需要在 userdata/data/add-ons/ 中设置一个文件夹。如果您没有找到您的 userdata 目录，请阅读[[EditingWesnoth]]章节。本页面将讲解插件的结构。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;这个页面假设您已经了解在哪里找到 userdata 目录。&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== The Main File ==&lt;br /&gt;
&lt;br /&gt;
作为示例，我们建立一个名为 &amp;lt;b&amp;gt;A Simple Addon&amp;lt;/b&amp;gt; 的插件。&lt;br /&gt;
&lt;br /&gt;
*建立一个路径为 &amp;lt;b&amp;gt;&amp;lt;i&amp;gt;userdata&amp;lt;/i&amp;gt;/data/add-ons/A_Simple_Addon&amp;lt;/b&amp;gt; 的空目录。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;重要提示：&amp;lt;/b&amp;gt;所有目录和文件名都要使用下划线而不是空格。否则会无法正常工作。&lt;br /&gt;
&lt;br /&gt;
*在 A_Simple_Addon 文件夹中，建立一个名为 &amp;lt;b&amp;gt;_main.cfg&amp;lt;/b&amp;gt; 的文件。&lt;br /&gt;
&lt;br /&gt;
_main.cfg 文件决定游戏如何加载您的内容。这里展示了一个非常简单的示例。&lt;br /&gt;
&lt;br /&gt;
 #textdomain wesnoth-A_Simple_Addon&lt;br /&gt;
 [textdomain]&lt;br /&gt;
     name=&amp;quot;wesnoth-A_Simple_Addon&amp;quot;&lt;br /&gt;
     path=&amp;quot;data/add-ons/A_Simple_Addon/translations&amp;quot;&lt;br /&gt;
 [/textdomain]&lt;br /&gt;
 &lt;br /&gt;
 #ifdef MULTIPLAYER&lt;br /&gt;
 [binary_path]&lt;br /&gt;
     path=data/add-ons/A_Simple_Addon&lt;br /&gt;
 [/binary_path]&lt;br /&gt;
 &lt;br /&gt;
 {~add-ons/A_Simple_Addon/scenarios}&lt;br /&gt;
 #endif&lt;br /&gt;
&lt;br /&gt;
[textdomain] WML 标签指定了组件中字符串的翻译。textdomain 应该是组件的目录名，需要添加前缀&amp;lt;b&amp;gt;“wesnoth-”&amp;lt;/b&amp;gt;来确保不会和其他文本冲突，并和 [[WesCamp]] 兼容。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;注意：&amp;lt;/b&amp;gt;只有在您的组件需要翻译时，才需要 textdomain。如果是音乐包或者其他情况，并不需要 textdomain。&lt;br /&gt;
&lt;br /&gt;
所有的 [campaign] 和 [textdomain] 标签&amp;lt;b&amp;gt;必须&amp;lt;/b&amp;gt; 包含在 &amp;lt;b&amp;gt;#ifdef&amp;lt;/b&amp;gt; 预处理条件中，包括替换条件（详见 [[PreprocessorRef]]）。这是为了确保您的内容在正确的时间加载，并且不和其他插件冲突。在上面的示例中，您的场景会在多人模式下被加载。在战役中，您可以设置特定标记，让只在战役中被加载。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Note：&amp;lt;/b&amp;gt;只有&amp;lt;b&amp;gt;代码&amp;lt;/b&amp;gt;必须放在这个文件里。您&amp;lt;b&amp;gt;不需要&amp;lt;/b&amp;gt;将二进制内容（例如声音、图片、音乐）放在这里。您可以通过指定相对于 [binary_path] 的路径来引用内容。此外，&amp;lt;b&amp;gt;units&amp;lt;/b&amp;gt; 目录不能通过简单的引用路径；它必须使用 &amp;lt;b&amp;gt;[+units][/units]&amp;lt;/b&amp;gt;（&amp;lt;b&amp;gt;+&amp;lt;/b&amp;gt;非常重要！）标签包裹，就象这样：&lt;br /&gt;
&lt;br /&gt;
 [+units]&lt;br /&gt;
     {~add-ons/A_Simple_Addon/units}&lt;br /&gt;
 [/units]&lt;br /&gt;
&lt;br /&gt;
== The Directory Structure ==&lt;br /&gt;
&lt;br /&gt;
What to create next depend on what type of content you are creating. For example, campaigns or map packs will have &amp;lt;b&amp;gt;scenarios&amp;lt;/b&amp;gt; and &amp;lt;b&amp;gt;maps&amp;lt;/b&amp;gt; directories, while a music pack would have only &amp;lt;b&amp;gt;music&amp;lt;/b&amp;gt;. Here we will assume you are creating a campaign or single-scenario add-on.&lt;br /&gt;
&lt;br /&gt;
Create the following directories:&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;b&amp;gt;&amp;lt;i&amp;gt;userdata&amp;lt;/i&amp;gt;/data/add-ons/A_Simple_Addon/scenarios&amp;lt;/b&amp;gt;&lt;br /&gt;
*&amp;lt;b&amp;gt;&amp;lt;i&amp;gt;userdata&amp;lt;/i&amp;gt;/data/add-ons/A_Simple_Addon/maps&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
场景中使用的所有地图文件都在 &amp;lt;b&amp;gt;maps&amp;lt;/b&amp;gt; 当中（详见[[BuildingMaps]]）。所有场景的的配置文件（.cfg）文件都在 &amp;lt;b&amp;gt;scenarios&amp;lt;/b&amp;gt; 当中（详见[[BuildingScenarios]]）。&lt;br /&gt;
&lt;br /&gt;
如果您有一些自定义的内容，比如图片或者单位，请建立如下内容：&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;b&amp;gt;&amp;lt;i&amp;gt;userdata&amp;lt;/i&amp;gt;/data/add-ons/A_Simple_Addon/macros&amp;lt;/b&amp;gt;&lt;br /&gt;
*&amp;lt;b&amp;gt;&amp;lt;i&amp;gt;userdata&amp;lt;/i&amp;gt;/data/add-ons/A_Simple_Addon/units&amp;lt;/b&amp;gt;&lt;br /&gt;
*&amp;lt;b&amp;gt;&amp;lt;i&amp;gt;userdata&amp;lt;/i&amp;gt;/data/add-ons/A_Simple_Addon/images&amp;lt;/b&amp;gt;&lt;br /&gt;
*&amp;lt;b&amp;gt;&amp;lt;i&amp;gt;userdata&amp;lt;/i&amp;gt;/data/add-ons/A_Simple_Addon/music&amp;lt;/b&amp;gt;&lt;br /&gt;
*&amp;lt;b&amp;gt;&amp;lt;i&amp;gt;userdata&amp;lt;/i&amp;gt;/data/add-ons/A_Simple_Addon/sounds&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;注意：&amp;lt;/b&amp;gt;您可以命名包含代码的目录（例如 &amp;lt;b&amp;gt;scenarios&amp;lt;/b&amp;gt; 和 &amp;lt;b&amp;gt;macros&amp;lt;/b&amp;gt;）为任意名称，但是三个二进制内容目录（&amp;lt;b&amp;gt;images&amp;lt;/b&amp;gt;、&amp;lt;b&amp;gt;music&amp;lt;/b&amp;gt;、&amp;lt;b&amp;gt;sounds&amp;lt;/b&amp;gt;）&amp;lt;b&amp;gt;必须&amp;lt;/b&amp;gt;是这个名字，并且相对于 [binary_path] 指定的路径。游戏尝试解析图像、音乐、声音路径时，会在 [binary_path] 下查找。&lt;br /&gt;
&lt;br /&gt;
如果您设置了 textdomain，则要建立 &amp;lt;b&amp;gt;translations&amp;lt;/b&amp;gt; 目录，即便是空的也要建立。否则会在 stderr 中生成警告。路径&amp;lt;b&amp;gt;必须&amp;lt;/b&amp;gt;和 [textdomain] 标签指定的一致。&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;b&amp;gt;&amp;lt;i&amp;gt;userdata&amp;lt;/i&amp;gt;/data/add-ons/A_Simple_Addon/translations&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
&lt;br /&gt;
* [[Create]]&lt;br /&gt;
* [[BinaryPathWML]]&lt;br /&gt;
* [[BuildingCampaignsTheCampaignFile]]&lt;br /&gt;
* [[WesCamp]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Create]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;注意！&amp;lt;/b&amp;gt;译文质量不佳。&lt;/div&gt;</summary>
		<author><name>Vanfans</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.wesnoth.org/index.php?title=AddonStructure/zh-Hans&amp;diff=58228</id>
		<title>AddonStructure/zh-Hans</title>
		<link rel="alternate" type="text/html" href="https://wiki.wesnoth.org/index.php?title=AddonStructure/zh-Hans&amp;diff=58228"/>
		<updated>2017-03-13T13:19:29Z</updated>

		<summary type="html">&lt;p&gt;Vanfans: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{AddonStructure/zh}}&lt;br /&gt;
&lt;br /&gt;
{| {{Prettytable}}&lt;br /&gt;
|-&lt;br /&gt;
!|Other languages:&lt;br /&gt;
[[AddonStructure|English]]&lt;br /&gt;
[[AddonStructure/zh|简体中文]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
如果您想为韦诺创建自定义内容，您需要在 userdata/data/add-ons/ 中设置一个文件夹。如果您没有找到您的 userdata 目录，请阅读[[EditingWesnoth]]章节。本页面将讲解插件的结构。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;这个页面假设您已经了解在哪里找到 userdata 目录。&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== The Main File ==&lt;br /&gt;
&lt;br /&gt;
作为示例，我们建立一个名为 &amp;lt;b&amp;gt;A Simple Addon&amp;lt;/b&amp;gt; 的插件。&lt;br /&gt;
&lt;br /&gt;
*建立一个路径为 &amp;lt;b&amp;gt;&amp;lt;i&amp;gt;userdata&amp;lt;/i&amp;gt;/data/add-ons/A_Simple_Addon&amp;lt;/b&amp;gt; 的空目录。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;重要提示：&amp;lt;/b&amp;gt;所有目录和文件名都要使用下划线而不是空格。否则会无法正常工作。&lt;br /&gt;
&lt;br /&gt;
*在 A_Simple_Addon 文件夹中，建立一个名为 &amp;lt;b&amp;gt;_main.cfg&amp;lt;/b&amp;gt; 的文件。&lt;br /&gt;
&lt;br /&gt;
_main.cfg 文件决定游戏如何加载您的内容。这里展示了一个非常简单的示例。&lt;br /&gt;
&lt;br /&gt;
 #textdomain wesnoth-A_Simple_Addon&lt;br /&gt;
 [textdomain]&lt;br /&gt;
     name=&amp;quot;wesnoth-A_Simple_Addon&amp;quot;&lt;br /&gt;
     path=&amp;quot;data/add-ons/A_Simple_Addon/translations&amp;quot;&lt;br /&gt;
 [/textdomain]&lt;br /&gt;
 &lt;br /&gt;
 #ifdef MULTIPLAYER&lt;br /&gt;
 [binary_path]&lt;br /&gt;
     path=data/add-ons/A_Simple_Addon&lt;br /&gt;
 [/binary_path]&lt;br /&gt;
 &lt;br /&gt;
 {~add-ons/A_Simple_Addon/scenarios}&lt;br /&gt;
 #endif&lt;br /&gt;
&lt;br /&gt;
[textdomain] WML 标签指定了组件中字符串的翻译。textdomain 应该是组件的目录名，需要添加前缀&amp;lt;b&amp;gt;“wesnoth-”&amp;lt;/b&amp;gt;来确保不会和其他文本冲突，并和 [[WesCamp]] 兼容。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;注意：&amp;lt;/b&amp;gt;只有在您的组件需要翻译时，才需要 textdomain。如果是音乐包或者其他情况，并不需要 textdomain。&lt;br /&gt;
&lt;br /&gt;
所有的 [campaign] 和 [textdomain] 标签&amp;lt;b&amp;gt;必须&amp;lt;/b&amp;gt; 包含在 &amp;lt;b&amp;gt;#ifdef&amp;lt;/b&amp;gt; 预处理条件中，包括替换条件（详见 [[PreprocessorRef]]）。这是为了确保您的内容在正确的时间加载，并且不和其他插件冲突。在上面的示例中，您的场景会在多人模式下被加载。在战役中，您可以设置特定标记，让只在战役中被加载。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Note：&amp;lt;/b&amp;gt;只有&amp;lt;b&amp;gt;代码&amp;lt;/b&amp;gt;必须放在这个文件里。您&amp;lt;b&amp;gt;不需要&amp;lt;/b&amp;gt;将二进制内容（例如声音、图片、音乐）放在这里。您可以通过指定相对于 [binary_path] 的路径来引用内容。此外，&amp;lt;b&amp;gt;units&amp;lt;/b&amp;gt; 目录不能通过简单的引用路径；它必须使用 &amp;lt;b&amp;gt;[+units][/units]&amp;lt;/b&amp;gt;（&amp;lt;b&amp;gt;+&amp;lt;/b&amp;gt;非常重要！）标签包裹，就象这样：&lt;br /&gt;
&lt;br /&gt;
 [+units]&lt;br /&gt;
     {~add-ons/A_Simple_Addon/units}&lt;br /&gt;
 [/units]&lt;br /&gt;
&lt;br /&gt;
== The Directory Structure ==&lt;br /&gt;
&lt;br /&gt;
What to create next depend on what type of content you are creating. For example, campaigns or map packs will have &amp;lt;b&amp;gt;scenarios&amp;lt;/b&amp;gt; and &amp;lt;b&amp;gt;maps&amp;lt;/b&amp;gt; directories, while a music pack would have only &amp;lt;b&amp;gt;music&amp;lt;/b&amp;gt;. Here we will assume you are creating a campaign or single-scenario add-on.&lt;br /&gt;
&lt;br /&gt;
Create the following directories:&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;b&amp;gt;&amp;lt;i&amp;gt;userdata&amp;lt;/i&amp;gt;/data/add-ons/A_Simple_Addon/scenarios&amp;lt;/b&amp;gt;&lt;br /&gt;
*&amp;lt;b&amp;gt;&amp;lt;i&amp;gt;userdata&amp;lt;/i&amp;gt;/data/add-ons/A_Simple_Addon/maps&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
场景中使用的所有地图文件都在 &amp;lt;b&amp;gt;maps&amp;lt;/b&amp;gt; 当中（详见[[BuildingMaps]]）。所有场景的的配置文件（.cfg）文件都在 &amp;lt;b&amp;gt;scenarios&amp;lt;/b&amp;gt; 当中（详见[[BuildingScenarios]]）。&lt;br /&gt;
&lt;br /&gt;
如果您有一些自定义的内容，比如图片或者单位，请建立如下内容：&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;b&amp;gt;&amp;lt;i&amp;gt;userdata&amp;lt;/i&amp;gt;/data/add-ons/A_Simple_Addon/macros&amp;lt;/b&amp;gt;&lt;br /&gt;
*&amp;lt;b&amp;gt;&amp;lt;i&amp;gt;userdata&amp;lt;/i&amp;gt;/data/add-ons/A_Simple_Addon/units&amp;lt;/b&amp;gt;&lt;br /&gt;
*&amp;lt;b&amp;gt;&amp;lt;i&amp;gt;userdata&amp;lt;/i&amp;gt;/data/add-ons/A_Simple_Addon/images&amp;lt;/b&amp;gt;&lt;br /&gt;
*&amp;lt;b&amp;gt;&amp;lt;i&amp;gt;userdata&amp;lt;/i&amp;gt;/data/add-ons/A_Simple_Addon/music&amp;lt;/b&amp;gt;&lt;br /&gt;
*&amp;lt;b&amp;gt;&amp;lt;i&amp;gt;userdata&amp;lt;/i&amp;gt;/data/add-ons/A_Simple_Addon/sounds&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;注意：&amp;lt;/b&amp;gt;您可以命名包含代码的目录（例如 &amp;lt;b&amp;gt;scenarios&amp;lt;/b&amp;gt; 和 &amp;lt;b&amp;gt;macros&amp;lt;/b&amp;gt;）为任意名称，但是三个二进制内容目录（&amp;lt;b&amp;gt;images&amp;lt;/b&amp;gt;、&amp;lt;b&amp;gt;music&amp;lt;/b&amp;gt;、&amp;lt;b&amp;gt;sounds&amp;lt;/b&amp;gt;）&amp;lt;b&amp;gt;必须&amp;lt;/b&amp;gt;是这个名字，并且相对于 [binary_path] 指定的路径。游戏尝试解析图像、音乐、声音路径时，会在 [binary_path] 下查找。&lt;br /&gt;
&lt;br /&gt;
如果您设置了 textdomain，则要建立 &amp;lt;b&amp;gt;translations&amp;lt;/b&amp;gt; 目录，即便是空的也要建立。否则会在 stderr 中生成警告。路径&amp;lt;b&amp;gt;必须&amp;lt;/b&amp;gt;和 [textdomain] 标签指定的一致。&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;b&amp;gt;&amp;lt;i&amp;gt;userdata&amp;lt;/i&amp;gt;/data/add-ons/A_Simple_Addon/translations&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
&lt;br /&gt;
* [[Create]]&lt;br /&gt;
* [[BinaryPathWML]]&lt;br /&gt;
* [[BuildingCampaignsTheCampaignFile]]&lt;br /&gt;
* [[WesCamp]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Create]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;注意！&amp;lt;/b&amp;gt;译文质量不佳。&lt;/div&gt;</summary>
		<author><name>Vanfans</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.wesnoth.org/index.php?title=AddonStructure/zh-Hans&amp;diff=58227</id>
		<title>AddonStructure/zh-Hans</title>
		<link rel="alternate" type="text/html" href="https://wiki.wesnoth.org/index.php?title=AddonStructure/zh-Hans&amp;diff=58227"/>
		<updated>2017-03-13T13:18:02Z</updated>

		<summary type="html">&lt;p&gt;Vanfans: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Create/Translations}}&lt;br /&gt;
&lt;br /&gt;
{| {{Prettytable}}&lt;br /&gt;
|-&lt;br /&gt;
!|Other languages:&lt;br /&gt;
[[AddonStructure|English]]&lt;br /&gt;
[[AddonStructure/zh|简体中文]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
如果您想为韦诺创建自定义内容，您需要在 userdata/data/add-ons/ 中设置一个文件夹。如果您没有找到您的 userdata 目录，请阅读[[EditingWesnoth]]章节。本页面将讲解插件的结构。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;这个页面假设您已经了解在哪里找到 userdata 目录。&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== The Main File ==&lt;br /&gt;
&lt;br /&gt;
作为示例，我们建立一个名为 &amp;lt;b&amp;gt;A Simple Addon&amp;lt;/b&amp;gt; 的插件。&lt;br /&gt;
&lt;br /&gt;
*建立一个路径为 &amp;lt;b&amp;gt;&amp;lt;i&amp;gt;userdata&amp;lt;/i&amp;gt;/data/add-ons/A_Simple_Addon&amp;lt;/b&amp;gt; 的空目录。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;重要提示：&amp;lt;/b&amp;gt;所有目录和文件名都要使用下划线而不是空格。否则会无法正常工作。&lt;br /&gt;
&lt;br /&gt;
*在 A_Simple_Addon 文件夹中，建立一个名为 &amp;lt;b&amp;gt;_main.cfg&amp;lt;/b&amp;gt; 的文件。&lt;br /&gt;
&lt;br /&gt;
_main.cfg 文件决定游戏如何加载您的内容。这里展示了一个非常简单的示例。&lt;br /&gt;
&lt;br /&gt;
 #textdomain wesnoth-A_Simple_Addon&lt;br /&gt;
 [textdomain]&lt;br /&gt;
     name=&amp;quot;wesnoth-A_Simple_Addon&amp;quot;&lt;br /&gt;
     path=&amp;quot;data/add-ons/A_Simple_Addon/translations&amp;quot;&lt;br /&gt;
 [/textdomain]&lt;br /&gt;
 &lt;br /&gt;
 #ifdef MULTIPLAYER&lt;br /&gt;
 [binary_path]&lt;br /&gt;
     path=data/add-ons/A_Simple_Addon&lt;br /&gt;
 [/binary_path]&lt;br /&gt;
 &lt;br /&gt;
 {~add-ons/A_Simple_Addon/scenarios}&lt;br /&gt;
 #endif&lt;br /&gt;
&lt;br /&gt;
[textdomain] WML 标签指定了组件中字符串的翻译。textdomain 应该是组件的目录名，需要添加前缀&amp;lt;b&amp;gt;“wesnoth-”&amp;lt;/b&amp;gt;来确保不会和其他文本冲突，并和 [[WesCamp]] 兼容。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;注意：&amp;lt;/b&amp;gt;只有在您的组件需要翻译时，才需要 textdomain。如果是音乐包或者其他情况，并不需要 textdomain。&lt;br /&gt;
&lt;br /&gt;
所有的 [campaign] 和 [textdomain] 标签&amp;lt;b&amp;gt;必须&amp;lt;/b&amp;gt; 包含在 &amp;lt;b&amp;gt;#ifdef&amp;lt;/b&amp;gt; 预处理条件中，包括替换条件（详见 [[PreprocessorRef]]）。这是为了确保您的内容在正确的时间加载，并且不和其他插件冲突。在上面的示例中，您的场景会在多人模式下被加载。在战役中，您可以设置特定标记，让只在战役中被加载。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Note：&amp;lt;/b&amp;gt;只有&amp;lt;b&amp;gt;代码&amp;lt;/b&amp;gt;必须放在这个文件里。您&amp;lt;b&amp;gt;不需要&amp;lt;/b&amp;gt;将二进制内容（例如声音、图片、音乐）放在这里。您可以通过指定相对于 [binary_path] 的路径来引用内容。此外，&amp;lt;b&amp;gt;units&amp;lt;/b&amp;gt; 目录不能通过简单的引用路径；它必须使用 &amp;lt;b&amp;gt;[+units][/units]&amp;lt;/b&amp;gt;（&amp;lt;b&amp;gt;+&amp;lt;/b&amp;gt;非常重要！）标签包裹，就象这样：&lt;br /&gt;
&lt;br /&gt;
 [+units]&lt;br /&gt;
     {~add-ons/A_Simple_Addon/units}&lt;br /&gt;
 [/units]&lt;br /&gt;
&lt;br /&gt;
== The Directory Structure ==&lt;br /&gt;
&lt;br /&gt;
What to create next depend on what type of content you are creating. For example, campaigns or map packs will have &amp;lt;b&amp;gt;scenarios&amp;lt;/b&amp;gt; and &amp;lt;b&amp;gt;maps&amp;lt;/b&amp;gt; directories, while a music pack would have only &amp;lt;b&amp;gt;music&amp;lt;/b&amp;gt;. Here we will assume you are creating a campaign or single-scenario add-on.&lt;br /&gt;
&lt;br /&gt;
Create the following directories:&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;b&amp;gt;&amp;lt;i&amp;gt;userdata&amp;lt;/i&amp;gt;/data/add-ons/A_Simple_Addon/scenarios&amp;lt;/b&amp;gt;&lt;br /&gt;
*&amp;lt;b&amp;gt;&amp;lt;i&amp;gt;userdata&amp;lt;/i&amp;gt;/data/add-ons/A_Simple_Addon/maps&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
场景中使用的所有地图文件都在 &amp;lt;b&amp;gt;maps&amp;lt;/b&amp;gt; 当中（详见[[BuildingMaps]]）。所有场景的的配置文件（.cfg）文件都在 &amp;lt;b&amp;gt;scenarios&amp;lt;/b&amp;gt; 当中（详见[[BuildingScenarios]]）。&lt;br /&gt;
&lt;br /&gt;
如果您有一些自定义的内容，比如图片或者单位，请建立如下内容：&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;b&amp;gt;&amp;lt;i&amp;gt;userdata&amp;lt;/i&amp;gt;/data/add-ons/A_Simple_Addon/macros&amp;lt;/b&amp;gt;&lt;br /&gt;
*&amp;lt;b&amp;gt;&amp;lt;i&amp;gt;userdata&amp;lt;/i&amp;gt;/data/add-ons/A_Simple_Addon/units&amp;lt;/b&amp;gt;&lt;br /&gt;
*&amp;lt;b&amp;gt;&amp;lt;i&amp;gt;userdata&amp;lt;/i&amp;gt;/data/add-ons/A_Simple_Addon/images&amp;lt;/b&amp;gt;&lt;br /&gt;
*&amp;lt;b&amp;gt;&amp;lt;i&amp;gt;userdata&amp;lt;/i&amp;gt;/data/add-ons/A_Simple_Addon/music&amp;lt;/b&amp;gt;&lt;br /&gt;
*&amp;lt;b&amp;gt;&amp;lt;i&amp;gt;userdata&amp;lt;/i&amp;gt;/data/add-ons/A_Simple_Addon/sounds&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;注意：&amp;lt;/b&amp;gt;您可以命名包含代码的目录（例如 &amp;lt;b&amp;gt;scenarios&amp;lt;/b&amp;gt; 和 &amp;lt;b&amp;gt;macros&amp;lt;/b&amp;gt;）为任意名称，但是三个二进制内容目录（&amp;lt;b&amp;gt;images&amp;lt;/b&amp;gt;、&amp;lt;b&amp;gt;music&amp;lt;/b&amp;gt;、&amp;lt;b&amp;gt;sounds&amp;lt;/b&amp;gt;）&amp;lt;b&amp;gt;必须&amp;lt;/b&amp;gt;是这个名字，并且相对于 [binary_path] 指定的路径。游戏尝试解析图像、音乐、声音路径时，会在 [binary_path] 下查找。&lt;br /&gt;
&lt;br /&gt;
如果您设置了 textdomain，则要建立 &amp;lt;b&amp;gt;translations&amp;lt;/b&amp;gt; 目录，即便是空的也要建立。否则会在 stderr 中生成警告。路径&amp;lt;b&amp;gt;必须&amp;lt;/b&amp;gt;和 [textdomain] 标签指定的一致。&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;b&amp;gt;&amp;lt;i&amp;gt;userdata&amp;lt;/i&amp;gt;/data/add-ons/A_Simple_Addon/translations&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
&lt;br /&gt;
* [[Create]]&lt;br /&gt;
* [[BinaryPathWML]]&lt;br /&gt;
* [[BuildingCampaignsTheCampaignFile]]&lt;br /&gt;
* [[WesCamp]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Create]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;注意！&amp;lt;/b&amp;gt;译文质量不佳。&lt;/div&gt;</summary>
		<author><name>Vanfans</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.wesnoth.org/index.php?title=AddonStructure/zh-Hans&amp;diff=58226</id>
		<title>AddonStructure/zh-Hans</title>
		<link rel="alternate" type="text/html" href="https://wiki.wesnoth.org/index.php?title=AddonStructure/zh-Hans&amp;diff=58226"/>
		<updated>2017-03-13T13:15:45Z</updated>

		<summary type="html">&lt;p&gt;Vanfans: Created page with &amp;quot;{{Create}}  {| {{Prettytable}} |- !|Other languages: English 简体中文 |}  如果您想为韦诺创建自定义内容，您需要...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Create}}&lt;br /&gt;
&lt;br /&gt;
{| {{Prettytable}}&lt;br /&gt;
|-&lt;br /&gt;
!|Other languages:&lt;br /&gt;
[[AddonStructure|English]]&lt;br /&gt;
[[AddonStructure/zh|简体中文]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
如果您想为韦诺创建自定义内容，您需要在 userdata/data/add-ons/ 中设置一个文件夹。如果您没有找到您的 userdata 目录，请阅读[[EditingWesnoth]]章节。本页面将讲解插件的结构。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;这个页面假设您已经了解在哪里找到 userdata 目录。&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== The Main File ==&lt;br /&gt;
&lt;br /&gt;
作为示例，我们建立一个名为 &amp;lt;b&amp;gt;A Simple Addon&amp;lt;/b&amp;gt; 的插件。&lt;br /&gt;
&lt;br /&gt;
*建立一个路径为 &amp;lt;b&amp;gt;&amp;lt;i&amp;gt;userdata&amp;lt;/i&amp;gt;/data/add-ons/A_Simple_Addon&amp;lt;/b&amp;gt; 的空目录。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;重要提示：&amp;lt;/b&amp;gt;所有目录和文件名都要使用下划线而不是空格。否则会无法正常工作。&lt;br /&gt;
&lt;br /&gt;
*在 A_Simple_Addon 文件夹中，建立一个名为 &amp;lt;b&amp;gt;_main.cfg&amp;lt;/b&amp;gt; 的文件。&lt;br /&gt;
&lt;br /&gt;
_main.cfg 文件决定游戏如何加载您的内容。这里展示了一个非常简单的示例。&lt;br /&gt;
&lt;br /&gt;
 #textdomain wesnoth-A_Simple_Addon&lt;br /&gt;
 [textdomain]&lt;br /&gt;
     name=&amp;quot;wesnoth-A_Simple_Addon&amp;quot;&lt;br /&gt;
     path=&amp;quot;data/add-ons/A_Simple_Addon/translations&amp;quot;&lt;br /&gt;
 [/textdomain]&lt;br /&gt;
 &lt;br /&gt;
 #ifdef MULTIPLAYER&lt;br /&gt;
 [binary_path]&lt;br /&gt;
     path=data/add-ons/A_Simple_Addon&lt;br /&gt;
 [/binary_path]&lt;br /&gt;
 &lt;br /&gt;
 {~add-ons/A_Simple_Addon/scenarios}&lt;br /&gt;
 #endif&lt;br /&gt;
&lt;br /&gt;
[textdomain] WML 标签指定了组件中字符串的翻译。textdomain 应该是组件的目录名，需要添加前缀&amp;lt;b&amp;gt;“wesnoth-”&amp;lt;/b&amp;gt;来确保不会和其他文本冲突，并和 [[WesCamp]] 兼容。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;注意：&amp;lt;/b&amp;gt;只有在您的组件需要翻译时，才需要 textdomain。如果是音乐包或者其他情况，并不需要 textdomain。&lt;br /&gt;
&lt;br /&gt;
所有的 [campaign] 和 [textdomain] 标签&amp;lt;b&amp;gt;必须&amp;lt;/b&amp;gt; 包含在 &amp;lt;b&amp;gt;#ifdef&amp;lt;/b&amp;gt; 预处理条件中，包括替换条件（详见 [[PreprocessorRef]]）。这是为了确保您的内容在正确的时间加载，并且不和其他插件冲突。在上面的示例中，您的场景会在多人模式下被加载。在战役中，您可以设置特定标记，让只在战役中被加载。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Note：&amp;lt;/b&amp;gt;只有&amp;lt;b&amp;gt;代码&amp;lt;/b&amp;gt;必须放在这个文件里。您&amp;lt;b&amp;gt;不需要&amp;lt;/b&amp;gt;将二进制内容（例如声音、图片、音乐）放在这里。您可以通过指定相对于 [binary_path] 的路径来引用内容。此外，&amp;lt;b&amp;gt;units&amp;lt;/b&amp;gt; 目录不能通过简单的引用路径；它必须使用 &amp;lt;b&amp;gt;[+units][/units]&amp;lt;/b&amp;gt;（&amp;lt;b&amp;gt;+&amp;lt;/b&amp;gt;非常重要！）标签包裹，就象这样：&lt;br /&gt;
&lt;br /&gt;
 [+units]&lt;br /&gt;
     {~add-ons/A_Simple_Addon/units}&lt;br /&gt;
 [/units]&lt;br /&gt;
&lt;br /&gt;
== The Directory Structure ==&lt;br /&gt;
&lt;br /&gt;
What to create next depend on what type of content you are creating. For example, campaigns or map packs will have &amp;lt;b&amp;gt;scenarios&amp;lt;/b&amp;gt; and &amp;lt;b&amp;gt;maps&amp;lt;/b&amp;gt; directories, while a music pack would have only &amp;lt;b&amp;gt;music&amp;lt;/b&amp;gt;. Here we will assume you are creating a campaign or single-scenario add-on.&lt;br /&gt;
&lt;br /&gt;
Create the following directories:&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;b&amp;gt;&amp;lt;i&amp;gt;userdata&amp;lt;/i&amp;gt;/data/add-ons/A_Simple_Addon/scenarios&amp;lt;/b&amp;gt;&lt;br /&gt;
*&amp;lt;b&amp;gt;&amp;lt;i&amp;gt;userdata&amp;lt;/i&amp;gt;/data/add-ons/A_Simple_Addon/maps&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
场景中使用的所有地图文件都在 &amp;lt;b&amp;gt;maps&amp;lt;/b&amp;gt; 当中（详见[[BuildingMaps]]）。所有场景的的配置文件（.cfg）文件都在 &amp;lt;b&amp;gt;scenarios&amp;lt;/b&amp;gt; 当中（详见[[BuildingScenarios]]）。&lt;br /&gt;
&lt;br /&gt;
如果您有一些自定义的内容，比如图片或者单位，请建立如下内容：&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;b&amp;gt;&amp;lt;i&amp;gt;userdata&amp;lt;/i&amp;gt;/data/add-ons/A_Simple_Addon/macros&amp;lt;/b&amp;gt;&lt;br /&gt;
*&amp;lt;b&amp;gt;&amp;lt;i&amp;gt;userdata&amp;lt;/i&amp;gt;/data/add-ons/A_Simple_Addon/units&amp;lt;/b&amp;gt;&lt;br /&gt;
*&amp;lt;b&amp;gt;&amp;lt;i&amp;gt;userdata&amp;lt;/i&amp;gt;/data/add-ons/A_Simple_Addon/images&amp;lt;/b&amp;gt;&lt;br /&gt;
*&amp;lt;b&amp;gt;&amp;lt;i&amp;gt;userdata&amp;lt;/i&amp;gt;/data/add-ons/A_Simple_Addon/music&amp;lt;/b&amp;gt;&lt;br /&gt;
*&amp;lt;b&amp;gt;&amp;lt;i&amp;gt;userdata&amp;lt;/i&amp;gt;/data/add-ons/A_Simple_Addon/sounds&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;注意：&amp;lt;/b&amp;gt;您可以命名包含代码的目录（例如 &amp;lt;b&amp;gt;scenarios&amp;lt;/b&amp;gt; 和 &amp;lt;b&amp;gt;macros&amp;lt;/b&amp;gt;）为任意名称，但是三个二进制内容目录（&amp;lt;b&amp;gt;images&amp;lt;/b&amp;gt;、&amp;lt;b&amp;gt;music&amp;lt;/b&amp;gt;、&amp;lt;b&amp;gt;sounds&amp;lt;/b&amp;gt;）&amp;lt;b&amp;gt;必须&amp;lt;/b&amp;gt;是这个名字，并且相对于 [binary_path] 指定的路径。游戏尝试解析图像、音乐、声音路径时，会在 [binary_path] 下查找。&lt;br /&gt;
&lt;br /&gt;
如果您设置了 textdomain，则要建立 &amp;lt;b&amp;gt;translations&amp;lt;/b&amp;gt; 目录，即便是空的也要建立。否则会在 stderr 中生成警告。路径&amp;lt;b&amp;gt;必须&amp;lt;/b&amp;gt;和 [textdomain] 标签指定的一致。&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;b&amp;gt;&amp;lt;i&amp;gt;userdata&amp;lt;/i&amp;gt;/data/add-ons/A_Simple_Addon/translations&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
&lt;br /&gt;
* [[Create]]&lt;br /&gt;
* [[BinaryPathWML]]&lt;br /&gt;
* [[BuildingCampaignsTheCampaignFile]]&lt;br /&gt;
* [[WesCamp]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Create]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;注意！&amp;lt;/b&amp;gt;译文质量不佳。&lt;/div&gt;</summary>
		<author><name>Vanfans</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.wesnoth.org/index.php?title=AddonStructure&amp;diff=58225</id>
		<title>AddonStructure</title>
		<link rel="alternate" type="text/html" href="https://wiki.wesnoth.org/index.php?title=AddonStructure&amp;diff=58225"/>
		<updated>2017-03-13T12:17:27Z</updated>

		<summary type="html">&lt;p&gt;Vanfans: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Create}}&lt;br /&gt;
&lt;br /&gt;
{| {{Prettytable}}&lt;br /&gt;
|-&lt;br /&gt;
!|Other languages:&lt;br /&gt;
[[AddonStructure|English]]&lt;br /&gt;
[[AddonStructure/zh|简体中文]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
In order to create custom content for Wesnoth, you need to set up a folder in &amp;lt;i&amp;gt;userdata&amp;lt;/i&amp;gt;/data/add-ons/. If you have not found your userdata directory yet, read [[EditingWesnoth]] and come back here. This page will explain the basic directory structure of an add-on and where stuff goes.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Several pages on this wiki will assume you have done so and refer to relative paths in such.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== The Main File ==&lt;br /&gt;
&lt;br /&gt;
For this example, we will assume you are creating an add-on called &amp;lt;b&amp;gt;A Simple Addon&amp;lt;/b&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
*Create the empty directory &amp;lt;b&amp;gt;&amp;lt;i&amp;gt;userdata&amp;lt;/i&amp;gt;/data/add-ons/A_Simple_Addon&amp;lt;/b&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Important:&amp;lt;/b&amp;gt; Remember to use underscores in all directory and file names instead of spaces. Failure to do so will result in your content not working properly.&lt;br /&gt;
&lt;br /&gt;
*Create a file called &amp;lt;b&amp;gt;_main.cfg&amp;lt;/b&amp;gt; inside the A_Simple_Addon folder.&lt;br /&gt;
&lt;br /&gt;
The _main.cfg file will instruct the game on how to load your content. Here is shown a very simple example of the file.&lt;br /&gt;
&lt;br /&gt;
 #textdomain wesnoth-A_Simple_Addon&lt;br /&gt;
 [textdomain]&lt;br /&gt;
     name=&amp;quot;wesnoth-A_Simple_Addon&amp;quot;&lt;br /&gt;
     path=&amp;quot;data/add-ons/A_Simple_Addon/translations&amp;quot;&lt;br /&gt;
 [/textdomain]&lt;br /&gt;
 &lt;br /&gt;
 #ifdef MULTIPLAYER&lt;br /&gt;
 [binary_path]&lt;br /&gt;
     path=data/add-ons/A_Simple_Addon&lt;br /&gt;
 [/binary_path]&lt;br /&gt;
 &lt;br /&gt;
 {~add-ons/A_Simple_Addon/scenarios}&lt;br /&gt;
 #endif&lt;br /&gt;
&lt;br /&gt;
The [textdomain] WML tag specifies where the game should look for translations to the strings in the add-on. The textdomain should be the add-on's directory name prefixed with &amp;lt;b&amp;gt;&amp;quot;wesnoth-&amp;quot;&amp;lt;/b&amp;gt;, to ensure that it does not conflict with other textdomains that might be specified on a given system and is compatible with [[WesCamp]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Note:&amp;lt;/b&amp;gt; A textdomain is only required if your add-on contains text meant to be translated. In the case of, for example, a music pack, no textdomain is needed.&lt;br /&gt;
&lt;br /&gt;
All tags save for [campaign] and [textdomain] &amp;lt;b&amp;gt;must&amp;lt;/b&amp;gt; be enclosed in an &amp;lt;b&amp;gt;#ifdef&amp;lt;/b&amp;gt; preprocessor conditional - including those substituted through inclusion (see [[PreprocessorRef]] for more information). This is to make sure your content only loads at the correct time and does not conflict with other add-ons. In the example above, the scenarios will be loaded when you enter multiplayer mode. In a campaign, you can set up a specific flag to allow your content to only load when that campaign is played. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Note:&amp;lt;/b&amp;gt; Only &amp;lt;b&amp;gt;code&amp;lt;/b&amp;gt; must be included from this file. You &amp;lt;b&amp;gt;do not&amp;lt;/b&amp;gt; need to include binary content (such as sounds, images, or music). Those may be referred to simply by path relative to the one specified in [binary_path]. Also, including the &amp;lt;b&amp;gt;units&amp;lt;/b&amp;gt; directory cannot be done by a simple path inclusion; it also must be wrapped in a &amp;lt;b&amp;gt;[+units][/units]&amp;lt;/b&amp;gt; (the &amp;lt;b&amp;gt;+&amp;lt;/b&amp;gt; is very important!) tag pair, as such:&lt;br /&gt;
&lt;br /&gt;
 [+units]&lt;br /&gt;
     {~add-ons/A_Simple_Addon/units}&lt;br /&gt;
 [/units]&lt;br /&gt;
&lt;br /&gt;
== The Directory Structure ==&lt;br /&gt;
&lt;br /&gt;
What to create next depend on what type of content you are creating. For example, campaigns or map packs will have &amp;lt;b&amp;gt;scenarios&amp;lt;/b&amp;gt; and &amp;lt;b&amp;gt;maps&amp;lt;/b&amp;gt; directories, while a music pack would have only &amp;lt;b&amp;gt;music&amp;lt;/b&amp;gt;. Here we will assume you are creating a campaign or single-scenario add-on.&lt;br /&gt;
&lt;br /&gt;
Create the following directories:&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;b&amp;gt;&amp;lt;i&amp;gt;userdata&amp;lt;/i&amp;gt;/data/add-ons/A_Simple_Addon/scenarios&amp;lt;/b&amp;gt;&lt;br /&gt;
*&amp;lt;b&amp;gt;&amp;lt;i&amp;gt;userdata&amp;lt;/i&amp;gt;/data/add-ons/A_Simple_Addon/maps&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
All map files used in scenarios go in &amp;lt;b&amp;gt;maps&amp;lt;/b&amp;gt; (see [[BuildingMaps]]. All configuration (‘.cfg’) files for scenarios go in &amp;lt;b&amp;gt;scenarios&amp;lt;/b&amp;gt; (see [[BuildingScenarios]]). &lt;br /&gt;
&lt;br /&gt;
If you have additional custom content such as images or units, create the respective following:&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;b&amp;gt;&amp;lt;i&amp;gt;userdata&amp;lt;/i&amp;gt;/data/add-ons/A_Simple_Addon/macros&amp;lt;/b&amp;gt;&lt;br /&gt;
*&amp;lt;b&amp;gt;&amp;lt;i&amp;gt;userdata&amp;lt;/i&amp;gt;/data/add-ons/A_Simple_Addon/units&amp;lt;/b&amp;gt;&lt;br /&gt;
*&amp;lt;b&amp;gt;&amp;lt;i&amp;gt;userdata&amp;lt;/i&amp;gt;/data/add-ons/A_Simple_Addon/images&amp;lt;/b&amp;gt;&lt;br /&gt;
*&amp;lt;b&amp;gt;&amp;lt;i&amp;gt;userdata&amp;lt;/i&amp;gt;/data/add-ons/A_Simple_Addon/music&amp;lt;/b&amp;gt;&lt;br /&gt;
*&amp;lt;b&amp;gt;&amp;lt;i&amp;gt;userdata&amp;lt;/i&amp;gt;/data/add-ons/A_Simple_Addon/sounds&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Important:&amp;lt;/b&amp;gt; You may name the directories containing code (such as &amp;lt;b&amp;gt;scenarios&amp;lt;/b&amp;gt; and &amp;lt;b&amp;gt;macros&amp;lt;/b&amp;gt;) anything you like, but the three binary content directories (&amp;lt;b&amp;gt;images&amp;lt;/b&amp;gt;, &amp;lt;b&amp;gt;music&amp;lt;/b&amp;gt;, and &amp;lt;b&amp;gt;sounds&amp;lt;/b&amp;gt;) &amp;lt;b&amp;gt;must&amp;lt;/b&amp;gt; be named as such and be relative to your [binary_path]. This is because when trying to resolve an image path, Wesnoth will look under images/, and likewise for sounds and music, in [binary_path].&lt;br /&gt;
&lt;br /&gt;
If you set up a textdomain, create a &amp;lt;b&amp;gt;translations&amp;lt;/b&amp;gt; directory, even if it remains empty. Failure to do so generates a warning in stderr. This path &amp;lt;b&amp;gt;must&amp;lt;/b&amp;gt; be the same as specified in the [textdomain] tag.&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;b&amp;gt;&amp;lt;i&amp;gt;userdata&amp;lt;/i&amp;gt;/data/add-ons/A_Simple_Addon/translations&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
&lt;br /&gt;
* [[Create]]&lt;br /&gt;
* [[BinaryPathWML]]&lt;br /&gt;
* [[BuildingCampaignsTheCampaignFile]]&lt;br /&gt;
* [[WesCamp]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Create]]&lt;/div&gt;</summary>
		<author><name>Vanfans</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.wesnoth.org/index.php?title=AddonStructure&amp;diff=58224</id>
		<title>AddonStructure</title>
		<link rel="alternate" type="text/html" href="https://wiki.wesnoth.org/index.php?title=AddonStructure&amp;diff=58224"/>
		<updated>2017-03-13T12:16:05Z</updated>

		<summary type="html">&lt;p&gt;Vanfans: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Create}}&lt;br /&gt;
&lt;br /&gt;
{| {{Prettytable}}&lt;br /&gt;
|-&lt;br /&gt;
!|Other languages:&lt;br /&gt;
[[Create|English]]&lt;br /&gt;
[[Create/zh-Hans|简体中文]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
In order to create custom content for Wesnoth, you need to set up a folder in &amp;lt;i&amp;gt;userdata&amp;lt;/i&amp;gt;/data/add-ons/. If you have not found your userdata directory yet, read [[EditingWesnoth]] and come back here. This page will explain the basic directory structure of an add-on and where stuff goes.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Several pages on this wiki will assume you have done so and refer to relative paths in such.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== The Main File ==&lt;br /&gt;
&lt;br /&gt;
For this example, we will assume you are creating an add-on called &amp;lt;b&amp;gt;A Simple Addon&amp;lt;/b&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
*Create the empty directory &amp;lt;b&amp;gt;&amp;lt;i&amp;gt;userdata&amp;lt;/i&amp;gt;/data/add-ons/A_Simple_Addon&amp;lt;/b&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Important:&amp;lt;/b&amp;gt; Remember to use underscores in all directory and file names instead of spaces. Failure to do so will result in your content not working properly.&lt;br /&gt;
&lt;br /&gt;
*Create a file called &amp;lt;b&amp;gt;_main.cfg&amp;lt;/b&amp;gt; inside the A_Simple_Addon folder.&lt;br /&gt;
&lt;br /&gt;
The _main.cfg file will instruct the game on how to load your content. Here is shown a very simple example of the file.&lt;br /&gt;
&lt;br /&gt;
 #textdomain wesnoth-A_Simple_Addon&lt;br /&gt;
 [textdomain]&lt;br /&gt;
     name=&amp;quot;wesnoth-A_Simple_Addon&amp;quot;&lt;br /&gt;
     path=&amp;quot;data/add-ons/A_Simple_Addon/translations&amp;quot;&lt;br /&gt;
 [/textdomain]&lt;br /&gt;
 &lt;br /&gt;
 #ifdef MULTIPLAYER&lt;br /&gt;
 [binary_path]&lt;br /&gt;
     path=data/add-ons/A_Simple_Addon&lt;br /&gt;
 [/binary_path]&lt;br /&gt;
 &lt;br /&gt;
 {~add-ons/A_Simple_Addon/scenarios}&lt;br /&gt;
 #endif&lt;br /&gt;
&lt;br /&gt;
The [textdomain] WML tag specifies where the game should look for translations to the strings in the add-on. The textdomain should be the add-on's directory name prefixed with &amp;lt;b&amp;gt;&amp;quot;wesnoth-&amp;quot;&amp;lt;/b&amp;gt;, to ensure that it does not conflict with other textdomains that might be specified on a given system and is compatible with [[WesCamp]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Note:&amp;lt;/b&amp;gt; A textdomain is only required if your add-on contains text meant to be translated. In the case of, for example, a music pack, no textdomain is needed.&lt;br /&gt;
&lt;br /&gt;
All tags save for [campaign] and [textdomain] &amp;lt;b&amp;gt;must&amp;lt;/b&amp;gt; be enclosed in an &amp;lt;b&amp;gt;#ifdef&amp;lt;/b&amp;gt; preprocessor conditional - including those substituted through inclusion (see [[PreprocessorRef]] for more information). This is to make sure your content only loads at the correct time and does not conflict with other add-ons. In the example above, the scenarios will be loaded when you enter multiplayer mode. In a campaign, you can set up a specific flag to allow your content to only load when that campaign is played. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Note:&amp;lt;/b&amp;gt; Only &amp;lt;b&amp;gt;code&amp;lt;/b&amp;gt; must be included from this file. You &amp;lt;b&amp;gt;do not&amp;lt;/b&amp;gt; need to include binary content (such as sounds, images, or music). Those may be referred to simply by path relative to the one specified in [binary_path]. Also, including the &amp;lt;b&amp;gt;units&amp;lt;/b&amp;gt; directory cannot be done by a simple path inclusion; it also must be wrapped in a &amp;lt;b&amp;gt;[+units][/units]&amp;lt;/b&amp;gt; (the &amp;lt;b&amp;gt;+&amp;lt;/b&amp;gt; is very important!) tag pair, as such:&lt;br /&gt;
&lt;br /&gt;
 [+units]&lt;br /&gt;
     {~add-ons/A_Simple_Addon/units}&lt;br /&gt;
 [/units]&lt;br /&gt;
&lt;br /&gt;
== The Directory Structure ==&lt;br /&gt;
&lt;br /&gt;
What to create next depend on what type of content you are creating. For example, campaigns or map packs will have &amp;lt;b&amp;gt;scenarios&amp;lt;/b&amp;gt; and &amp;lt;b&amp;gt;maps&amp;lt;/b&amp;gt; directories, while a music pack would have only &amp;lt;b&amp;gt;music&amp;lt;/b&amp;gt;. Here we will assume you are creating a campaign or single-scenario add-on.&lt;br /&gt;
&lt;br /&gt;
Create the following directories:&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;b&amp;gt;&amp;lt;i&amp;gt;userdata&amp;lt;/i&amp;gt;/data/add-ons/A_Simple_Addon/scenarios&amp;lt;/b&amp;gt;&lt;br /&gt;
*&amp;lt;b&amp;gt;&amp;lt;i&amp;gt;userdata&amp;lt;/i&amp;gt;/data/add-ons/A_Simple_Addon/maps&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
All map files used in scenarios go in &amp;lt;b&amp;gt;maps&amp;lt;/b&amp;gt; (see [[BuildingMaps]]. All configuration (‘.cfg’) files for scenarios go in &amp;lt;b&amp;gt;scenarios&amp;lt;/b&amp;gt; (see [[BuildingScenarios]]). &lt;br /&gt;
&lt;br /&gt;
If you have additional custom content such as images or units, create the respective following:&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;b&amp;gt;&amp;lt;i&amp;gt;userdata&amp;lt;/i&amp;gt;/data/add-ons/A_Simple_Addon/macros&amp;lt;/b&amp;gt;&lt;br /&gt;
*&amp;lt;b&amp;gt;&amp;lt;i&amp;gt;userdata&amp;lt;/i&amp;gt;/data/add-ons/A_Simple_Addon/units&amp;lt;/b&amp;gt;&lt;br /&gt;
*&amp;lt;b&amp;gt;&amp;lt;i&amp;gt;userdata&amp;lt;/i&amp;gt;/data/add-ons/A_Simple_Addon/images&amp;lt;/b&amp;gt;&lt;br /&gt;
*&amp;lt;b&amp;gt;&amp;lt;i&amp;gt;userdata&amp;lt;/i&amp;gt;/data/add-ons/A_Simple_Addon/music&amp;lt;/b&amp;gt;&lt;br /&gt;
*&amp;lt;b&amp;gt;&amp;lt;i&amp;gt;userdata&amp;lt;/i&amp;gt;/data/add-ons/A_Simple_Addon/sounds&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Important:&amp;lt;/b&amp;gt; You may name the directories containing code (such as &amp;lt;b&amp;gt;scenarios&amp;lt;/b&amp;gt; and &amp;lt;b&amp;gt;macros&amp;lt;/b&amp;gt;) anything you like, but the three binary content directories (&amp;lt;b&amp;gt;images&amp;lt;/b&amp;gt;, &amp;lt;b&amp;gt;music&amp;lt;/b&amp;gt;, and &amp;lt;b&amp;gt;sounds&amp;lt;/b&amp;gt;) &amp;lt;b&amp;gt;must&amp;lt;/b&amp;gt; be named as such and be relative to your [binary_path]. This is because when trying to resolve an image path, Wesnoth will look under images/, and likewise for sounds and music, in [binary_path].&lt;br /&gt;
&lt;br /&gt;
If you set up a textdomain, create a &amp;lt;b&amp;gt;translations&amp;lt;/b&amp;gt; directory, even if it remains empty. Failure to do so generates a warning in stderr. This path &amp;lt;b&amp;gt;must&amp;lt;/b&amp;gt; be the same as specified in the [textdomain] tag.&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;b&amp;gt;&amp;lt;i&amp;gt;userdata&amp;lt;/i&amp;gt;/data/add-ons/A_Simple_Addon/translations&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
&lt;br /&gt;
* [[Create]]&lt;br /&gt;
* [[BinaryPathWML]]&lt;br /&gt;
* [[BuildingCampaignsTheCampaignFile]]&lt;br /&gt;
* [[WesCamp]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Create]]&lt;/div&gt;</summary>
		<author><name>Vanfans</name></author>
		
	</entry>
</feed>