Editing Module:HeroData/docGive feedback
The edit can be undone.
Please check the comparison below to verify that this is what you want to do, and then publish the changes below to finish undoing the edit.
| Latest revision | Your text | ||
| Line 2: | Line 2: | ||
* [[Module:HeroData/nav]] - For nav box purposes | * [[Module:HeroData/nav]] - For nav box purposes | ||
* [[Module:HeroData/release]] - For determining the release status of a hero | * [[Module:HeroData/release]] - For determining the release status of a hero | ||
* [[Module:HeroData/name]] - For determining translation key using hero name | |||
* [[Module:HeroDataArrays]] - For tables in stat pages | * [[Module:HeroDataArrays]] - For tables in stat pages | ||
| Line 65: | Line 66: | ||
If using localize parameter, ensure the value is a string. See [[Data:HeroData.json]], you will notice that hero_astro's "Lore" variable has the value "hero_astro_lore". This key is then sent to [[Module:Lang]] which checks for it in [[Data:Lang_en.json]] (or a different language). | If using localize parameter, ensure the value is a string. See [[Data:HeroData.json]], you will notice that hero_astro's "Lore" variable has the value "hero_astro_lore". This key is then sent to [[Module:Lang]] which checks for it in [[Data:Lang_en.json]] (or a different language). | ||
=== get_list_elem === | === get_list_elem === | ||
| Line 109: | Line 100: | ||
* '''hero_var''' - Key of the hero's variable that is inside either "Spirit Scaling" or "Level Scaling", see [[Data:HeroData.json]] | * '''hero_var''' - Key of the hero's variable that is inside either "Spirit Scaling" or "Level Scaling", see [[Data:HeroData.json]] | ||
* '''sig_figs_or_localize''' - OPTIONAL, # of sig figs to round to. | * '''sig_figs_or_localize''' - OPTIONAL, # of sig figs to round to. | ||
====Examples==== | ====Examples==== | ||
| Line 118: | Line 108: | ||
<pre>{{#invoke:HeroData|get_hero_scalar|hero_atlas|Level|BulletDamage|2}}</pre> | <pre>{{#invoke:HeroData|get_hero_scalar|hero_atlas|Level|BulletDamage|2}}</pre> | ||
{{#invoke:HeroData|get_hero_scalar|hero_atlas|Level|BulletDamage|2}} | {{#invoke:HeroData|get_hero_scalar|hero_atlas|Level|BulletDamage|2}} | ||
=== get_hero_key === | === get_hero_key === | ||
Returns the key of the specified hero's english name | Returns the key of the specified hero's english name | ||
====Parameters==== | ====Parameters==== | ||
* '''hero_name''' - Name of the hero in english | * '''hero_name''' - Name of the hero in english | ||
====Example==== | ====Example==== | ||
<pre>{{#invoke:HeroData|get_hero_key|Abrams}}</pre> | <pre>{{#invoke:HeroData|get_hero_key|Abrams}}</pre> | ||
=== get_ability_key === | === get_ability_key === | ||
| Line 178: | Line 138: | ||
<pre>{{#invoke:HeroData|get_hero_tag|Abrams|1}}</pre> | <pre>{{#invoke:HeroData|get_hero_tag|Abrams|1}}</pre> | ||
=== | === write_infobox === | ||
Writes a [[Template:Infobox_hero]] template call for a given hero | |||
====Parameters==== | ====Parameters==== | ||
* ''' | * '''hero_name''' – Name of the hero, in english | ||
====Example==== | |||
From wikitext:<br> | |||
<pre>{{#invoke:HeroData|write_infobox|HERO_NAME}}</pre> | |||
Which outputs | |||
{{#invoke:HeroData|write_infobox|Abrams}} | |||
=== write_stat_infoboxes === | |||
Writes all 3 [[Template:Infobox_stat]] template calls (Weapon, Vitality, Spirit) for a given hero | |||
====Parameters==== | |||
* '''hero_name''' – Name of the hero, in english | |||
====Example==== | |||
From wikitext:<br> | |||
<pre>{{#invoke:HeroData|write_stat_infoboxes|HERO_NAME}}</pre> | |||
Which outputs | |||
{{#invoke:HeroData|write_stat_infoboxes|Abrams}} | |||
=== write_hero_comparison_table === | |||
Writes the [[Hero Comparison]] table for a specific Level and Spirit Power | |||
====Parameters==== | |||
* '''level''' - Number of [[Level]]s / Power Increases | |||
* '''spirit_power''' - Amount of Spirit power | |||
Both parameters are optional, as if both are 0 or not provided, the outputted table will be at base and will also include the level/SS scaling in each cell along with the base value, rather than the scaled value. | |||
====Example==== | ====Example==== | ||
<pre>{{#invoke:HeroData| | From wikitext:<br> | ||
{{#invoke:HeroData| | <pre>{{#invoke:HeroData|write_hero_comparison_table|LEVEL|SPIRITPOWER}}</pre> | ||
Which outputs | |||
{{#invoke:HeroData|write_hero_comparison_table|11|200}} | |||
=== write_role_playstyle_quote === | === write_role_playstyle_quote === | ||
| Line 230: | Line 223: | ||
== Internal Utility Functions == | == Internal Utility Functions == | ||
The following functions are | The following functions are primarily for internal use but may be useful for advanced users: | ||
=== get_json_item === | === get_json_item === | ||
| Line 238: | Line 231: | ||
* '''name''' - Name of the hero in english | * '''name''' - Name of the hero in english | ||
=== | === get_similar_items === | ||
Returns | Returns an array of hero tables that have a specified property | ||
====Parameters==== | ====Parameters==== | ||
* ''' | * '''property''' - Property key to search for | ||
== Scaling System == | == Scaling System == | ||