该编辑可以被撤销。 请检查下面的对比以核实您想要撤销的内容,然后发布下面的更改以完成撤销。
最后版本 | 您的文本 | ||
第13行: | 第13行: | ||
} | } | ||
</pre> | </pre> | ||
== 有效键值 == | == 有效键值 == | ||
第30行: | 第28行: | ||
|- | |- | ||
| colspan="3" | <code>pattern</code> | | colspan="3" | <code>pattern</code> | ||
| | | The path to the file for the background pattern (usually located in {{path|gfx/coat_of_arms/patterns/}}.<br />A pattern should be included to avoid graphical issues with the masking textures when using textured emblems. | ||
| <pre>pattern = "pattern_vertical_split_01"</pre> | | <pre>pattern = "pattern_vertical_split_01"</pre> | ||
第39行: | 第37行: | ||
color4 | color4 | ||
color5</pre> | color5</pre> | ||
| | | Specifies a color, to be used in the pattern or as a color reference in colored_emblems.<br />Usually refers to a color defined in {{path|common/named_colors}}.<br />Can also explicitly define RGB, HSV and 8-Digit Hexadecimal values. | ||
| <pre>color1 = "white" | | <pre>color1 = "white" | ||
color2 = hsv { 1.0 1.0 1.0 } | color2 = hsv { 1.0 1.0 1.0 } | ||
第49行: | 第47行: | ||
| rowspan="7" | <code>textured_emblem</code> | | rowspan="7" | <code>textured_emblem</code> | ||
| colspan="2" | --- | | colspan="2" | --- | ||
| | | Multiple textured emblems can be specified. Each is itself a scripting object with the following valid keywords: | ||
| --- | | --- | ||
|- | |- | ||
| colspan="2" | <code>texture</code> | | colspan="2" | <code>texture</code> | ||
| | | The path to the file for the emblem (usually located in {{path|gfx/coat_of_arms/textured_emblems/}}). | ||
| <pre>texture = "te_griffin_01.dds"</pre> | | <pre>texture = "te_griffin_01.dds"</pre> | ||
|- | |- | ||
| colspan="2" | <code>mask</code> | | colspan="2" | <code>mask</code> | ||
| | | The coat of arms' background pattern can be used as a clipping mask for emblems. | ||
| <pre>mask = { 1 3 }</pre> | | <pre>mask = { 1 3 }</pre> | ||
|- | |- | ||
| rowspan="4" | <code>instance</code> | | rowspan="4" | <code>instance</code> | ||
| <code>scale</code> | | <code>scale</code> | ||
| | | Given as a 2-dim float, has default value { 1.0 1.0 } | ||
| rowspan="4" | <pre>instance = { | | rowspan="4" | <pre>instance = { | ||
scale = { 0.5 0.5 } | scale = { 0.5 0.5 } | ||
第71行: | 第69行: | ||
|- | |- | ||
| <code>position</code> | | <code>position</code> | ||
| | | Given as a 2-dim float, has default value { 0.0 0.0 } | ||
|- | |- | ||
| <code>rotation</code> | | <code>rotation</code> | ||
| | | Given as float value, has default value 0.0 | ||
|- | |- | ||
| <code>depth</code> | | <code>depth</code> | ||
| | | Used to order rendering, given as float value with default of 0.0 | ||
|- | |- | ||
| rowspan="6" | <code>colored_emblem</code> | | rowspan="6" | <code>colored_emblem</code> | ||
| colspan="2" | --- | | colspan="2" | --- | ||
| | | Multiple colored emblems can be specified. Each is itself a scripting object with the following keywords: | ||
| --- | | --- | ||
|- | |- | ||
| colspan="2" | <code>texture</code> | | colspan="2" | <code>texture</code> | ||
| | | The path to the file for the emblem (usually located in {{path|gfx/coat_of_arms/colored_emblems/}}). | ||
| <pre>texture = "ce_crown.tga"</pre> | | <pre>texture = "ce_crown.tga"</pre> | ||
|- | |- | ||
| colspan="2" | " | | colspan="2" | " | ||
| | | All fields from textured_emblem are valid | ||
| --- | | --- | ||
|- | |- | ||
| colspan="2" | <code>color1</code> | | colspan="2" | <code>color1</code> | ||
| | | defines the base colour of the emblem | ||
| rowspan="3" | <pre>color1 = color2 | | rowspan="3" | <pre>color1 = color2 | ||
color2 = "white" | color2 = "white" | ||
第100行: | 第98行: | ||
|- | |- | ||
| colspan="2" | <code>color2</code> | | colspan="2" | <code>color2</code> | ||
| | | defines the secondary color of the emblem (the Green channel in the texture) | ||
|- | |- | ||
| colspan="2" | <code>color3</code> | | colspan="2" | <code>color3</code> | ||
| | | currently unavailable, will default to white | ||
|- | |- | ||
| rowspan="4" | <code>sub</code> | | rowspan="4" | <code>sub</code> | ||
| colspan="2" | --- | | colspan="2" | --- | ||
| | | Multiple subs can be specified, each is itself a complete coat of arms scripting object, allowing all fields except another sub, i.e. no sub nesting. | ||
| --- | | --- | ||
|- | |- | ||
| rowspan="3" | <code>instance</code> | | rowspan="3" | <code>instance</code> | ||
| <code>scale</code> | | <code>scale</code> | ||
| | | Given as a 2-dim float, has default value { 1.0 1.0 } | ||
| --- | | --- | ||
|- | |- | ||
| <code>offset</code> | | <code>offset</code> | ||
| | | Given as a 2-dim float, has default value { 0.0 0.0 } | ||
| --- | | --- | ||
|- | |- | ||
| <code>depth</code> | | <code>depth</code> | ||
| | | Used to order rendering, given as float value with default of 0.0 | ||
| --- | | --- | ||
|} | |} | ||
第166行: | 第164行: | ||
[[File:Emblem examples.png]] | [[File:Emblem examples.png]] | ||
== | == Inheritance and subs == | ||
This section is largely dedicated towards inheritance, but to facilitate that discussion, first two points on subs: | |||
The first "base coat of arms" is an implicit sub: | |||
<pre> | <pre> | ||
a = { | a = { | ||
第186行: | 第185行: | ||
</pre> | </pre> | ||
Each instance field (coat of arms instances, not emblem instances) is transformed into a separate sub: | |||
<pre> | <pre> | ||
a = { | a = { | ||
第219行: | 第218行: | ||
</pre> | </pre> | ||
With that out of the way, let's dive into inheritance. | |||
Inheritance is achieved through the parent keyword. It basically says "Fetch the coat of arms given as value, and use it to populate any fields not explicitly set". | |||
举例: | 举例: | ||
第245行: | 第244行: | ||
</pre> | </pre> | ||
When it comes to emblems the inheritance is "all or nothing": if at least one emblem (of any type) is specified, no emblems are inherited, but if no emblem is specified, all the parent's emblems are inherited. | |||
The inheritance rules become slightly more complicated once subs are involved. The two guiding rules are: | |||
When a parent is specified, all values are fetched from its first sub (which many times will be an "implicit" sub). | |||
If a sub doesn't specify a parent it will piggyback on the parent of its first sub. However, in this case all values will be fetched from the corresponding sub in the parent. Setting parent = "none" disables this automatic inheritance. | |||
Example: | |||
<pre> | <pre> | ||
daddy = { | daddy = { | ||
第274行: | 第271行: | ||
</pre> | </pre> | ||
Inheritance chains ("deep inheritance") is resolved in a bottom up manner. Users must take care not to create inheritance loops. | |||
<pre> | <pre> | ||
第302行: | 第299行: | ||
</pre> | </pre> | ||
And finally, a real example: | |||
<pre> | <pre> | ||
k_england_and_france = { | k_england_and_france = { | ||
第317行: | 第314行: | ||
} | } | ||
</pre> | </pre> | ||
{{Modding navbox}} | {{Modding navbox}} | ||
[[Category:模组制作]] | [[Category:模组制作]] | ||
[[en:Coat of arms modding]] | [[en:Coat of arms modding]] |