Practical guide
Submit and observe a normal command
Turn a logical UI action into validated fixed-tick intent and report completion without bypassing the owning game service.
Procedure
- Query current owner revisions and stable target IDs immediately before submission.
- Submit the registered command ID and typed arguments through command.submit.
- Treat the accepted receipt as queued intent, not completed mutation.
- Subscribe to events.command.completed during initialization and treat its detached payload as post-commit evidence; edits affect only that callback-local copy.
- Handle validation, queue, budget, and owner rejection IDs without retry loops inside one callback.
Example
local receipt = command.submit(
"command.actor.take-control",
{
actor_id = actor.actor_id,
expected_actor_revision = actor.revision,
expected_authority_revision = actor.authority_revision
},
1
)
local completion_subscription = events.listen(
"events.command.completed",
function(event)
feedback = event.payload.command_id .. " completed"
end
)
Constraints and recovery
- Commands request behavior; the authoritative owner performs the behavior once at a fixed tick.
- Expected revisions prevent stale interface state from overwriting newer simulation state.
- Post-commit events report facts and are not a second mutation path.
Related symbols
command.submitcommand.receiptevents.listenevents.ignoreevents.afterevents.command.completedcommand.actor.take-control