From GamingWiki
Jump to: navigation, search
Line 1: Line 1:
 
{{Documentation}}
 
{{Documentation}}
  
 +
{{#if: {{#vardefineecho: debug |  }} | debug mode enabled}}
 
{| class="infobox"
 
{| class="infobox"
 
<onlyinclude><!--
 
<onlyinclude><!--
Line 29: Line 30:
 
   * Level: skill level, i.e, untrained, trained, focused or specialized
 
   * Level: skill level, i.e, untrained, trained, focused or specialized
  
-->{{#vardefine:modeGood|{{{mode good|Hemocrat}}}}}<!--
+
-->{{#vardefine:modeGood|{{{mode good|Banter}}}}}<!--
 
-->{{#vardefine:modeFair|{{{mode fair|Space}}}}}<!--
 
-->{{#vardefine:modeFair|{{{mode fair|Space}}}}}<!--
-->{{#vardefine:modeAverage|{{{mode average|Science}}}}}<!--
+
-->{{#vardefine:modeAverage|{{{mode average|Action}}}}}<!--
  
 
   Some initial arrays and hashes:
 
   Some initial arrays and hashes:
Line 43: Line 44:
 
       * values are arrays of skill names
 
       * values are arrays of skill names
  
-->{{#arraydefine: modeArray | {{#var: modeFair}}, {{#var: modeAverage}}, {{#var: modeGood}} | , }}<!--
+
-->{{#arraydefine: modeArray | {{#var: modeAverage}}, {{#var: modeFair}}, {{#var: modeGood}} | , }}<!--
 
-->{{#arraydefine: levelArray | untrained, trained, focused, specialized | , }}<!--
 
-->{{#arraydefine: levelArray | untrained, trained, focused, specialized | , }}<!--
 
-->{{#arrayslice:  levelSubarray | levelArray | 1 }}<!--
 
-->{{#arrayslice:  levelSubarray | levelArray | 1 }}<!--
-->{{#arraytohash: levelModeHash | modeArray | levelSubarray}}<!--
+
-->{{#hashdefine: modeHash}}<!--
 
-->{{#arrayprint:  modeArray | | <mode> | <!--
 
-->{{#arrayprint:  modeArray | | <mode> | <!--
 
   -->{{#hashinclude: modeHash  | <mode> = {{#arrayprint: levelSubArray | <LEVELSEP> | <level> | <level><LEVELVAL>}} }}<!--
 
   -->{{#hashinclude: modeHash  | <mode> = {{#arrayprint: levelSubArray | <LEVELSEP> | <level> | <level><LEVELVAL>}} }}<!--
Line 52: Line 53:
  
 
   Query all skills found belonging to our three modes.
 
   Query all skills found belonging to our three modes.
-->{{#arraydefine:skillArray |
 
      {{#ask: [[is a :: skill]] [[skill in mode :: {{#arrayprint: modeArray | {{!}}{{!}} }}]]
 
      |?Name
 
      |?Skill in mode=Mode
 
      | format=array
 
      }}
 
  }}<!--
 
 
--><!--{{#arraydefine:skillArray |
 
--><!--{{#arraydefine:skillArray |
      {{#ask: [[is a::skill mode]] [[campaign::Humans are the Worst]]|?Name|?Includes skill|format=array|mainlabel=-}}
 
 
       {{#ask: [[is a :: skill]] [[skill in mode :: {{#arrayprint: modeArray | {{!}}{{!}} }}]]
 
       {{#ask: [[is a :: skill]] [[skill in mode :: {{#arrayprint: modeArray | {{!}}{{!}} }}]]
 
       |?Name  
 
       |?Name  
Line 67: Line 60:
 
       }}
 
       }}
 
   }}--><!--
 
   }}--><!--
 +
-->{{#hashdefine:skillModeHash |
 +
      {{#ask: [[is a::skill mode]] [[campaign::Humans are the Worst]] [[name :: {{#arrayprint: modeArray | {{!}}{{!}} }}]]
 +
        |?Name
 +
        |?Includes skill
 +
        |format=array
 +
        |mainlabel=-
 +
      }}
 +
      | ,
 +
      | <PROP>
 +
  }}<!--
 +
 +
-->{{#hashdefine: skillHash}}<!--
 +
-->{{#hashprint: skillModeHash | | <modename> | <modeskills> | <!--
 +
  -->{{#arraydefine: modeSkills | <modeskills> | <MANY> | unique}}<!--
 +
  -->{{#arrayprint:  modeSkills | | <skillname> | <!--
 +
      -->{{#arraydefine: skillModes | {{#hashvalue: skillHash | <skillname>}} <MANY> <modename> | <MANY> | unique,sort=asc}}<!--
 +
      -->{{#hashinclude: skillHash | <skillname>={{#arrayprint: skillModes | <MANY>}} }}<!--
 +
  -->}}<!--
 +
-->}}<!--
 +
-->{{#arraydefine: skillArray | {{#hashprint: skillHash |,| <skillname> | <skillmodes> | <skillname><PROP><skillmodes><PROP>}} }}<!--
 +
 +
-->{{#if: {{#var: debug}} |<!--
 +
  -->query result (skillModeHash): {{#hashprint: skillModeHash | | <modename> | <modeskills> | <modename>=<modeskills><br/>}}<!--
 +
  -->skillHash: {{#hashprint: skillHash | | <skillname> | <skillmodes> | <skillname>=<skillmodes><br/>}}<!--
 +
  -->skillArray: {{#arrayprint: skillArray | <br/> }}<br/><!--
 +
-->}}<!--
 +
 
   Now iterate over all the skills returned from our query
 
   Now iterate over all the skills returned from our query
-->{{#arrayprint: skillArray | | <skill> | <!--
+
-->{{#hashprint: skillHash | | <skillname> | <skillmodes> | <!--
  
 
   -->{{#hashdefine: currentSkill}}<!--
 
   -->{{#hashdefine: currentSkill}}<!--
  
      Array items are page, name, mode(s)
+
   -->{{#vardefine: currentSkillName         | <skillname> }}<!--
  -->{{#vardefine: currentSkillPage      | {{#explode:<skill>|<PROP>|0}} }}<!--
 
   -->{{#vardefine: currentSkillName       | {{#explode:<skill>|<PROP>|1}} }}<!--
 
  
 
       First we create an array containing all the modes the current skill  
 
       First we create an array containing all the modes the current skill  
Line 81: Line 99:
 
       the character's modes that contain the current skill. This final array  
 
       the character's modes that contain the current skill. This final array  
 
       is currentSkillModes.
 
       is currentSkillModes.
   -->{{#arraydefine: currentSkillAllModes  | {{#explode:<skill>|<PROP>|2}} |<MANY>}}<!--
+
   -->{{#arraydefine: currentSkillAllModes  | <skillmodes> | <MANY> }}<!--
 
   -->{{#arraysearcharray: currentSkillModes | modeArray | /^{{#arrayprint: currentSkillAllModes | {{!}} }}$/ }}<!--
 
   -->{{#arraysearcharray: currentSkillModes | modeArray | /^{{#arrayprint: currentSkillAllModes | {{!}} }}$/ }}<!--
  
Line 95: Line 113:
 
       going to append the current skill to it and then put it back in modeHash.
 
       going to append the current skill to it and then put it back in modeHash.
 
   -->{{#hashdefine:  levelsOfPrimaryMode | {{#hashvalue: modeHash | {{#var: currentSkillPrimaryMode}} }} | <LEVELSEP> | <LEVELVAL> }}<!--
 
   -->{{#hashdefine:  levelsOfPrimaryMode | {{#hashvalue: modeHash | {{#var: currentSkillPrimaryMode}} }} | <LEVELSEP> | <LEVELVAL> }}<!--
 +
-->{{#if: {{#var: debug}} |<!--
 +
  -->levelsOfPrimaryMode ({{#var: currentSkillPrimaryMode}}): {{#hashprint: levelsOfPrimaryMode | <br/> | <level> | <skills> | <level> = <skills> }}<br/><!--
 +
-->}}<!--
 
       Array of the skills defined for the primary mode, at this level. Here we  
 
       Array of the skills defined for the primary mode, at this level. Here we  
 
       append the current skill along with a separator. The first time we do  
 
       append the current skill along with a separator. The first time we do  
Line 101: Line 122:
 
       sorting is nice :)
 
       sorting is nice :)
 
   -->{{#arraydefine: modeSkillsAtLevel <!--
 
   -->{{#arraydefine: modeSkillsAtLevel <!--
       -->| {{#hashvalue: modeLevelsHash | {{#var: currentSkillLevel }} }} <LEVELSKILL> {{#var: currentSkillName}} <!--
+
       -->| {{#hashvalue: levelsOfPrimaryMode | {{#var: currentSkillLevel }} }} <LEVELSKILL> {{#var: currentSkillName}} <!--
 
       -->| <LEVELSKILL> | unique,sort=asc <!--
 
       -->| <LEVELSKILL> | unique,sort=asc <!--
 
   -->}}<!--
 
   -->}}<!--
 
       Now we reassemble the original hash:
 
       Now we reassemble the original hash:
   -->{{#hashinclude: levelsOfCurrentMode | {{#var: currentSkillLevel }} = {{#arrayprint: modeSkillsAtLevel | <LEVELSKILL> }} }}<!--
+
   -->{{#hashinclude: levelsOfPrimaryMode | {{#var: currentSkillLevel }} = {{#arrayprint: modeSkillsAtLevel | <LEVELSKILL> }} }}<!--
 
   -->{{#hashinclude: modeHash            | <!--
 
   -->{{#hashinclude: modeHash            | <!--
       -->  {{#var: currentSkillPrimaryMode}} = {{#hashprint: levelsOfCurrentMode | <LEVELSEP> | <K> | <V> | <K><LEVELVAL><V> }} <!--
+
       -->  {{#var: currentSkillPrimaryMode}} = {{#hashprint: levelsOfPrimaryMode | <LEVELSEP> | <K> | <V> | <K><LEVELVAL><V> }} <!--
 
   -->}}<!--
 
   -->}}<!--
 +
 +
  -->{{#arrayreset: modeSkillsAtLevel | currentSkillAllModes | currentSkillModes }}<!--
 +
  -->{{#hashreset: currentSkill | levelsOfPrimaryMode }}<!--
  
 
-->}}<!--
 
-->}}<!--
  
 
   Once the above loop is done modeHash should have the desired structure.
 
   Once the above loop is done modeHash should have the desired structure.
 +
 +
-->{{#if: {{#var: debug}} |<!--
 +
-->modeHash: {{#hashprint: modeHash | <br/> | <modename> | <levels> | <modename> = <levels> }}<br/><!--
 +
-->}}<!--
  
  
Line 190: Line 218:
 
}}<!-- end section  
 
}}<!-- end section  
 
-->}}<!-- end if
 
-->}}<!-- end if
 
  end debug
 
  
  
 
--></onlyinclude>
 
--></onlyinclude>
 
|}
 
|}

Revision as of 12:13, 27 May 2014

[create]
Error creating thumbnail: File missing
Template documentation


Skill modes
  Banter Space Action
Superb (+5)      
Great (+4)      
Good (+3)      
Fair (+2)      
Average (+1)      
Points used 0 remaining 7 total 7