Template:Traits: Difference between revisions
From Archaelund Wiki
No edit summary |
No edit summary |
||
| Line 18: | Line 18: | ||
|Bonus = | |Bonus = | ||
{{#ifexpr:{{#explode:{{{1}}}|,|0}} != 0| {{Traits/ | {{#ifexpr:{{#explode:{{{1}}}|,|0}} != 0| {{Traits/names|11}} {{#explode:{{{1}}}|,|0}} |}}{{#ifexpr:{{#explode:{{{1}}}|,|1}} != 0| {{Traits/names|22}} {{#explode:{{{1}}}|,|1}} |}}{{#ifexpr:{{#explode:{{{1}}}|,|2}} != 0| {{Traits/names|33}} {{#explode:{{{1}}}|,|2}} |}}{{#ifexpr:{{#explode:{{{1}}}|,|3}} != 0| {{Traits/names|44}} {{#explode:{{{1}}}|,|3}} |}}{{#ifexpr:{{#explode:{{{1}}}|,|4}} != 0| {{Traits/names|55}} {{#explode:{{{1}}}|,|4}} |}}{{#ifexpr:{{#explode:{{{1}}}|,|5}} != 0| {{Traits/names|66}} {{#explode:{{{1}}}|,|5}}|}}{{#ifexpr:{{#explode:{{{1}}}|,|6}} != 0| {{Traits/names|77}} {{#explode:{{{1}}}|,|6}}|}} | ||
{{#ifexpr:{{#explode:{{{1}}}|,|6}} != 0| {{Traits/ | |||
|#default = | |#default = | ||
Latest revision as of 13:51, 25 November 2023
Description
This template generates various output formats from raw trait input.
Usage
{{Traits|<trait input>|<format>}}
Make sure that <trait input> is formatted correctly according to the rules given below, otherwise error messages may be generated.
Format options
| Format | Description | Input | Example output |
|---|---|---|---|
| 1...7 | Extracts the trait value of the ith entry (i = 1...7) in the trait input. | vector of 7 comma-separated numbers, representing trait values (e.g. "4,8,8,5,6,3,6") | 4 |
| d1...d7 | Extracts the trait value of the ith entry (i = 1...7) in the trait input and formats it as a bonus/malus using Template:Difference. | vector of 7 comma-separated numbers, representing trait values (e.g. "4,8,8,5,6,3,6") | +4 |
| Bonus | Displays trait symbols and the corresponding bonus values. | vector of 7 comma-separated numbers, representing trait bonus values (e.g. "2,0,1,0,0,-1,0") | STR 2 END 1 INT -1 |
In the above-mentioned vector of 7 comma-separated numbers, each position/index corresponds to a specific trait. See the subsequent list for details.
Trait names
| Index | Name |
|---|---|
| 1 | Strength |
| 2 | Dexterity |
| 3 | Endurance |
| 4 | Awareness |
| 5 | Personality |
| 6 | Intellect |
| 7 | Self-Control |
To extract the individual trait names use the following syntax:
{{Traits/names|<trait index>}}
Abbreviated names can be produced for each trait by using specific double indices:
| Index | Name |
|---|---|
| 11 | STR |
| 22 | DEX |
| 33 | END |
| 44 | AWA |
| 55 | PER |
| 66 | INT |
| 77 | SLF |
View/Edit documentation page