Template:Traits: Difference between revisions

From Archaelund Wiki
(Created page with "<onlyinclude><includeonly>{{#if:{{{1|}}}|{{#switch:{{{2|}}} |Bonus = {{#ifexpr:{{#explode:{{{1}}}|,|0}} != 0| {{Traits/icons|1}} {{#explode:{{{1}}}|,|0}} |}}{{#ifexpr:{{#...")
 
No edit summary
 
(2 intermediate revisions by the same user not shown)
Line 1: Line 1:
<onlyinclude><includeonly>{{#if:{{{1|}}}|{{#switch:{{{2|}}}
<onlyinclude><includeonly>{{#if:{{{1|}}}|{{#switch:{{{2|}}}
|1 = {{#explode:{{{1}}}|,|0}}
|2 = {{#explode:{{{1}}}|,|1}}
|3 = {{#explode:{{{1}}}|,|2}}
|4 = {{#explode:{{{1}}}|,|3}}
|5 = {{#explode:{{{1}}}|,|4}}
|6 = {{#explode:{{{1}}}|,|5}}
|7 = {{#explode:{{{1}}}|,|6}}
|d1 = {{Difference|{{#explode:{{{1}}}|,|0}}}}
|d2 = {{Difference|{{#explode:{{{1}}}|,|1}}}}
|d3 = {{Difference|{{#explode:{{{1}}}|,|2}}}}
|d4 = {{Difference|{{#explode:{{{1}}}|,|3}}}}
|d5 = {{Difference|{{#explode:{{{1}}}|,|4}}}}
|d6 = {{Difference|{{#explode:{{{1}}}|,|5}}}}
|d7 = {{Difference|{{#explode:{{{1}}}|,|6}}}}


|Bonus =
|Bonus =
{{#ifexpr:{{#explode:{{{1}}}|,|0}} != 0| {{Traits/icons|1}} {{#explode:{{{1}}}|,|0}}&#32;|}}{{#ifexpr:{{#explode:{{{1}}}|,|1}} != 0| {{Traits/icons|2}} {{#explode:{{{1}}}|,|1}}&#32;|}}{{#ifexpr:{{#explode:{{{1}}}|,|2}} != 0| {{Traits/icons|3}} {{#explode:{{{1}}}|,|2}}&#32;|}}{{#ifexpr:{{#explode:{{{1}}}|,|3}} != 0| {{Traits/icons|4}} {{#explode:{{{1}}}|,|3}}&#32;|}}{{#ifexpr:{{#explode:{{{1}}}|,|4}} != 0| {{Traits/icons|5}} {{#explode:{{{1}}}|,|4}}&#32;|}}{{#ifexpr:{{#explode:{{{1}}}|,|5}} != 0| {{Traits/icons|6}} {{#explode:{{{1}}}|,|5}}|}}
{{#ifexpr:{{#explode:{{{1}}}|,|0}} != 0| {{Traits/names|11}} {{#explode:{{{1}}}|,|0}}&#32;|}}{{#ifexpr:{{#explode:{{{1}}}|,|1}} != 0| {{Traits/names|22}} {{#explode:{{{1}}}|,|1}}&#32;|}}{{#ifexpr:{{#explode:{{{1}}}|,|2}} != 0| {{Traits/names|33}} {{#explode:{{{1}}}|,|2}}&#32;|}}{{#ifexpr:{{#explode:{{{1}}}|,|3}} != 0| {{Traits/names|44}} {{#explode:{{{1}}}|,|3}}&#32;|}}{{#ifexpr:{{#explode:{{{1}}}|,|4}} != 0| {{Traits/names|55}} {{#explode:{{{1}}}|,|4}}&#32;|}}{{#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/icons|7}} {{#explode:{{{1}}}|,|6}}|}}


|#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

FormatDescriptionInputExample output
1...7Extracts 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...d7Extracts 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
BonusDisplays 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

IndexName
1Strength
2Dexterity
3Endurance
4Awareness
5Personality
6Intellect
7Self-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:

IndexName
11STR
22DEX
33END
44AWA
55PER
66INT
77SLF

View/Edit documentation page