Toggle search
Search
Toggle menu
110
215
16
2K
SpiritVale Wiki
Navigation
Main page
Recent changes
Random page
Help about MediaWiki
Special pages
Upload file
Toggle preferences menu
Notifications
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.
user-interface-preferences
Personal tools
Talk
Contributions
Create account
Log in
Join the Playtest on Steam Now:
SpiritVale
Editing
Module:GamePassives/doc
From SpiritVale Wiki
Views
Read
Edit
View history
associated-pages
Module
Discussion
More actions
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
== Module:GamePassives == '''Module: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]] β <code>GameData.loadPassives()</code>. * Looks up passives primarily by display <code>"Name"</code> (what editors use), with <code>"Internal Name"</code> as an optional fallback. * Builds a table with only the fields that actually exist for that passive. ---- == Data source == Passive 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: * <code>"Name"</code> β the display name (what players and editors will usually see and use). * <code>"Internal Name"</code> β the stable ID used internally and available as an optional parameter for power users and tooling. Common fields include: * <code>Icon</code> * <code>Description</code> * <code>Max Level</code> * <code>Users</code> (e.g. Classes) * <code>Requirements</code> * <code>Passive Effects</code> * <code>Status Applications</code> * <code>Notes</code> ---- == Output == For a given passive, the module renders a table with the CSS class <code>spiritvale-passive-infobox</code>. 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 <code>"Passive Effects"</code> (Type name, optional Expression, Base and Per Level where present) * Status interactions: ** Status Applications (if any) * Notes: ** Any entries from <code>"Notes"</code> (one per line) Rows are only shown if the underlying field exists in the JSON for that passive. ---- == Public interface == The module exposes a single entry point for templates: === <code>GamePassives.infobox(frame)</code> === This is usually called via <code>#invoke</code> from a template, not directly from pages. It accepts the following parameters (either passed directly or via a wrapper template): * <code>1</code> β unnamed parameter; treated as the passive <code>"Name"</code>. * <code>name</code> β explicit display <code>"Name"</code> of the passive (equivalent to <code>1</code>). * <code>id</code> β <code>"Internal Name"</code> of the passive (optional fallback / power use). Lookup order: # If <code>name</code> or the first unnamed parameter is provided and matches a recordβs <code>"Name"</code>, that record is used. # Otherwise, if <code>id</code> is provided and matches an <code>"Internal Name"</code>, 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): {{#invoke:GamePassives|infobox|name=Honed Blade}} or: {{#invoke:GamePassives|infobox|id=CritMastery}} ---- == Template:Passive == The recommended way to use this module is via a small wrapper template, for example: Template:Passive {{#invoke:GamePassives|infobox | 1={{{1|}}} | name={{{name|}}} | id={{{id|}}} }} Typical usage on any page: {{Passive|Honed Blade}} or, explicitly: {{Passive|name=Honed Blade}} Internal IDs can still be used when needed: {{Passive|id=CritMastery}} This keeps page wikitext simple while centralizing all JSON loading and formatting logic inside Lua.
Summary:
Please note that all contributions to SpiritVale Wiki may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
SpiritVale Wiki:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Templates used on this page:
Data:passives.json
(
view source
) (protected)
Template:Passive
(
edit
)
Module:GameData
(
view source
) (protected)
Module:GamePassives
(
view source
) (protected)
Editing
Module:GamePassives/doc
From SpiritVale Wiki