Module:Buildables/data/structures/dune man

From Dune: Awakening Community Wiki
Jump to navigation Jump to search

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_producers
  • Module: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, and version.
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_facility for 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>-name against 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, so wall_2 displays 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:slug token identifying where the piece's source label is registered. The prefix is the exact case-sensitive MessageBundle name to resolve against.
Examples:
DLC:lost_harvest
DLC: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

return {
    defaults = {
        source  = "DLC:lost_harvest",
        version = "1.2.0.0",
    },

    structural = {
        {
            id     = "foundation",
            image  = "T_UI_IconPlacNeutDesertMechanicFoundation_D.png",
            health = 7000,
            cost   = {
                ["Granite Stone"] = 15,
            },
        },
        {
            id     = "triangle_foundation",
            image  = "T_UI_IconPlacNeutMTXDesertMechanicFoundationWedge_D.png",
            health = 7000,
            cost   = {
                ["Granite Stone"] = 15,
            },
        },
        {
            id     = "center_column",
            image  = "T_UI_IconPlacNeutMTXDesertMechanicColumn_D.png",
            health = 7000,
            cost   = {
                ["Granite Stone"] = 10,
            },
        },
        {
            id     = "corner_column",
            image  = "T_UI_IconPlacNeutMTXDesertMechanicColumn_D.png",
            health = 5600,
            cost   = {
                ["Granite Stone"] = 10,
            },
        },
    },
    wall = {
        {
            id     = "wall",
            image  = "T_UI_IconPlacNeutDesertMechanicWall_D.png",
            health = 5600,
            cost   = {
                ["Granite Stone"] = 10,
            },
        },
        {
            id     = "wall_2",
            image  = "T_UI_IconPlacNeutMTXDesertMechanicWall02_D.png",
            health = 5600,
            cost   = {
                ["Granite Stone"] = 10,
            },
        },
        {
            id     = "window",
            image  = "T_UI_IconPlacNeutMTXDesertMechanicWindow01_D.png",
            health = 5600,
            cost   = {
                ["Granite Stone"] = 10,
            },
        },
        {
            id     = "prudence_door",
            image  = "T_UI_IconPlacNeutMTXDesertMechanicPrudenceDoorFrame_D.png",
            health = 4500,
            cost   = {
                ["Granite Stone"] = 10,
                ["Iron Ingot"] = 20,
            },
        },
        {
            id     = "wide_door",
            image  = "T_UI_IconPlacNeutDesertMechanicDoor_D.png",
            health = 3500,
            cost   = {
                ["Granite Stone"] = 30,
            },
        },
        {
            id     = "garage_door",
            image  = "T_UI_IconPlacNeutMTXDesertMechanic_GarageDoorBig_D.png",
            health = 3500,
            cost   = {
                ["Granite Stone"] = 30,
            },
            version = "1.3.0.0",
        },
        {
            id     = "passageway",
            image  = "T_UI_IconPlacNeutMTXDesertMechanicPrudenceDoorFrame02_D.png",
            health = 3500,
            cost   = {
                ["Granite Stone"] = 10,
            },
        },
    },
    wedge_wall = {
        {
            id     = "triangle_wall_bottom_left",
            image  = "T_UI_IconPlacNeutMTXDesertMechanicWallTriangleBottomL_D.png",
            health = 5600,
            cost   = {
                ["Granite Stone"] = 10,
            },
        },
        {
            id     = "triangle_wall_bottom_right",
            image  = "T_UI_IconPlacNeutMTXDesertMechanicWallTriangleBottomR_D.png",
            health = 5600,
            cost   = {
                ["Granite Stone"] = 10,
            },
        },
        {
            id     = "triangle_wall_top_left",
            image  = "T_UI_IconPlacNeutMTXDesertMechanicWallTriangleTopL_D.png",
            health = 5600,
            cost   = {
                ["Granite Stone"] = 10,
            },
        },
        {
            id     = "triangle_wall_top_right",
            image  = "T_UI_IconPlacNeutMTXDesertMechanicWallTriangleTopR_D.png",
            health = 5600,
            cost   = {
                ["Granite Stone"] = 10,
            },
        },
    },
    roof = {
        {
            id     = "floor",
            image  = "T_UI_IconPlacNeutDesertMechanicFloor_D.png",
            health = 5600,
            cost   = {
                ["Granite Stone"] = 10,
            },
        },
        {
            id     = "triangle_floor",
            image  = "T_UI_IconPlacNeutMTXDesertMechanicFloorWedge_D.png",
            health = 5600,
            cost   = {
                ["Granite Stone"] = 10,
            },
        },
        {
            id     = "angled_roof",
            image  = "T_UI_IconPlacNeutMTXDesertMechanicRoof_D.png",
            health = 5600,
            cost   = {
                ["Granite Stone"] = 10,
            },
        },
        {
            id     = "angled_roof_corner",
            image  = "T_UI_IconPlacNeutMTXDesertMechanicRoofCorner_D.png",
            health = 5600,
            cost   = {
                ["Granite Stone"] = 10,
            },
        },
        {
            id     = "angled_roof_inward_corner",
            image  = "T_UI_IconPlacNeutMTXDesertMechanicRoofCornerIn_D.png",
            health = 5600,
            cost   = {
                ["Granite Stone"] = 10,
            },
        },
    },
    incline = {
        {
            id     = "stairs",
            image  = "T_UI_IconPlacNeutMTXDesertMechanicStair_D.png",
            health = 5600,
            cost   = {
                ["Granite Stone"] = 10,
            },
        },
        {
            id     = "ramp",
            image  = "T_UI_IconPlacNeutMTXDesertMechanicRamp_D.png",
            health = 5600,
            cost   = {
                ["Granite Stone"] = 10,
            },
        },
    },
    special = {
        {
            id     = "railing",
            image  = "T_UI_IconPlacNeutMTXDesertMechanicRailing_D.png",
            health = 5600,
            cost   = {
                ["Granite Stone"] = 10,
            },
        },
    },
}