From GamingWiki
Jump to: navigation, search
 
(5 intermediate revisions by the same user not shown)
Line 1: Line 1:
 
{{Documentation}}
 
{{Documentation}}
  
<onlyinclude><!--
+
== Example skill modes ==
 +
 
 +
<!--
 +
 
 +
--><onlyinclude><!--
  
 
-->{{#vardefine: modeType | {{{type | {{{1 | }}} }}} }}<!--
 
-->{{#vardefine: modeType | {{{type | {{{1 | }}} }}} }}<!--
 +
-->{{#vardefine: campaign | {{{campaign | {{{2 | }}} }}} }}<!--
 +
 +
--><noinclude><!--
 +
  -->{{#vardefine: modeType | default }}<!--
 +
  -->{{#vardefine: campaign | Humans are the Worst }}<!--
 +
--></noinclude><!--
  
 
-->{{#arraydefine: allModesArray <!--
 
-->{{#arraydefine: allModesArray <!--
Line 9: Line 19:
 
         [[is a::skill mode]]
 
         [[is a::skill mode]]
 
         {{#if: {{#var: modeType}} | [[mode type::{{#var: modeType}}]] }}
 
         {{#if: {{#var: modeType}} | [[mode type::{{#var: modeType}}]] }}
         {{#if: {{{campaign|}}} | [[campaign::{{{campaign}}}]] }}
+
         {{#if: {{#var: campaign}} | [[campaign::{{#var:campaign}}]] }}
       |?Name
+
       |?mode name
       |?Includes skill
+
       |?includes skill
       |?Includes stunt
+
       |?includes stunt
 
       |format=array
 
       |format=array
 
       |mainlabel=-
 
       |mainlabel=-
 
       }} <!--
 
       }} <!--
-->| , | <PROP> }}<!--
+
-->| , }}<!--
 +
 
 +
-->{{#hashdefine: allModes}}<!--
 
-->{{#arrayprint: allModesArray | | <line> | <!--
 
-->{{#arrayprint: allModesArray | | <line> | <!--
 
   -->{{#arraydefine: modeLine  | <line> | <PROP>}}<!--
 
   -->{{#arraydefine: modeLine  | <line> | <PROP>}}<!--
Line 22: Line 34:
 
   -->{{#arrayslice:  modeParts | modeLine | 1}}<!--
 
   -->{{#arrayslice:  modeParts | modeLine | 1}}<!--
 
   -->{{#hashinclude: allModes  | {{#var: modeName}} = {{#arrayprint: modeParts | <PROP> }} }}<!--
 
   -->{{#hashinclude: allModes  | {{#var: modeName}} = {{#arrayprint: modeParts | <PROP> }} }}<!--
 +
  -->{{#arrayreset: modeLine | modeParts }}<!--
 
-->}}<!--
 
-->}}<!--
 +
-->{{#arrayreset: allModesArray}}<!--
  
-->{{#if: |<!--
+
  Pick up just the hash keys:
-->{{#hashdefine: allModes <!--
 
-->| {{#ask:
 
        [[is a::skill mode]]
 
        {{#if: {{#var: modeType}} | [[mode type::{{#var: modeType}}]] }}
 
        {{#if: {{{campaign|}}} | [[campaign::{{{campaign}}}]] }}
 
      |?Name
 
      |?Includes skill
 
      |format=array
 
      |mainlabel=-
 
      }} <!--
 
-->| , | <PROP> }}<!--
 
-->}}<!--
 
 
 
 
-->{{#hashtoarray: | allModes | modeNames}}<!--
 
-->{{#hashtoarray: | allModes | modeNames}}<!--
 
-->{{#arraysort: modeNames | asc}}<!--
 
-->{{#arraysort: modeNames | asc}}<!--
Line 55: Line 56:
 
   -->{{#if:{{#vardefineecho: currentStunts|{{#explode: <modeline> | <PROP> | 1}}}} |<!--
 
   -->{{#if:{{#vardefineecho: currentStunts|{{#explode: <modeline> | <PROP> | 1}}}} |<!--
 
       -->{{#arraydefine: stuntsArray | {{#var: currentStunts}} | <MANY>}}<!--
 
       -->{{#arraydefine: stuntsArray | {{#var: currentStunts}} | <MANY>}}<!--
       -->{{#hashinclude: stuntsHash  | {{#var:modeCount}} = {{#arrayprint: stuntsArray | <br/> | <stunt> | [[<stunt>]] }} }}<!--
+
       -->{{#hashinclude: stuntsHash  | {{#var:modeCount}} = {{#arrayprint: stuntsArray | <br/> | <stunt> | Stunt: [[<stunt>]] }} }}<!--
 
   -->}}<!--
 
   -->}}<!--
  
Line 61: Line 62:
  
 
   -->{{#ifexpr: {{#var: modeCount}} mod 3 = 0 or {{#var: modeCount}} >= {{#arraysize: modeNames}} | <!--  
 
   -->{{#ifexpr: {{#var: modeCount}} mod 3 = 0 or {{#var: modeCount}} >= {{#arraysize: modeNames}} | <!--  
       -->{{#loop: modeNum | {{#expr: {{#var: modeCount}} -3}} | 3 |<nowiki/>
+
       -->{{#vardefine: loopCount | {{#expr: (({{#var: modeCount}}-1) mod 3) + 1}} }}<!--
 +
      -->{{#vardefine: loopFrom | {{#expr: {{#var: modeCount}} - {{#var: loopCount}} }} }}<!--
 +
      -->{{#loop: modeNum | {{#var: loopFrom}} | {{#var: loopCount}} |<nowiki/>
 
! {{#hashvalue: headerHash | {{#var: modeNum}} | &nbsp; }} <!--
 
! {{#hashvalue: headerHash | {{#var: modeNum}} | &nbsp; }} <!--
 
       -->}}<nowiki/>
 
       -->}}<nowiki/>
 
{{!}}- <!--
 
{{!}}- <!--
       -->{{#loop: modeNum | {{#expr: {{#var: modeCount}} -3}} | 3 |<nowiki/>
+
       -->{{#loop: modeNum | {{#var: loopFrom}} | {{#var: loopCount}} |<nowiki/>
 
{{!}} {{#hashvalue: skillsHash | {{#var: modeNum}} | &nbsp; }} <!--
 
{{!}} {{#hashvalue: skillsHash | {{#var: modeNum}} | &nbsp; }} <!--
 
       -->}}<nowiki/>
 
       -->}}<nowiki/>
 
{{!}}- <!--
 
{{!}}- <!--
 
       -->{{#if: {{#hashsize: stuntsHash}} |<!--
 
       -->{{#if: {{#hashsize: stuntsHash}} |<!--
         -->{{#loop: modeNum | {{#expr: {{#var: modeCount}} -3}} | 3 |<nowiki/>
+
         -->{{#loop: modeNum | {{#var: loopFrom}} | {{#var: loopCount}} |<nowiki/>
 
{{!}} {{#hashvalue: stuntsHash | {{#var: modeNum}} | &nbsp; }} <!--
 
{{!}} {{#hashvalue: stuntsHash | {{#var: modeNum}} | &nbsp; }} <!--
 
         -->}}<nowiki/>
 
         -->}}<nowiki/>
 
{{!}}- <!--
 
{{!}}- <!--
 
       -->}}<!--
 
       -->}}<!--
       -->{{#arrayreset: skillsArray}}<!--
+
       -->{{#arrayreset: skillsArray|stuntsArray}}<!--
 
       -->{{#hashreset:  headerHash|skillsHash|stuntsHash}}<!--
 
       -->{{#hashreset:  headerHash|skillsHash|stuntsHash}}<!--
 
   -->}}<!-- end ifexpr
 
   -->}}<!-- end ifexpr
  
 
-->| modeNames }}<!--
 
-->| modeNames }}<!--
 +
 +
-->{{#arrayreset: modeNames}}<!--
 +
-->{{#hashreset: allModes}}<!--
  
 
--><nowiki/>  
 
--><nowiki/>  
 
|}</onlyinclude>
 
|}</onlyinclude>

Latest revision as of 19:47, 4 July 2014

[create]
Error creating thumbnail: File missing
Template documentation

Example skill modes[edit]

Template:((#ask:
        is a::skill mode
        mode type::default
        campaign::Humans are the Worst
?mode name ?includes skill ?includes stunt format
array mainlabel=-
     Template:)) =