From GamingWiki
(7 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
{{Documentation}} | {{Documentation}} | ||
− | + | == Example skill modes == | |
− | + | <!-- | |
− | -->{{# | + | --><onlyinclude><!-- |
+ | |||
+ | -->{{#vardefine: modeType | {{{type | {{{1 | }}} }}} }}<!-- | ||
+ | -->{{#vardefine: campaign | {{{campaign | {{{2 | }}} }}} }}<!-- | ||
+ | |||
+ | --><noinclude><!-- | ||
+ | -->{{#vardefine: modeType | default }}<!-- | ||
+ | -->{{#vardefine: campaign | Humans are the Worst }}<!-- | ||
+ | --></noinclude><!-- | ||
+ | |||
+ | -->{{#arraydefine: allModesArray <!-- | ||
-->| {{#ask: | -->| {{#ask: | ||
[[is a::skill mode]] | [[is a::skill mode]] | ||
{{#if: {{#var: modeType}} | [[mode type::{{#var: modeType}}]] }} | {{#if: {{#var: modeType}} | [[mode type::{{#var: modeType}}]] }} | ||
− | {{#if: {{ | + | {{#if: {{#var: campaign}} | [[campaign::{{#var:campaign}}]] }} |
− | |? | + | |?mode name |
− | |? | + | |?includes skill |
+ | |?includes stunt | ||
|format=array | |format=array | ||
|mainlabel=- | |mainlabel=- | ||
}} <!-- | }} <!-- | ||
− | -->| , | <PROP> }}<!-- | + | -->| , }}<!-- |
+ | |||
+ | -->{{#hashdefine: allModes}}<!-- | ||
+ | -->{{#arrayprint: allModesArray | | <line> | <!-- | ||
+ | -->{{#arraydefine: modeLine | <line> | <PROP>}}<!-- | ||
+ | -->{{#vardefine: modeName | {{#arrayindex: modeLine | 0}} }}<!-- | ||
+ | -->{{#arrayslice: modeParts | modeLine | 1}}<!-- | ||
+ | -->{{#hashinclude: allModes | {{#var: modeName}} = {{#arrayprint: modeParts | <PROP> }} }}<!-- | ||
+ | -->{{#arrayreset: modeLine | modeParts }}<!-- | ||
+ | -->}}<!-- | ||
+ | -->{{#arrayreset: allModesArray}}<!-- | ||
+ | |||
+ | Pick up just the hash keys: | ||
-->{{#hashtoarray: | allModes | modeNames}}<!-- | -->{{#hashtoarray: | allModes | modeNames}}<!-- | ||
-->{{#arraysort: modeNames | asc}}<!-- | -->{{#arraysort: modeNames | asc}}<!-- | ||
Line 26: | Line 49: | ||
--><nowiki/> | --><nowiki/> | ||
{| class="infobox" <!-- | {| class="infobox" <!-- | ||
− | -->{{#hashprint: allModes | | <modename> | < | + | -->{{#hashprint: allModes | | <modename> | <modeline> | <!-- |
-->{{#hashinclude: headerHash | {{#var:modeCount}} = <modename> }}<!-- | -->{{#hashinclude: headerHash | {{#var:modeCount}} = <modename> }}<!-- | ||
− | -->{{#arraydefine: skillsArray | < | + | -->{{#arraydefine: skillsArray | {{#explode: <modeline> | <PROP> | 0}} | <MANY>}}<!-- |
-->{{#hashinclude: skillsHash | {{#var:modeCount}} = {{#arrayprint: skillsArray | <br/>}} }}<!-- | -->{{#hashinclude: skillsHash | {{#var:modeCount}} = {{#arrayprint: skillsArray | <br/>}} }}<!-- | ||
+ | -->{{#if:{{#vardefineecho: currentStunts|{{#explode: <modeline> | <PROP> | 1}}}} |<!-- | ||
+ | -->{{#arraydefine: stuntsArray | {{#var: currentStunts}} | <MANY>}}<!-- | ||
+ | -->{{#hashinclude: stuntsHash | {{#var:modeCount}} = {{#arrayprint: stuntsArray | <br/> | <stunt> | Stunt: [[<stunt>]] }} }}<!-- | ||
+ | -->}}<!-- | ||
-->{{#vardefine: modeCount | {{#expr: {{#var: modeCount}} +1}} }}<!-- | -->{{#vardefine: modeCount | {{#expr: {{#var: modeCount}} +1}} }}<!-- | ||
-->{{#ifexpr: {{#var: modeCount}} mod 3 = 0 or {{#var: modeCount}} >= {{#arraysize: modeNames}} | <!-- | -->{{#ifexpr: {{#var: modeCount}} mod 3 = 0 or {{#var: modeCount}} >= {{#arraysize: modeNames}} | <!-- | ||
− | -->{{# | + | -->{{#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}} | }} <!-- | ||
+ | -->}}<nowiki/> | ||
+ | {{!}}- <!-- | ||
+ | -->{{#loop: modeNum | {{#var: loopFrom}} | {{#var: loopCount}} |<nowiki/> | ||
+ | {{!}} {{#hashvalue: skillsHash | {{#var: modeNum}} | }} <!-- | ||
+ | -->}}<nowiki/> | ||
+ | {{!}}- <!-- | ||
+ | -->{{#if: {{#hashsize: stuntsHash}} |<!-- | ||
+ | -->{{#loop: modeNum | {{#var: loopFrom}} | {{#var: loopCount}} |<nowiki/> | ||
+ | {{!}} {{#hashvalue: stuntsHash | {{#var: modeNum}} | }} <!-- | ||
+ | -->}}<nowiki/> | ||
{{!}}- <!-- | {{!}}- <!-- | ||
− | --> | + | -->}}<!-- |
− | + | -->{{#arrayreset: skillsArray|stuntsArray}}<!-- | |
− | + | -->{{#hashreset: headerHash|skillsHash|stuntsHash}}<!-- | |
− | -->{{#arrayreset: skillsArray}}<!-- | ||
− | -->{{#hashreset: headerHash|skillsHash}}<!-- | ||
-->}}<!-- 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 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. |
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:)) = |