Module:Buildables/data/doc
This is the documentation page for Module:Buildables/data
Module:Buildables/data/...
Dataset for a single Buildables set.
Subpage title
Datasets live at Module:Buildables/data/<SCOPE>/<SET_SLUG>, where <SCOPE> is one of placeables, structures, or decorations.
<SET_SLUG> is the slug of the set's English name, derived via common.slugify() from Module:Common. It must exactly match the subpage used for MessageBundle:<SCOPE_TITLECASE>/<SET_SLUG>, where <SCOPE_TITLECASE> is the scope name capitalised (e.g. MessageBundle:Structures/choam_facility).
Examples:
Module:Buildables/data/placeables/water_producersModule:Buildables/data/structures/choam_facility
Schema
The dataset is a two-level table, first keyed by category slug, then containing an array of piece records, ordered according to their in-game arrangement.
For translation-compatibility, display strings are stored exclusively in MessageBundles, never in the dataset.
Piece names resolve against the scope's bundle: MessageBundle:<SCOPE_TITLECASE> for generic shared names, with automatic fallback to MessageBundle:<SCOPE_TITLECASE>/<SET_SLUG> for set-specific ones. Category names resolve against the scope bundle as category-<CATEGORY_SLUG>.
MessageBundle:Buildables is separate, and holds no piece names. It carries only the scope and set titles used for section headings and subtitles, as scope-<SCOPE_SLUG> and set-<SET_SLUG> keys. Adding a new set therefore requires a set-<SET_SLUG> key there in addition to the dataset and its own bundle subpage.
First key
Category (slugified). Valid categories depend on the scope, and their declaration order in the variable SCOPES determines the order categories appear in listing tables.
Valid categories:
- placeables:
utility,fabricator,refinery,storage - structures:
structural,wall,wedge_wall,roof,incline,special - decorations:
lighting,furniture,deco,wall_deco,ornamental,misc
Reserved keys
Alongside the category keys, a dataset may declare:
- defaults
- table
- Values applied to any piece that does not specify its own, per field. May declare any subset of the defaultable fields -
health,source, andversion. - Typically used where a whole set shares a source or was added in a single version, letting individual records override only where they differ.
- Example:
defaults = { source = "Sources:default", version = "1.0" }
- parentSet
- string
- Slug of the set this one is embedded within in-game (e.g.
choam_facilityfor the Observer subset). Renders a "Found under" note in the section subtitle.
Piece ordering
Piece order within a category is preserved exactly as declared. Shared generic piece names (e.g. Foundation, Wall, Ceiling Light, and similar) are registered once in the respective scope's MessageBundle (e.g. MessageBundle:Decorations) and reused across every set.
For structures, sets should declare the pieces in the same relative order as defined in MessageBundle:Structures, so that comparable pieces line up across sets when their tables are read side-by-side.
For decorations, stick to the order as defined in-game for convenience.
Record fields
Each record is a table with the fields below. Fields marked defaultable are resolved per field: the value on the record is used if present, otherwise the set's defaults block supplies it. This is independent for each field, so a record may specify some and inherit others, and a defaults block need only declare the fields it wants to cover. Every piece must end up with a value from one source or the other.
- id
- string
- Unique slug identifying the piece within this set.
- Used to resolve
<ID>-nameagainst MessageBundle:<SCOPE_TITLECASE> for generic shared names (e.g.foundation,wall), with automatic fallback to MessageBundle:<SCOPE_TITLECASE>/<SET_SLUG> for set-specific names. IDs ending in_<INTEGER>resolve against the base ID and render with the number appended, sowall_2displays as "Wall 2" without needing its own key.
- image
- string
- Filename of the piece icon image.
- health (defaultable)
- number
- Health points of the piece.
- cost
- table
- A table of required materials, keyed by material name with integer values representing the required quantity.
- Examples:
{ ["Granite Stone"] = 10 }{ ["Granite Stone"] = 10, ["Iron Ingot"] = 20 }
- source (defaultable)
- string
- A
Bundle:slugtoken identifying where the piece's source label is registered. The prefix is the exact case-sensitive MessageBundle name to resolve against. - Examples:
DLC:lost_harvestDLC:raiders_of_the_broken_lands
- version (defaultable)
- string
- The game version this piece was added in. Rendered as a wikilink to the corresponding Versions page.
- Examples:
1.1.0.0