From GamingWiki
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$ | :: }}<!-- | ||
Line 118: | Line 122: | ||
}}<!-- | }}<!-- | ||
-->}}<!-- | -->}}<!-- | ||
+ | |||
+ | Increment skill slot counter | ||
+ | -->{{#vardefine: skillsused | {{#expr: {{#var:skillsused|0}} + 1}} }}<!-- | ||
-->{{#arrayreset: theskillarray}}<!-- | -->{{#arrayreset: theskillarray}}<!-- | ||
Line 127: | Line 134: | ||
--><!--|skilllevelsreverse}}--><!-- end hashprint | --><!--|skilllevelsreverse}}--><!-- end hashprint | ||
-->|skillhashkeys}}<!-- end hashprint | -->|skillhashkeys}}<!-- end hashprint | ||
+ | |||
+ | Print the section footer, if required | ||
+ | -->{{#if: {{#vardefineecho:skillsallowed|{{{skill points allowed|}}}}}| | ||
+ | {{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 }}<!-- |
Revision as of 16:51, 30 May 2011
[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 |