Module:ItemData/doc: Difference between revisionsGive feedback
Jump to navigation
Jump to search
Gammaton32 (talk | contribs) |
Gammaton32 (talk | contribs) No edit summary |
||
| Line 11: | Line 11: | ||
*<code>get_prop|ITEM_NAME|PROPERTY</code> | *<code>get_prop|ITEM_NAME|PROPERTY</code> | ||
**Returns the value of one of the item's properties. Check the [[Data:ItemData.json|json file]] for item properties | **Returns the value of one of the item's properties. Check the [[Data:ItemData.json|json file]] for item properties | ||
*<code>get_codename|ITEM_NAME</code> | |||
**Returns the item's codename in game files | |||
==Example== | ==Example== | ||
| Line 30: | Line 32: | ||
for example: | for example: | ||
<pre>{{#invoke:ItemData|get_prop|{{#var:item_key_or_en}}|TechPower}}</pre> | <pre>{{#invoke:ItemData|get_prop|{{#var:item_key_or_en}}|TechPower}}</pre> | ||
To get Boundless Spirit's codename: | |||
<pre>{{#invoke:ItemData|get_codename|Boundless Spirit}}</pre> | |||
and it would return: | |||
<code>{{#invoke:ItemData|get_codename|Boundless Spirit}}</code> | |||
Revision as of 15:46, 7 May 2025
Loads data from Data:ItemData.json
Usage
{{#invoke:ItemData|FUNCTION_NAME|PARAMETER1|PARAMETER2}}
Functions
get_cost|ITEM_NAME- Returns the total cost including components.
get_type|ITEM_NAME- The ItemData.json has different names for each category: Weapon = Weapon, Vitality = Armor, Spirit = Tech. This function will return Weapon, Vitality, or Spirit
is_active|ITEM_NAME- returns true/false
get_prop|ITEM_NAME|PROPERTY- Returns the value of one of the item's properties. Check the json file for item properties
get_codename|ITEM_NAME- Returns the item's codename in game files
Example
To get the total cost of Boundless Spirit you'd type:
{{#invoke:ItemData|get_cost|Boundless Spirit}}
and it would return:
6,400
To get Boundless Spirit's Spirit Power:
{{#invoke:ItemData|get_prop|Boundless Spirit|TechPower}}
and it would return:
30
If an item key (English name) has been provided, the item name can be replaced by:
{{#var:item_key_or_en}}
for example:
{{#invoke:ItemData|get_prop|{{#var:item_key_or_en}}|TechPower}}
To get Boundless Spirit's codename:
{{#invoke:ItemData|get_codename|Boundless Spirit}}
and it would return:
upgrade_boundless_spirit