Module:MiscData/docGive feedback
This is the documentation page for Module:MiscData
This module allows you to display any misc. stats from the game's data files which can be found here Data:MiscData.json. For most uses, it is recommended to use the {{MiscData}} template.
How to Use
[edit source]To get data from the module, you use a command that looks like {{#invoke:MiscData|...}}. You will tell it which function to use and what information you need.
The basic format is:
{{#invoke:MiscData|function_name|parameter1|parameter2|...}}
Available Functions
[edit source]Get a Single or Nested Stat (`get_misc_var`)
[edit source]This is the primary function for retrieving misc data. It can get a simple top-level stat or traverse deeply into nested objects and arrays (up to 6 levels deep via the template).
Syntax
{{#invoke:MiscData|get_misc_var|Misc Name|Key 1|Key 2|...|Rounding}}
Parameters
- Misc Name: The internal key for the misc stat.
- Key 1, Key 2, ...: The path to the stat you want.
- For a simple stat, this is one key (e.g., `MaxHealth`).
- For nested data, provide each key in order (e.g., `RebirthModifier`, `RespawnDelay`).
- For arrays (lists), use the position number as a key (e.g., `IntrinsicModifiers`, `1`, `BULLET_ARMOR_DAMAGE_RESIST`).
- Rounding: (Optional) A number to round the result to that many significant figures. This should always be the last parameter.
Examples
- Code:
{{#invoke:MiscData|get_misc_var|medic_trooper_aoe_health_pickup_amber|RegenFixed|Base}} - Result: 150
- Code:
- If a path is incorrect, an error message will show the full path attempted:
- Code:
{{#invoke:MiscData|get_misc_var|medic_trooper_aoe_health_pickup_amber|InvalidKey|Stat}} - Result: Error: Key "InvalidKey" not found in path "medic_trooper_aoe_health_pickup_amber".
- Code: