query · world.building
Building information
Returns one detached building record selected by stable building identity.
world.building.info(filters?, cursor?, page_size?) -> query-page
- Stable ID
world.building.info- Owner
- game.construction
- Authority
- read_only
- Timing
- immediate
- Availability
- active-session
- Side effects
- none
- Determinism
- stable owner order at the current committed tick
- Introduced
- 1.0.0
Usage
Query one building_id to read its authored player-facing name, raw and readable function, lifecycle, basis-point and percentage condition, condition status, and revision without changing Construction or Building state.
Parameters
- filters.building_id: required stable Building identity.
- cursor: optional continuation cursor; this single-record query normally returns none.
- page_size: positive record limit capped by the host.
Returns
One detached building record. display_name comes from the active content catalog and falls back to definition_id only when authored metadata is unavailable. function remains the stable machine identifier; function_label, condition_percent, and condition_status are intended for normal interface text.
Cost
One Building lookup and one bounded content-catalog lookup within the package query budget.
Fields
| ID | Type | Units | Required | Description |
|---|---|---|---|---|
building_id | stable-id | none | yes | Building identity. |
condition | unsigned-integer | basis-points | yes | Current condition. |
condition_percent | unsigned-integer | percent | yes | Rounded player-facing condition. |
condition_status | string | none | yes | Player-facing condition classification. |
definition_id | string | none | yes | Authored building definition identity. |
display_name | string | none | yes | Player-facing authored building name. |
function | enumeration | none | yes | Building function. |
function_label | string | none | yes | Player-facing building function label. |
lifecycle | enumeration | none | yes | Building lifecycle. |
revision | unsigned-integer | none | yes | Owner revision. |
upgrade_level | unsigned-integer | none | yes | Current upgrade level. |
Errors
error.capability-unavailableerror.invalid-queryerror.query-budget-exhaustederror.query-contract-violation
Examples
local result = world.query("world.building.info", {page_size = 1, filters = {building_id = building_id}})
if result.status == "completed" then
local building = result.records[1]
ui.text("Building", building.display_name)
ui.row("Purpose", building.function_label)
ui.row("Condition", tostring(building.condition_percent) .. "% - " .. building.condition_status)
end
API history
- 1.0.0: Runtime contract published from the complete Phase 14 registry.
- 1.5.0: Added the authored display_name field for normal interface labels.
- 1.5.0: Added readable function and condition fields for the standard interface.
Related symbols
world.buildingerror.capability-unavailableerror.invalid-queryerror.query-budget-exhaustederror.query-contract-violationworld.query