query · world.infrastructure

Infrastructure maintenance

Returns the latest Settlement-owned repair or extension choice with the bounded World wear evidence and physical material facts that informed it.

world.infrastructure.maintenance(filters?, cursor?, page_size?) -> query-page
Stable ID
world.infrastructure.maintenance
Owner
game.settlement
Authority
read_only
Timing
immediate
Availability
active-session
Side effects
none
Determinism
stable owner order at the current committed tick
Introduced
1.19.0

Usage

Read the latest bounded Settlement choice for infrastructure repair or extension. Each candidate row explains its World stage and condition, physical material and work requirement, eligibility, score, selection, and any matching regional-pressure or active-use wear evidence from the latest condition pass.

Parameters

Returns

A detached page of Settlement-owned candidate evidence plus the autonomous maintenance cadence. The query grants no direct condition, inventory, or construction authority.

Cost

One Settlement lookup and a bounded candidate trace with indexed matching against the latest bounded World condition evidence.

Fields

IDTypeUnitsRequiredDescription
active_move_countunsigned-integer-or-nullmovesnoActive paths using this infrastructure in the latest World pass.
available_materialunsigned-integer-or-nullresource-unitsnoPhysical material available in the selected stockpile.
candidate_detailstring-or-nullnonenoCandidate-specific explanation.
conditionunsigned-integer-or-nullbasis-pointsnoCondition at evaluation.
condition_lossunsigned-integer-or-nullbasis-pointsnoCondition lost during the latest World pass.
decision_detailstringnoneyesSettlement-level explanation.
decision_statusenumerationnoneyesLatest Settlement decision status.
decision_tickunsigned-integerticksyesLatest Settlement evaluation tick.
eligibleboolean-or-nullnonenoWhether all current owners permit the work.
environmental_pressuresigned-integer-or-nullpressure-unitsnoLatest regional pressure observed by World for this infrastructure.
infrastructure_idstable-id-or-nullnonenoEvaluated infrastructure identity, when a candidate exists.
next_maintenance_tickunsigned-integerticksyesNext autonomous condition and choice evaluation tick.
required_materialunsigned-integer-or-nullresource-unitsnoPhysical material required by the evaluated work.
required_workunsigned-integer-or-nullwork-unitsnoCombined clearing, laying, and finishing work.
selectedboolean-or-nullnonenoWhether Settlement selected this candidate.
stageenumeration-or-nullnonenoWorld lifecycle stage at evaluation.
total_scoresigned-integer-or-nullnonenoSum of retained condition, travel, field, and material contributions.
work_kindenumeration-or-nullnonenoRepair or extension.

Errors

Examples

local result = world.query("world.infrastructure.maintenance", {page_size = 8})
for _, item in ipairs(result.records) do
    ui.row(tostring(item.infrastructure_id), item.candidate_detail)
end

API history

Related symbols

Project references