Module:HeroData/doc: Difference between revisionsGive feedback
added write_ground_dash_buckets docs |
Updated doc |
||
| Line 66: | 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). | ||
This function will automatically search for the variable in the hero's top-level data, then the 'Weapon' block, then the 'AltFire' block. | |||
=== get_list_elem === | === get_list_elem === | ||
| Line 108: | Line 110: | ||
<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}} | ||
====Notes==== | |||
If the scaling type or the stat key is not found in the hero's data, this function returns an empty string instead of an error message. | |||
=== hero_has_stat === | |||
Checks if a hero possesses a specific stat in their Base data, Level Scaling (Boons), or Spirit Scaling. Used primarily for conditionally hiding rows in infoboxes. | |||
====Parameters==== | |||
* '''hero_key''' - Key of the hero. | |||
* '''stat_key''' - Key of the stat to check (e.g., BulletResist, TechResist). | |||
====Example==== | |||
<pre>{{#invoke:HeroData|hero_has_stat|hero_kelvin|TechResist}}</pre> | |||
{{#invoke:HeroData|hero_has_stat|hero_kelvin|TechResist}} | |||
=== get_hero_key === | === get_hero_key === | ||