From Dark and Darker Wiki

(template to filter weapons)
 
(changed comma)
 
Line 5: Line 5:
   | 0                      <!-- loops start value for {{ #var:i }} -->
   | 0                      <!-- loops start value for {{ #var:i }} -->
   | {{ #arraysize:weapons }} <!-- number of loops -->
   | {{ #arraysize:weapons }} <!-- number of loops -->
   | <nowiki/>{{#vardefine:currentweapon|{{ #arrayindex:weapons | {{ #var:i }} }}}}{{#if:{{#pos:{{Weapon_Data|{{#var:currentweapon}}|{{{filtercategory}}}}}|{{{filterkey}}}}}|{{#ifeq:{{ #var:first }}|true|{{#vardefine:first|false}}|,&nbsp;}}[[{{#var:currentweapon}}]]}}
   | <nowiki/>{{#vardefine:currentweapon|{{ #arrayindex:weapons | {{ #var:i }} }}}}{{#if:{{#pos:{{Weapon_Data|{{#var:currentweapon}}|{{{filtercategory}}}}}|{{{filterkey}}}}}|{{#ifeq:{{ #var:first }}|true|{{#vardefine:first|false}}|&nbsp;•&nbsp;}}[[{{#var:currentweapon}}]]}}
  }}
  }}
</includeonly><noinclude>Loops through all weapons, filters them according to "filtercategory" and "filterkey"
</includeonly><noinclude>Loops through all weapons, filters them according to "filtercategory" and "filterkey"

Latest revision as of 19:36, 30 August 2023

Loops through all weapons, filters them according to "filtercategory" and "filterkey"

Examples

Code Preview
{{FilterWeapons
|filtercategory        = classes
|filterkey = Bard
}}



{{FilterWeapons
|filtercategory        = weapontype
|filterkey = Axe
}}



No description.

Template parameters

ParameterDescriptionTypeStatus
Variable name to call from Weapon_Datafiltercategory

Filter Category

Example
classes, weapontype
Stringrequired
Key to be searched in the variable pulled from Weapon_Datafilterkey

Filter Key

Example
Bard, Sword
Stringrequired