Jump to content

Module:Gear/data/doc

From Community Wiki | Soulbound: Online

This is the documentation page for Module:Gear/data

The vocabulary behind every stat, rarity and slot on the wiki. It is a data-only module: five tables, no functions. Module:Stat loads it with mw.loadData, which means it is parsed once per page no matter how many times a stat is named — and also means nothing in here may be a function.

{{Stat}} , {{Stat/unit}} , {{RollStat}} , {{Rarity}}

and {{Range}}
all read from it. 213 mainspace pages depend on it.

Generated — read this first

This page is generated from current game data by the wiki's maintainers and re-published when the game's stat list changes. A hand edit will work immediately and correctly, but it can be overwritten by the next refresh. So:

  • Add the stat you need, then note it on Module talk:Gear/data so it goes into the source the generator reads. That is the only way to make it permanent.
  • Never restructure the tables or re-order the keys wholesale; a big diff makes the next refresh impossible to review.

p.stats

One entry per stat, keyed by the game's own snake_case name. Currently 54.

Field Meaning
label Wikitext, emitted verbatim — normally a link, e.g. "[[Attack Speed]]". It must point at a page that exists. Two live special cases: Precision links [[Precision (stat)|Precision]] because plain Precision is an old relic page, and all eight resistances link to the single Resistances page with a piped label.
unit "%" for a percentage stat, "" for a flat one. Nothing else. This is what {{Stat/unit}}
returns and what {{RollStat}}
appends to a range.
primary true for the six primaries — Power, Precision, Focus, Ferocity, Vitality, Will. Everything else is false.
page Optional. The article title for stats that have their own page. Omit it for a stat whose label points at a shared page (the resistances, DoT Interval, Projectile Speed, Applied Threat).

Adding a stat

One line, in alphabetical order by key:

["burn_chance"] = { label = "Burn Chance", unit = "%", primary = false },

With a page of its own:

["burn_chance"] = { label = "[[Burn Chance]]", unit = "%", primary = false, page = "Burn Chance" },

Then check three things: preview a page that uses the stat, confirm Category:Pages with script errors

is still empty, and confirm the label is not a red link. A stat left out of this table is not an error — {{Stat}}
renders an unknown key as itself, unlinked, so it shows up as plain text rather than disappearing.

Adding a stat here does not add a base-stat row to {{Infobox Gear}}

that template holds its own list. See Wiki:Item templates.

p.rarity

The rarity map, indexed 0–5: 0 = None, 1 = Common, 2 = Uncommon, 3 = Rare, 4 = Epic, 5 = Legendary. Each entry carries the display name, the CSS class cls (sb-q0sb-q5), and the colour, bar and glow values used by the infoboxes.

This is the single source of the names. The actual text colours a reader sees come from Template:ItemStyles/styles.css via those classes — change a colour there, not here, and keep the two in step.

p.slots

Game item type → the wiki's slot label, its family, and its category. arms becomes Weapon / Weapons / Category:Weapons; neck becomes Necklace / Accessories / Category:Accessories - Necklaces. This is the mapping that keeps the game's internal names out of articles.

p.sets and p.stations

p.sets is the list of gear sets — Foundation, Lunar, Neotilus, Virelda. p.stations maps a station's internal id to its article title (Weapon Station, Gearforge Station, Manufacturing Station).

See also