query · world.construction

Construction progress

Returns detached physical work, assigned-Actor throughput, duration, and blockage facts for one construction project.

world.construction.progress(filters?, cursor?, page_size?) -> query-page
Stable ID
world.construction.progress
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 construction identity to inspect authored work, deterministic fractional progress, the assigned Actor's rate modifier, effective throughput, estimated remaining fixed ticks, stage, blockage, worker-interruption recovery deadline, retained handoff history, and terminal failure cause. Values are detached and cannot mutate Construction or Actor owners.

Parameters

Returns

One detached construction record. Worker and rate-derived fields are null when no Actor is assigned. Interruption timing fields are null unless the project is blocked by a worker interruption.

Cost

One Construction lookup and, when a worker is assigned, one Actor lookup within package query budgets.

Fields

IDTypeUnitsRequiredDescription
base_work_units_per_secondunsigned-integerwork-units-per-secondyesCurrent runtime base construction throughput.
blockageenumerationnoneyesCurrent blockage reason.
blocked_since_tickunsigned-integer-or-nullfixed-ticksnoTick when the current blockage began.
completed_work_unitsunsigned-integerwork-unitsyesCompleted physical work.
construction_idstable-idnoneyesConstruction identity.
definition_idstringnoneyesAuthored building definition identity.
effective_work_units_per_secondnumber-or-nullwork-units-per-secondnoDerived base throughput after the assigned Actor modifier.
estimated_remaining_ticksunsigned-integer-or-nullfixed-ticksnoDerived fixed ticks remaining at the current rate.
failure_causeenumerationnoneyesRetained terminal failure cause.
last_worker_interruption_tickunsigned-integer-or-nullfixed-ticksnoMost recent retained worker-interruption tick.
last_worker_reassignment_tickunsigned-integer-or-nullfixed-ticksnoMost recent successful worker-handoff tick.
progressunsigned-integerbasis-pointsyesDerived completion ratio.
required_work_unitsunsigned-integerwork-unitsyesAuthored physical work required.
stageenumerationnoneyesCurrent construction stage.
work_remainder_numeratorunsigned-integerconstruction-work-rate-numeratoryesRetained deterministic fractional work numerator.
worker_actor_idstable-id-or-nullnonenoAssigned construction Actor when present.
worker_handoff_countunsigned-integernoneyesSuccessful worker handoffs retained by Construction.
worker_interruption_deadline_tickunsigned-integer-or-nullfixed-ticksnoTick when the worker-interruption recovery window expires.
worker_interruption_grace_ticks_remainingunsigned-integer-or-nullfixed-ticksnoRecovery ticks remaining before worker-interruption failure.
worker_rate_modifierunsigned-integer-or-nullbasis-pointsnoAssigned Actor construction-rate modifier.

Errors

Examples

local result = world.query("world.construction.progress", {page_size = 1, filters = {construction_id = 1}})
if result.status == "completed" then
    local project = result.records[1]
    ui.row("Build work", tostring(project.completed_work_units) .. " / " .. tostring(project.required_work_units))
    if project.blockage == "worker_interrupted" then
        ui.row("Recovery window", tostring(project.worker_interruption_grace_ticks_remaining) .. " ticks")
    elseif project.failure_cause ~= "none" then
        ui.text("Construction failed", project.failure_cause)
    end
end

API history

Related symbols

Project references