Skip to content

ToggleGate

ToggleGate(gate) · ToggleGateTracked(gate)

Input: gate is one owned, live gate Object. Output: The ordinary form returns queue admission; the tracked form returns accepted, receipt.

Description: Requests one native lock-state toggle.

Errors: Wrong Lua argument types raise an argument error. A non-gate, lost ownership, changed session, or unavailable gate class/layout rejects the request; tracked reason: not-a-gate-or-class-unavailable when class validation fails. A tracked receipt gives the rejection reason when available.

ToggleGate(gate) issues the native lock/unlock toggle for one owned live gate. ToggleGateTracked(gate) returns accepted, receipt. Gate class, ownership, liveness and session are checked before dispatch. If the object stops being a gate or its class cannot be read, the request rejects with not-a-gate-or-class-unavailable.

This toggles the current state; it is not an idempotent locked-state setter. Do not automatically retry a submitted or indeterminate toggle, because a second command can undo the first. Observe the game to confirm the outcome. GetApiCapability(ToggleGate) reports native packet/session readiness, not the current gate state or whether a particular argument is eligible.