Template:NpcData/doc: Difference between revisions

LVL (talk | contribs)
Created page with "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 (like `MaxHealth`) 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''' <code><nowiki>{{NpcData|NPC Name|Stat Name|Rounding}}</nowiki></code> '''Parameters''' * '''First..."
 
LVL (talk | contribs)
Added templatedata
Line 41: Line 41:
** '''Code:''' <code><nowiki>{{NpcData|npc_boss_tier2|NearbyEnemyResistanceValues|index=4}}</nowiki></code>
** '''Code:''' <code><nowiki>{{NpcData|npc_boss_tier2|NearbyEnemyResistanceValues|index=4}}</nowiki></code>
** '''Result:''' {{NpcData|npc_boss_tier2|NearbyEnemyResistanceValues|index=4}}
** '''Result:''' {{NpcData|npc_boss_tier2|NearbyEnemyResistanceValues|index=4}}
<templatedata>
{
"description": "A shortcut for Module:NpcData to display stats for NPCs, either a single value or an item from a list.",
"params": {
"1": {
"label": "NPC Name",
"description": "The internal key for the NPC (e.g., npc_boss_tier2).",
"type": "string",
"required": true,
"example": "trooper_medic",
"aliases": [ "npc" ]
},
"2": {
"label": "Stat or List Name",
"description": "The name of the stat (e.g., MaxHealth) or the list (e.g., NearbyEnemyResistanceValues).",
"type": "string",
"required": true,
"example": "MaxHealth",
"aliases": [ "stat" ]
},
"3": {
"label": "Rounding",
"description": "(Optional) A number to round a stat to that many significant figures. Does not apply when getting an item from a list.",
"type": "number",
"required": false,
"aliases": [ "round" ]
},
"index": {
"label": "Index",
"description": "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.",
"type": "number",
"required": false,
"example": "4"
}
},
"format": "inline"
}
</templatedata>
<includeonly>
[[Category:Templates]]
</includeonly><noinclude>
[[Category:Template documentation]]
</noinclude>