Toggle menu
Toggle preferences menu
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.

Join the Playtest on Steam Now: SpiritVale

Revision as of 19:22, 12 December 2025 by Eviand (talk | contribs) (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...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

This is the documentation page for Module:GameSkills

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:GameDataGameData.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).

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 like skill-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:

  1. If id is provided and matches an "Internal Name", that record is used.
  2. Otherwise, if name is provided, the module scans all records for a matching "Name".
  3. 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.
Level Select
Level 5 / 5
Type
None
Element
Neutral
Target
Any
Cast Type
Target
ClassesAcolyte
Required SkillsArcanum Ward (Lv.1)
Range10
TimingCast Time: 2s
Resource CostMP: 70
RemovesAll 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.
Level Select
Level 5 / 5
Type
None
Element
Neutral
Target
Any
Cast Type
Target
ClassesAcolyte
Required SkillsArcanum Ward (Lv.1)
Range10
TimingCast Time: 2s
Resource CostMP: 70
RemovesAll Status Effects – 100%

This keeps page wikitext simple while centralizing all JSON loading and formatting logic inside Lua.