Template:HeroData

From The Deadlock Wiki
Revision as of 17:17, 8 February 2026 by LVL (talk | contribs) (Template to use the functions of Module:HeroData)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search
Template documentation [view] [edit] [history] [purge]

This template allows you to display hero stats automatically using the game files. It pulls data directly from Data:HeroData.json.

⚡ Quick Start

[edit source]
  1. Go to Data:HeroData.json and find the hero you want.
  2. Look for the stat you need.
  3. Use the template with the hero's name (or internal key) and the stat name.

Basic Example: {{HeroData|Abrams|MaxHealth}} → 800

or

{{HeroData|hero_atlas|MaxHealth}} → 800

📖 Template Functions

[edit source]

The template has different modes depending on what information you need.

Getting Stats (Default)

[edit source]

This is the most common use case. Retrieves a hero's base stat value. The module automatically checks the hero's top-level stats, then Weapon stats, then AltFire stats.

Syntax: {{HeroData|HERO_NAME|STAT_NAME|sig_figs_or_localize}}

Parameters:

  • HERO_NAME - The hero's name (e.g., Abrams, Bebop) or internal key (e.g., hero_atlas)
  • STAT_NAME - The stat to retrieve (e.g., MaxHealth, BulletResist)
  • sig_figs_or_localize (optional) - Either a number for rounding (significant figures) or true to localize the value

Examples:

  • {{HeroData|Abrams|MaxHealth}} → 800
  • {{HeroData|Bebop|BulletResist}} → 0
  • {{HeroData|Abrams|MaxHealth|2}} → 800 (rounded to 2 sig figs)
  • {{HeroData|Bebop|DPS|3}} → 59.3

Getting Alt Fire Stats

[edit source]

Retrieves stats specifically from a hero's alternate fire mode.

Syntax: {{HeroData|altfire|HERO_NAME|STAT_NAME|sig_figs_or_localize}}

Example:

  • {{HeroData|altfire|Shiv|BulletDamage}} → 4.36

Getting List Elements

[edit source]

Retrieves a specific element from a list/array property. Primarily used for weapon types.

Syntax: {{HeroData|list|HERO_NAME|LIST_NAME|INDEX|localize}}

Parameters:

  • LIST_NAME - The name of the list property (usually WeaponTypes)
  • INDEX - Which element to get (1 for first, 2 for second, etc.)
  • localize (optional) - Defaults to true for readable names. Set to false for raw internal keys.

Examples:

  • {{HeroData|list|Abrams|WeaponTypes|1}} → Spreadshot (returns "Spreadshot")
  • {{HeroData|list|Abrams|WeaponTypes|2}} → Close Range (returns "Close Range")
  • {{HeroData|list|Abrams|WeaponTypes|1|false}} → Attribute_EWeaponAttribute_Spreadshot (returns raw "Attribute_EWeaponAttribute_Spreadshot")

Note: By default, list elements are localized to give readable names like "Spreadshot" instead of "Attribute_EWeaponAttribute_Spreadshot".

Getting Scaling Values

[edit source]

Retrieves the scaling value for a stat and returns it formatted with the appropriate scaling template ({{Ss}} for Spirit or {{PI}} for Power Increases).

Syntax: {{HeroData|scalar|HERO_NAME|SCALING_TYPE|STAT_NAME|sig_figs_or_localize}}

Parameters:

  • SCALING_TYPE - Either Spirit or Level (for Power Increases)
  • STAT_NAME - The stat to check scaling for
  • sig_figs_or_localize (optional) - Rounding or localization

Examples:

  • {{HeroData|scalar|Sinclair|Spirit|MaxMoveSpeed}}x0.0138
  • {{HeroData|scalar|Bebop|Level|BulletResist}}+0.3

Note: Returns an empty string if the hero doesn't have scaling for that stat.

Getting Hero Tags

[edit source]

Retrieves one of a hero's three descriptive tags.

Syntax: {{HeroData|tag|HERO_NAME|TAG_NUMBER}}

Parameters:

  • HERO_NAME - The hero's display name (e.g., Abrams, Lady Geist)
  • TAG_NUMBER - 1, 2, or 3 (for the first, second, or third tag)

Examples:

  • {{HeroData|tag|Abrams|1}} → Tank
  • {{HeroData|tag|Lady Geist|2}} → Self Damage

📋 Common Stats

[edit source]

Here are some frequently used stats you can retrieve:

Vitality

[edit source]
  • MaxHealth - Maximum health
  • BaseHealthRegen - Health regeneration per second
  • BulletResist - Bullet resistance percentage
  • TechResist - Spirit resistance percentage
  • MeleeResist - Melee resistance percentage
  • MaxMoveSpeed - Movement speed
  • SprintSpeed - Sprint speed
  • StaminaCooldown - Stamina cooldown
  • Stamina - Stamina amount

Weapon

[edit source]
  • DPS - Damage per second
  • BulletDamage - Damage per bullet
  • RoundsPerSecond - Fire rate
  • ClipSize - Magazine/clip size
  • ReloadTime - Reload duration
  • LightMeleeDamage - Light melee damage
  • HeavyMeleeDamage - Heavy melee damage
  • BulletSpeed - Projectile speed
  • FalloffStartRange - Damage falloff start distance
  • FalloffEndRange - Damage falloff end distance
  • WeaponTypes - List of weapon attributes (use with list function)

Spirit

[edit source]
  • TechPower - Spirit power

For a complete list of stats, check Data:HeroData.json.

❌ Common Errors

[edit source]
  • Hero Not Found
    The hero name/key is incorrect. Make sure to use either the display name (e.g., Abrams) or internal key (e.g., hero_atlas).
  • Returns 0
    The stat doesn't exist for that hero, or the stat name is spelled incorrectly.
  • No Alt Fire
    This hero doesn't have an alternate fire mode.

💡 Tips

[edit source]
  • Hero Names: Most functions accept EITHER the internal hero key (e.g., hero_atlas) OR the display name (e.g., Abrams). The tag function ONLY accepts display names (e.g., Abrams, Lady Geist).
  • Significant Figures: The optional rounding parameter uses significant figures, not decimal places. 2 turns 1250 into 1300 and 0.125 into 0.13.
  • Nested Stats: The module automatically checks multiple locations for stats (top-level → Weapon → AltFire), so you don't need to specify where the stat is located.
  • Weapon Types: By default, the list function returns localized, human-readable names. This is almost always what you want!

Displays hero stats and information from game files. Use Data:HeroData.json to find available stats.

Template parameters[Edit template data]

This template prefers inline formatting of parameters.

ParameterDescriptionTypeStatus
Function or Hero Name1

Either a function name (altfire, list, scalar, tag) OR the hero's name/key when getting stats (e.g., Abrams or hero_atlas).

Suggested values
altfire list scalar tag
Example
Abrams
Stringrequired
Hero Name or Stat Name2

The hero's name/key (if param 1 is a function) OR the stat name to retrieve (if param 1 is a hero name).

Example
MaxHealth
Stringoptional
Stat Name, Index, or Options3

Depends on function: stat name for altfire/scalar, list name for list function, tag number for tag function, or sig_figs/localize for default function.

Stringoptional
Additional Parameter4

Additional parameter for specific functions (e.g., list index, sig_figs for altfire/scalar).

Stringoptional
Localization5

For list function: set to 'false' to get raw internal keys instead of localized names (defaults to 'true'). For scalar function: sig_figs or localize option.

Default
true
Stringoptional