Template:NpcData/doc

From The Deadlock Wiki
Revision as of 15:12, 14 November 2025 by LVL (talk | contribs)
Jump to navigation Jump to search

This template is a shortcut for Module:NpcData to make it easier to display NPC stats on a page.

It can be used to get a single stat (including nested ones) or an item from a list of stats.

How to Use

Getting a Single or Nested Stat

This is the most common use. Provide the information in the following order. For nested stats, simply add more parameters for each level of nesting.

Syntax {{NpcData|NPC Name|Key 1|Key 2|...|Rounding}}

Parameters

  • First parameter (NPC Name): The internal key for the NPC (e.g., npc_boss_tier2).
  • Second, Third, etc. parameters (Keys): The path to the stat you want. For a simple stat, this is just one key. For a nested stat, provide each key as a separate parameter.
  • Final parameter (Rounding): (Optional) If the final parameter is a number, it will be used to round the result to that many significant figures.

Examples

  • To get the max health of a Medic Trooper:
    • Code: {{NpcData|trooper_medic|MaxHealth}}
    • Result: 350
  • If you misspell a stat, you will see an error:
    • Code: {{NpcData|trooper_medic|MaxHeath}}
    • Result: Error: Key "MaxHeath" not found in path "trooper_medic".
  • To get a nested shield stat (using multiple parameters):
    • Code: {{NpcData|npc_super_neutral|Shield|BaseAbsorptionPerSecond}}
    • Result: Error: Key "Shield" not found in path "npc_super_neutral".
  • To get a deeply nested ability name:
    • Code: {{NpcData|npc_boss_tier2|BoundAbilities|1|Name}}
    • Result: Error: Key "1" not found in path "npc_boss_tier2.BoundAbilities".

Getting an Item from a List

To get a single value from a list, you must use the named index= parameter.

Syntax {{NpcData|NPC Name|List Name|index=Position Number}}

Parameters

  • First parameter (NPC Name): The internal key for the NPC.
  • Second parameter (List Name): The name of the list property (e.g., NearbyEnemyResistanceValues).
  • index= The position in the list. The first item is 1, the second is 2, and so on.

Example

  • The Tier 2 Boss has a list of resistance values. To get the 4th value in that list:
    • Code: {{NpcData|npc_boss_tier2|NearbyEnemyResistanceValues|index=4}}
    • Result: Error: Key "NearbyEnemyResistanceValues" not found in path "npc_boss_tier2".

A shortcut for Module:NpcData to display stats for NPCs. Can retrieve simple stats, nested stats, or an item from a list.

Template parameters

This template prefers inline formatting of parameters.

ParameterDescriptionTypeStatus
NPC Name1 npc

The internal key for the NPC (e.g., npc_boss_tier2).

Example
trooper_medic
Stringrequired
Key 1 / List Name2 stat

The name of the stat (e.g., MaxHealth), the first key in a nested path (e.g., Shield), or the name of a list.

Example
MaxHealth
Stringrequired
Key 2 / Rounding3

The second key in a nested path (e.g., BaseAbsorptionPerSecond) OR an optional number to round the result to that many significant figures.

Stringoptional
Key 3 / Rounding4

The third key in a nested path OR an optional rounding number.

Stringoptional
Rounding5

An optional number to round the result to that many significant figures.

Numberoptional
Indexindex

The position of the item to get from a list (e.g., 4 for the 4th item). Using this parameter changes the template's behavior to get an item from a list.

Example
4
Numberoptional