Module:GamePassives/doc
More actions
This is the documentation page for Module:GamePassives
Module:GamePassives
edit sourceModule:GamePassives renders passive skill data from Data:passives.json into a reusable infobox-style table.
It is intended to be used via a template (for example Template:Passive) so that passives can be embedded on any page without creating individual pages for each passive.
This module:
- Loads data via Module:GameData →
GameData.loadPassives(). - Looks up passives primarily by display
"Name"(what editors use), with"Internal Name"as an optional fallback. - Builds a table with only the fields that actually exist for that passive.
Data source
edit sourcePassive data comes from Data:passives.json, which is a JSON page with this top-level structure (see Module:GameData/doc for full details):
{
"version": "SpiritVale-0.9.3",
"schema_version": 1,
"generated_at": "2025-12-12T17:24:05.784284+00:00",
"records": [
{
"Name": "Honed Blade",
"Internal Name": "CritMastery",
"...": "other fields specific to passives"
}
]
}
Each record is a single passive. Important keys:
"Name"– the display name (what players and editors will usually see and use)."Internal Name"– the stable ID used internally and available as an optional parameter for power users and tooling.
Common fields include:
IconDescriptionMax LevelUsers(e.g. Classes)RequirementsPassive EffectsStatus ApplicationsNotes
Output
edit sourceFor a given passive, the module renders a table with the CSS class spiritvale-passive-infobox.
Depending on what exists in the JSON record, the table may include:
- Header row with passive name (and icon, if present).
- Description.
- Max level.
- Users:
- Classes
- Summons
- Monsters
- Events
- Requirements:
- Required Skills (with required level)
- Required Weapons
- Required Stances
- Passive effects:
- Each entry from
"Passive Effects"(Type name, optional Expression, Base and Per Level where present)
- Each entry from
- Status interactions:
- Status Applications (if any)
- Notes:
- Any entries from
"Notes"(one per line)
- Any entries from
Rows are only shown if the underlying field exists in the JSON for that passive.
Public interface
edit sourceThe module exposes a single entry point for templates:
GamePassives.infobox(frame)
edit source
This is usually called via #invoke from a template, not directly from pages.
It accepts the following parameters (either passed directly or via a wrapper template):
1– unnamed parameter; treated as the passive"Name".name– explicit display"Name"of the passive (equivalent to1).id–"Internal Name"of the passive (optional fallback / power use).
Lookup order:
- If
nameor the first unnamed parameter is provided and matches a record’s"Name", that record is used. - Otherwise, if
idis provided and matches an"Internal Name", that record is used. - If nothing is found, a small error message is returned and the page is categorized for tracking.
Example direct usage (not recommended; normally use a template):
No passives found for: GamePassives/doc
or:
No passives found for: GamePassives/doc
Template:Passive
edit sourceThe recommended way to use this module is via a small wrapper template, for example:
Template:Passive
No passives found for: GamePassives/doc
Typical usage on any page:
Honed Blade | A life of combat has perfected your edge, each critical strike hits with ruthless efficiency. |
|---|---|
| General | |
| Max Level | 10 |
| Passive Effects | |
| Critical Damage | 3 / Lv |
or, explicitly:
Honed Blade | A life of combat has perfected your edge, each critical strike hits with ruthless efficiency. |
|---|---|
| General | |
| Max Level | 10 |
| Passive Effects | |
| Critical Damage | 3 / Lv |
Internal IDs can still be used when needed:
Honed Blade | A life of combat has perfected your edge, each critical strike hits with ruthless efficiency. |
|---|---|
| General | |
| Max Level | 10 |
| Passive Effects | |
| Critical Damage | 3 / Lv |
This keeps page wikitext simple while centralizing all JSON loading and formatting logic inside Lua.