Template:Elements/doc: Difference between revisions
From Archaelund Wiki
No edit summary |
No edit summary |
||
| (8 intermediate revisions by the same user not shown) | |||
| Line 6: | Line 6: | ||
{{Elements|<element input>|<format>}} | {{Elements|<element input>|<format>}} | ||
</pre> | </pre> | ||
Make sure that | Make sure that <element input> is formatted correctly according to the rules given below, otherwise error messages may be generated. | ||
== Format options == | == Format options == | ||
<table class="wikitable> | <table class="wikitable> | ||
<tr><th>Format</th><th>Description</th><th>Input</th><th>Example output</th></tr> | <tr><th>Format</th><th>Description</th><th>Input</th><th>Example output</th></tr> | ||
<tr><td> | <tr><td>1...4</td><td>Extracts the value of the ith entry (i = 1...4) in the element input.</td><td>vector of 4 comma-separated numbers, representing element values (e.g. "10,0,50,-10")</td><td>{{Elements|10,0,50,-10|1}}</td></tr> | ||
<tr><td> | <tr><td>d1...d4</td><td>Extracts the value of the ith entry (i = 1...4) in the element input and formats it as a bonus/malus using [[Template:Difference]].</td><td>vector of 4 comma-separated numbers, representing element values (e.g. "10,0,50,-10")</td><td>{{Elements|10,0,50,-10|d1}}</td></tr> | ||
</table> | </table> | ||
In the above-mentioned vector of 4 comma-separated numbers, each position/index corresponds to a specific element. See the subsequent list for details. | |||
== Element names and icons == | == Element names and icons == | ||
<table class="wikitable> | |||
<tr><th>Index</th><th>Name</th><th>Icon</th></tr> | |||
<tr><td>1</td><td>{{Elements/names|1}}</td><td>{{Elements/icons|1}}</td></tr> | |||
<tr><td>2</td><td>{{Elements/names|2}}</td><td>{{Elements/icons|2}}</td></tr> | |||
<tr><td>3</td><td>{{Elements/names|3}}</td><td>{{Elements/icons|3}}</td></tr> | |||
<tr><td>4</td><td>{{Elements/names|4}}</td><td>{{Elements/icons|4}}</td></tr> | |||
</table> | |||
To extract the individual element names and corresponding icons use the following syntaxes: | To extract the individual element names and corresponding icons use the following syntaxes: | ||
<pre> | <pre> | ||
| Line 21: | Line 29: | ||
{{Elements/icons|<element index>}} | {{Elements/icons|<element index>}} | ||
</pre> | </pre> | ||
Abbreviated names and special double icons can be produced for each element by using specific double indices: | |||
<table class="wikitable> | |||
<tr><th>Index</th><th>Name</th><th>Icon</th></tr> | |||
<tr><td>11</td><td>{{Elements/names|11}}</td><td>{{Elements/icons|11}}</td></tr> | |||
<tr><td>22</td><td>{{Elements/names|22}}</td><td>{{Elements/icons|22}}</td></tr> | |||
<tr><td>33</td><td>{{Elements/names|33}}</td><td>{{Elements/icons|33}}</td></tr> | |||
<tr><td>44</td><td>{{Elements/names|44}}</td><td>{{Elements/icons|44}}</td></tr> | |||
</table> | |||
Latest revision as of 13:41, 11 January 2025
Description
This template generates various output formats from raw element input.
Usage
{{Elements|<element input>|<format>}}
Make sure that <element input> is formatted correctly according to the rules given below, otherwise error messages may be generated.
Format options
| Format | Description | Input | Example output |
|---|---|---|---|
| 1...4 | Extracts the value of the ith entry (i = 1...4) in the element input. | vector of 4 comma-separated numbers, representing element values (e.g. "10,0,50,-10") | 10 |
| d1...d4 | Extracts the value of the ith entry (i = 1...4) in the element input and formats it as a bonus/malus using Template:Difference. | vector of 4 comma-separated numbers, representing element values (e.g. "10,0,50,-10") | +10 |
In the above-mentioned vector of 4 comma-separated numbers, each position/index corresponds to a specific element. See the subsequent list for details.
Element names and icons
| Index | Name | Icon |
|---|---|---|
| 1 | Fire | |
| 2 | Cold | |
| 3 | Shock | |
| 4 | Toxic |
To extract the individual element names and corresponding icons use the following syntaxes:
{{Elements/names|<element index>}}
{{Elements/icons|<element index>}}
Abbreviated names and special double icons can be produced for each element by using specific double indices:
| Index | Name | Icon |
|---|---|---|
| 11 | Fire | |
| 22 | Cold | |
| 33 | Shock | |
| 44 | Toxic |