query · world.construction

Construction placement preview

Validates one authored building footprint against the World grid and retained Construction occupancy without mutating either owner.

world.construction.placement-preview(filters?, cursor?, page_size?) -> query-page
Stable ID
world.construction.placement-preview
Owner
game.construction and sim.world-grid
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

Validate one authored building footprint against the current World grid and Construction occupancy without mutating either owner. Use the returned oriented bounds for ui.ghost and require valid before offering designation.

Parameters

Returns

One detached record containing validity, detail, requested origin, oriented footprint origin and dimensions, orientation, and occupied cell count.

Cost

One content lookup plus one bounded visit per footprint cell.

Fields

IDTypeUnitsRequiredDescription
detailstringnoneyesSpecific validation result.
footprint_cellsunsigned-integernoneyesValidated occupied cell count.
footprint_height_cellsunsigned-integerWorld-grid cellsyesOriented bounding footprint height.
footprint_origin_xsigned-integerWorld-grid cellsyesMinimum occupied X coordinate.
footprint_origin_ysigned-integerWorld-grid cellsyesMinimum occupied Y coordinate.
footprint_width_cellsunsigned-integerWorld-grid cellsyesOriented bounding footprint width.
orientationunsigned-integernoneyesRequested construction orientation.
origin_xsigned-integerWorld-grid cellsyesRequested footprint origin.
origin_ysigned-integerWorld-grid cellsyesRequested footprint origin.
validbooleannoneyesWhether designation can occupy the requested cells.

Errors

Examples

local preview = world.query("world.construction.placement-preview", {page_size = 1, filters = {definition_id = project.definition_id, origin_x = x, origin_y = y, orientation = orientation}})

API history

Related symbols

Project references