From GamingWiki
Jump to: navigation, search
 
(12 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 | {{$var:skillname}} = 0 }}<!--
+
         -->{{#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  
  
   Get the keys of our skill hash:
+
   Print the skill listings
-->{{#hashtoarray:|skillhash|skillhashkeys}}<!--
 
-->{{#arraysort:skillhashkeys|desc}}<!--
 
 
 
-->{{#arraydefine: skillpartkeys | name, marker}}<!--
 
 
-->{{#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 111: Line 115:
 
             --></span> <!--
 
             --></span> <!--
 
             -->{{#hashvalue: skillmarkerhash | {{#hashvalue: theskillhash | marker}} }}<!--
 
             -->{{#hashvalue: skillmarkerhash | {{#hashvalue: theskillhash | marker}} }}<!--
               Add SMW property
+
               Add SMW properties
             -->{{#if:{{#var:theskillname}}|{{#set: skill/{{#var:theskillname}}=$skillrank$ }}}}<!--
+
             -->{{#if:{{#var:theskillname}}|<!--
 +
              -->{{#set:
 +
                  | has skill = {{lc:{{#var:theskillname}}}} ; $skillrank$
 +
                  }}<!--
 +
            -->}}<!--
 +
 
 +
              Increment skill slot counter
 +
            -->{{#vardefine: skillsused | {{#expr: {{#var:skillsused|0}} + $skillrank$}} }}<!--
  
 
             -->{{#arrayreset: theskillarray}}<!--
 
             -->{{#arrayreset: theskillarray}}<!--
Line 122: 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
Skills