Toggle menu
Toggle preferences menu
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.

Module:HeroData/doc: Difference between revisions

From Deadlock Wiki
Sur (talk | contribs)
m get_localized_var now a parameter in get_var
Sur (talk | contribs)
m get_list_elem added
Line 43: Line 43:
* '''hero_name''' - Name of the hero, in english
* '''hero_name''' - Name of the hero, in english
* '''hero_var''' - Key of the hero's variable, see [[Data:HeroData.json]]
* '''hero_var''' - Key of the hero's variable, see [[Data:HeroData.json]]
* '''sig_figs_or_localize''' - OPTIONAL, # of sig figs to round to if retrieving a float, or "true" if its a string that should be localized
* '''sig_figs_or_localize''' - OPTIONAL, # of sig figs to round to if retrieving a float, or "true" if its a string that should be localized. See Localizable values section.


====Examples====
====Examples====
Line 73: Line 73:
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 ===
Retrieve a specified element from a list
==== Parameters ====
* '''hero_name''' - Name of the hero, in english
* '''hero_var''' - Key of the hero's variable, see [[Data:HeroData.json]]
* '''number''' - Index to retrieve from the list. 1 for 1st element, 2 for 2nd element, etc.
* '''localize''' - OPTIONAL - "true" if its a string that should be localized. See Localizable values section.
== Localizable values ==
Localizable values as of writing this:
Localizable values as of writing this:
* Lore
* Lore