Module:GameSkills/doc: Difference between revisions
More actions
Created page with "== Module:GameSkills == '''Module:GameSkills''' renders skill data from Data:skills.json into a reusable infobox-style table. It is intended to be used via a template (for example Template:Skill) so that skills can be embedded on any page without creating individual skill pages. This module: * Loads data via Module:GameData → <code>GameData.loadSkills()</code>. * Looks up skills by their <code>"Internal Name"</code> (fast) or by display <code>"Name"</co..." |
|||
| Line 33: | Line 33: | ||
* <code>"Internal Name"</code> – the stable ID used in templates (e.g. <code>Bash</code>, <code>Dispell</code>). | * <code>"Internal Name"</code> – the stable ID used in templates (e.g. <code>Bash</code>, <code>Dispell</code>). | ||
* <code>"Name"</code> – the name that most players will be familiar with). | |||
---- | ---- | ||
Revision as of 19:36, 12 December 2025
Module:GameSkills
Module:GameSkills renders skill data from Data:skills.json into a reusable infobox-style table.
It is intended to be used via a template (for example Template:Skill) so that skills can be embedded on any page without creating individual skill pages.
This module:
- Loads data via Module:GameData →
GameData.loadSkills(). - Looks up skills by their
"Internal Name"(fast) or by display"Name"(fallback). - Builds a table with only the fields that actually exist for that skill.
Data source
Skill data comes from Data:skills.json, which is a JSON page with this top-level structure (see Module:GameData/doc for full details):
{
"version": "SpiritVale-0.8.2",
"schema_version": 1,
"generated_at": "2025-12-12T17:24:05.807675+00:00",
"records": [
{
"Name": "Some Skill",
"Internal Name": "SomeSkillInternalId",
"...": "other fields specific to skills"
}
]
}
Each record is a single skill. The important key for lookups is:
"Internal Name"– the stable ID used in templates (e.g.Bash,Dispell)."Name"– the name that most players will be familiar with).
Output
For a given skill, the module renders a table with the CSS class sv-skill-infobox.
Depending on what exists in the JSON record, the table may include:
- Header row with skill name.
- Icon (from
"Icon", as a file name likeskill-example.webp). - Description.
- Type line (combined from
Damage Type,Element Type,Target Type,Cast Type). - Max Level.
- Users (Classes, Summons, Monsters).
- Mechanics:
- Range
- Area (size / effective distance)
- Cast Time / Cooldown / Duration
- Resource Cost (Mana / HP)
- Statuses applied.
- Statuses removed.
Rows are only shown if the underlying field exists in the JSON for that skill.
Public interface
The module exposes a single entry point for templates:
GameSkills.infobox(frame)
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):
id–"Internal Name"of the skill (preferred).name– display"Name"of the skill (fallback, slower lookup).
Lookup order:
- If
idis provided and matches an"Internal Name", that record is used. - Otherwise, if
nameis provided, the module scans all records for a matching"Name". - If nothing is found, a small error message is returned.
Example direct usage (not recommended; normally use a template):
No skills found for: GameSkills/doc
Template:Skill
The recommended way to use this module is via a small wrapper template, for example:
Template:Skill
No skills found for: GameSkills/doc
Usage on any page:
Absolution | |||
|---|---|---|---|
Removes all buffs and harmful statuses from the target, returning them to a neutral state. | |||
| |||
| Classes | Acolyte | ||
| Required Skills | Arcanum Ward (Lv.1) | ||
| Range | 10 | ||
| Timing | Cast Time: 2s | ||
| Resource Cost | MP: 70 | ||
| Removes | All Status Effects – 100% | ||
or, using the display name (slower):
Absolution | |||
|---|---|---|---|
Removes all buffs and harmful statuses from the target, returning them to a neutral state. | |||
| |||
| Classes | Acolyte | ||
| Required Skills | Arcanum Ward (Lv.1) | ||
| Range | 10 | ||
| Timing | Cast Time: 2s | ||
| Resource Cost | MP: 70 | ||
| Removes | All Status Effects – 100% | ||
This keeps page wikitext simple while centralizing all JSON loading and formatting logic inside Lua.