Template:NpcData/docGive feedback
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 like Shield.BaseAbsorptionPerSecond) or an item from a list of stats (like the 4th value in a list of resistances).
How to Use
Getting a Single Stat
This is the most common use. Provide the information in the following order.
Syntax
{{NpcData|NPC Name|Stat Name|Rounding}}
Parameters
- First parameter (NPC Name): The internal key for the NPC (e.g.,
npc_boss_tier2). - Second parameter (Stat Name): The name of the stat you want to look up (e.g.,
MaxHealth). Supports dot notation for nested stats (e.g.,Shield.BaseAbsorptionPerSecond). - Third parameter (Rounding): (Optional) A number 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
- Code:
- 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".
- Code:
- To get a nested shield stat:
- Code:
{{NpcData|npc_super_neutral|Shield.BaseAbsorptionPerSecond}} - Result: Error: Key "Shield.BaseAbsorptionPerSecond" not found in path "npc_super_neutral".
- Code:
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 is2, 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".
- Code:
A shortcut for Module:NpcData to display stats for NPCs, either a single value or an item from a list.
| Parameter | Description | Type | Status | |
|---|---|---|---|---|
| NPC Name | 1 npc | The internal key for the NPC (e.g., npc_boss_tier2).
| String | required |
| Stat or List Name | 2 stat | The name of the stat (e.g., MaxHealth) or the list (e.g., NearbyEnemyResistanceValues). Supports dot notation for nested stats (e.g., Shield.BaseAbsorptionPerSecond).
| String | required |
| Rounding | 3 round | (Optional) A number to round a stat to that many significant figures. Does not apply when getting an item from a list. | Number | optional |
| Index | index | 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.
| Number | optional |