From GamingWiki
(10 intermediate revisions by the same user not shown) | |||
Line 20: | Line 20: | ||
-->{{#vardefine: skillname | {{#explode: $skillstring$ | // | 0 }} }}<!-- | -->{{#vardefine: skillname | {{#explode: $skillstring$ | // | 0 }} }}<!-- | ||
-->{{#vardefine: skillattr | {{#explode: $skillstring$ | // | 1 }} }}<!-- | -->{{#vardefine: skillattr | {{#explode: $skillstring$ | // | 1 }} }}<!-- | ||
− | -->{{#hashinclude: skilllisthash | {{ | + | -->{{#hashinclude: skilllisthash | {{#var:skillname}} = 0 }}<!-- |
-->{{#hashinclude: skillhash-{{#var:skillname}} | -->{{#hashinclude: skillhash-{{#var:skillname}} | ||
| group = {{#var:skillgroupname}} | | group = {{#var:skillgroupname}} | ||
Line 47: | Line 47: | ||
Use a hash to store and then print the skills | Use a hash to store and then print the skills | ||
-->{{#hashdefine: skillhash}}<!-- | -->{{#hashdefine: skillhash}}<!-- | ||
+ | Keep track of how many skill slots have been used | ||
+ | -->{{#vardefine: skillsused | 0}}<!-- | ||
We either have a long section of skills, or one entry per level. | We either have a long section of skills, or one entry per level. | ||
Line 61: | Line 63: | ||
-->{{#arrayslice: skillsbylevel | skillsbylevel | 0 }}<!-- | -->{{#arrayslice: skillsbylevel | skillsbylevel | 0 }}<!-- | ||
-->{{#arraytohash: skillhash | skillsbylevel | skilllevelsreverse }}<!-- | -->{{#arraytohash: skillhash | skillsbylevel | skilllevelsreverse }}<!-- | ||
− | -->{{#arrayreset: skillsbylevel}}<!-- | + | -->{{#arrayreset: skillsbylevel}}<!-- |
-->|<!-- | -->|<!-- | ||
No single skills section. We look for multiple sections: 'skills1', 'skills2', etc. | No single skills section. We look for multiple sections: 'skills1', 'skills2', etc. | ||
Line 79: | Line 81: | ||
-->}}<!-- end if | -->}}<!-- end if | ||
+ | Get the keys of our skill hash: | ||
+ | -->{{#hashtoarray:|skillhash|skillhashkeys}}<!-- | ||
+ | -->{{#arraysort:skillhashkeys|desc}}<!-- | ||
+ | -->{{#arraydefine: skillpartkeys | name, marker}}<!-- | ||
+ | |||
+ | Print the section header | ||
--> | --> | ||
{{Character sheet/section | {{Character sheet/section | ||
Line 88: | Line 96: | ||
}}<!-- end section | }}<!-- end section | ||
− | + | Print the skill listings | |
− | |||
− | |||
− | |||
− | |||
-->{{#hashprint: skillhash || $skillrank$ | $skline$ | <!-- | -->{{#hashprint: skillhash || $skillrank$ | $skline$ | <!-- | ||
− | -->{{#arraydefine: skilllineary | $skline$ | | + | -->{{#arraydefine: skilllineary | $skline$ | ; }}<!-- |
-->{{#if: $skline$ |<!-- | -->{{#if: $skline$ |<!-- | ||
-->{{Character sheet/section<!-- | -->{{Character sheet/section<!-- | ||
Line 114: | Line 118: | ||
-->{{#if:{{#var:theskillname}}|<!-- | -->{{#if:{{#var:theskillname}}|<!-- | ||
-->{{#set: | -->{{#set: | ||
− | | skill | + | | has skill = {{lc:{{#var:theskillname}}}} ; $skillrank$ |
− | |||
}}<!-- | }}<!-- | ||
-->}}<!-- | -->}}<!-- | ||
+ | |||
+ | Increment skill slot counter | ||
+ | -->{{#vardefine: skillsused | {{#expr: {{#var:skillsused|0}} + $skillrank$}} }}<!-- | ||
-->{{#arrayreset: theskillarray}}<!-- | -->{{#arrayreset: theskillarray}}<!-- | ||
Line 127: | Line 133: | ||
--><!--|skilllevelsreverse}}--><!-- end hashprint | --><!--|skilllevelsreverse}}--><!-- end hashprint | ||
-->|skillhashkeys}}<!-- end hashprint | -->|skillhashkeys}}<!-- end hashprint | ||
+ | |||
+ | Print the section footer, if required | ||
+ | -->{{#if: {{#vardefineecho:skillsallowed|{{{defaultskillpoints|}}}}}| | ||
+ | {{Character sheet/section | ||
+ | | columns = {{#var:cols}} | ||
+ | | llabel1 = Points used | ldata1 = {{#var:skillsused}} | ||
+ | | label1 = remaining | data1 = {{#expr: {{#var:skillsallowed}} - {{#var:skillsused}} }} | ||
+ | | rlabel1 = total | rdata1 = {{#var:skillsallowed}} | ||
+ | }}<!-- end section | ||
+ | -->}}<!-- end if | ||
-->{{#hashreset: skillhash | skillmarkerhash | classhash }}<!-- | -->{{#hashreset: skillhash | skillmarkerhash | classhash }}<!-- |
Latest revision as of 17:42, 3 February 2016
[create]
Error creating thumbnail: File missing
Template documentation Editors can experiment in this template's sandbox (create) and testcases (create) pages. Please add categories and interwikis to the /doc subpage. Subpages of this template. |
Skills |