Editing
Module
:
HeroData/doc
(section)
Give feedback
Jump to navigation
Jump to search
Warning:
You are not logged in. Once you make an edit, a temporary account will be created for you.
Learn more
.
Log in
or
create an account
to continue receiving notifications after this account expires, and to access other features.
Anti-spam check. Do
not
fill this in!
== Functions == === get_hero_var === Retrieve a hero variable's value, such as Abram's MaxHealth ====Parameters==== * '''hero_name''' - Name of the hero in english, or key of the hero. Preferred and recommended to use hero key, as its much more efficient. Search for the key in [[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. See Localizable values section. Note: Recommended to use hero key where possible, i.e. hero_atlas as its O(1) time complexity instead of hero name (Abrams) which is O(N). ====Examples==== From wikitext:<br> Using hero name in english <pre>{{#invoke:HeroData|get_hero_var|Abrams|MaxHealth}}</pre> {{#invoke:HeroData|get_hero_var|Abrams|MaxHealth}} Using hero key <pre>{{#invoke:HeroData|get_hero_var|hero_atlas|MaxHealth}}</pre> {{#invoke:HeroData|get_hero_var|hero_atlas|MaxHealth}} <pre>{{#invoke:HeroData|get_hero_var|Abrams|FalloffStartRange}}</pre> {{#invoke:HeroData|get_hero_var|Abrams|FalloffStartRange}} Round to 2 sig figs <pre>{{#invoke:HeroData|get_hero_var|Abrams|FalloffStartRange|2}}</pre> {{#invoke:HeroData|get_hero_var|Abrams|FalloffStartRange|2}} <pre>{{#invoke:HeroData|get_hero_var|Abrams|WeaponName}}</pre> {{#invoke:HeroData|get_hero_var|Abrams|WeaponName}} Localize <pre>{{#invoke:HeroData|get_hero_var|Abrams|WeaponName|true}}</pre> {{#invoke:HeroData|get_hero_var|Abrams|WeaponName|true}} ====Notes==== Only usable on variables that are integers, strings, or floats (meaning not dictionaries/hashes or arrays/lists). If using sig_figs parameter, ensure the value is a float. 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_alt_fire_var === Retrieve a hero's variable's value from "AltFire" table. Works the same as get_hero_var ====Examples==== <pre>{{#invoke:HeroData|get_alt_fire_var|Viscous|BulletDamage}}</pre> {{#invoke:HeroData|get_alt_fire_var|Viscous|BulletDamage}} === get_list_elem === Retrieve a specified element from a list ==== Parameters ==== * '''hero_name''' - Name of the hero in english, or hero key. Preferred and recommended to use hero key, as its much more efficient. Search for the key in [[Data:HeroData.json]] * '''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. ==== Example ==== From wikitext:<br> Using hero name in english <pre>{{#invoke:HeroData|get_list_elem|Abrams|WeaponTypes|2}}</pre> {{#invoke:HeroData|get_list_elem|Abrams|WeaponTypes|2}} Using hero key <pre>{{#invoke:HeroData|get_list_elem|hero_atlas|WeaponTypes|2}}</pre> {{#invoke:HeroData|get_list_elem|hero_atlas|WeaponTypes|2}} <pre>{{#invoke:HeroData|get_list_elem|Abrams|WeaponTypes|2|true}}</pre> {{#invoke:HeroData|get_list_elem|Abrams|WeaponTypes|2|true}} === get_hero_scalar === Retrieve a hero variable's scalar value that is inside either "Spirit Scaling" or "Level Scaling", such as Abram's BulletDamage (scaling). ====Parameters==== * '''hero_key''' - Key of the hero. Search for the key of a given hero in [[Data:HeroData.json]] * '''scaling_type''' - "Spirit" or "Level" * '''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. * '''no_template''' - OPTIONAL, return numerical value instead of scaling template. Has to be defined as "true" ====Examples==== <pre>{{#invoke:HeroData|get_hero_scalar|hero_atlas|Level|BulletDamage}}</pre> {{#invoke:HeroData|get_hero_scalar|hero_atlas|Level|BulletDamage}} Round to 2 sig figs <pre>{{#invoke:HeroData|get_hero_scalar|hero_atlas|Level|BulletDamage|2}}</pre> {{#invoke:HeroData|get_hero_scalar|hero_atlas|Level|BulletDamage|2}} No template <pre>{{#invoke:HeroData|get_hero_scalar|hero_atlas|Level|BulletDamage|2|no_template=true}}</pre> {{#invoke:HeroData|get_hero_scalar|hero_atlas|Level|BulletDamage|2|no_template=true}} ====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. The base value is looked up in the hero's top-level data, then the 'Weapon' block, then the 'AltFire' block, the same as get_hero_var. A stat counts as present when its base value is non-zero, or when it has any non-zero scaling. ====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 === Returns the key of the specified hero's english name. A hero key may also be passed, in which case it is returned unchanged. Matching is case-insensitive. Returns "Hero not found." when the input matches no hero. ====Parameters==== * '''hero_name''' - Name of the hero in english, or a hero key ====Example==== <pre>{{#invoke:HeroData|get_hero_key|Abrams}}</pre> === resolve_key === The same lookup as get_hero_key, but returns an empty string instead of "Hero not found." when the input matches no hero. Intended for templates that need to branch on whether the input names a hero at all. ====Parameters==== * '''hero_name_or_key''' - Name of the hero in english, or a hero key ====Example==== <pre>{{#invoke:HeroData|resolve_key|Abrams}}</pre> {{#invoke:HeroData|resolve_key|Abrams}} === get_ability_key === Gets the ability key from a hero's bound ability slot ====Parameters==== * '''hero_key''' - Key of the hero * '''slot_number''' - Slot number (1-based index) ====Example==== <pre>{{#invoke:HeroData|get_ability_key|hero_atlas|1}}</pre> === get_hero_tag === Retrieve a hero's description tags with [[Module:Lang]], to be used in [[Template:HeroRosterCard]] and [[Template:Infobox hero]] ====Parameters==== * '''name''' - Name of the hero in english. This is normally referenced from the template parameters * '''number''' - Which tag to call (1, 2 or 3) ====Example==== <pre>{{#invoke:HeroData|get_hero_tag|Abrams|1}}</pre> === has_tags === Returns "true" when the hero has description tags, or an empty string otherwise. Intended for templates that need to hide a tag block entirely for heroes without tags. ====Parameters==== * '''name''' - Name of the hero in english ====Example==== <pre>{{#invoke:HeroData|has_tags|Abrams}}</pre> {{#invoke:HeroData|has_tags|Abrams}} === write_role_playstyle_quote === Writes a formatted role and playstyle quotation for a hero ====Parameters==== * '''hero_key''' - Key of the hero ====Example==== <pre>{{#invoke:HeroData|write_role_playstyle_quote|hero_atlas}}</pre> === write_default_items === Writes the recommended items list for a hero ====Parameters==== * '''hero_key''' - Key of the hero (unlocalized) ====Example==== <pre>{{#invoke:HeroData|write_default_items|hero_atlas}}</pre> === write_ground_dash_buckets === Outputs a wikitable of heroes grouped by their GroundDashDuration using [[Template:HeroIcon]] ====Example==== <pre>{{#invoke:HeroData|write_ground_dash_buckets}}</pre> {{#invoke:HeroData|write_ground_dash_buckets}}
Summary:
Please note that all contributions to The Deadlock Wiki are considered to be released under the Creative Commons Attribution-NonCommercial-ShareAlike (see
Deadlock:Copyrights
for details). If you do not want your writing to be edited mercilessly and redistributed at will, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource.
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Preview page with this template
Navigation menu
Personal tools
Create account
Log in
associated-pages
Module
Discussion
English
Views
Read
Edit source
History
Tools
Search
Discord
Discord
Navigation
Main page
About us
Random page
Special pages
Recent changes
Unstable Rift
6h ago
路
~2026-IvyGankStone1157
Haze/Sounds
7h ago
路
Gammaton32
Haze/Voice lines
7h ago
路
Gammaton32
Grey Talon/Voice lines
7h ago
路
Gammaton32
Show more...
Interface Admin
Common CSS
Vector CSS
Minerva CSS
Citizen CSS
Brown theme CSS
Gadgets
Gadgets definition
Editing
How to edit
Style guide
All guides
New files
Unresolved feedback
Tools
What links here
Related changes
Page information