query · world.settlement
Settlement for actor
Returns capability facts for the settlement that contains one actor.
world.settlement.for-actor(filters?, cursor?, page_size?) -> query-page
- Stable ID
world.settlement.for-actor- 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.0.0
Usage
Call this query through world.query with the stable ID world.settlement.for-actor. Consume detached records during the current callback and use the returned cursor for bounded continuation.
Parameters
- filters: optional table of query-specific stable IDs and bounded selectors.
- cursor: optional opaque continuation cursor returned by the same query.
- page_size: optional positive record limit capped by the host.
Returns
A detached query page with status, records, continuation metadata, and a stable diagnostic when the request cannot complete.
Cost
Bounded by page size, per-package query budget, and the owning snapshot builder; results are detached before Lua receives them.
Fields
| ID | Type | Units | Required | Description |
|---|---|---|---|---|
actor_count | unsigned-integer | none | yes | Member actor count. |
building_count | unsigned-integer | none | yes | Member building count. |
household_count | unsigned-integer | none | yes | Member household count. |
job_count | unsigned-integer | none | yes | Member job count. |
revision | unsigned-integer | none | yes | Owner revision. |
settlement_id | stable-id | none | yes | Settlement identity. |
stockpile_count | unsigned-integer | none | yes | Member stockpile count. |
Errors
error.capability-unavailableerror.invalid-queryerror.query-budget-exhaustederror.query-contract-violation
Examples
local result = world.query("world.settlement.for-actor", {page_size = 16})
if result.status == "completed" then
for _, record in ipairs(result.records) do
-- Render or inspect detached record fields here.
end
end
API history
- 1.0.0: Runtime contract published from the complete Phase 14 registry.
Related symbols
world.settlementerror.capability-unavailableerror.invalid-queryerror.query-budget-exhaustederror.query-contract-violationworld.query