CONTENT CONTRACT · VERSION 1
switch_changed
A placed switch or fire changed state: a lever pulled, a plate pressed or released, a strike switch struck, a timed window run out, a fire lit or gone out, a burnable burnt or cut away.
Signature
{ active: boolean, actor: (ActorRef)?, definition: StructureId, kind: "switch_changed", player: (PlayerRef)?, position: Position, structure: ActorRef, variable: VariableId }Fields
| Name | Type | Meaning |
|---|---|---|
active | boolean | True: it turned active (pressed, lit, burnt away); false: it turned back. |
actor | ActorRef | Actor that changed it; absent when it changed by itself (a window ran out, a fire spread, a reset). Length: 1…256; Pattern: ^[\s\S]+$ |
definition | StructureId | Its structure definition. Length: 1…129; Pattern: ^[a-z][a-z0-9_]{0,31}:[a-z][a-z0-9_]{0,95}$; Reference: structure |
kind | "switch_changed" | Discriminant |
player | PlayerRef | Player controlling that actor; absent otherwise. Length: 1…256; Pattern: ^[\s\S]+$ |
position | Position | Where it stands. |
structure | ActorRef | The switch or fire. Length: 1…256; Pattern: ^[\s\S]+$ |
variable | VariableId | World variable of its placement, now holding the new state. Length: 1…129; Pattern: ^[a-z][a-z0-9_]{0,31}:[a-z][a-z0-9_]{0,95}$; Reference: variable |
Validated example
{
"active": true,
"actor": "a1",
"definition": "core:moss_court_chest_structure",
"kind": "switch_changed",
"player": "p1",
"position": {
"map": "m1",
"x_mm": 46000,
"y_mm": 0,
"z_mm": -18000
},
"structure": "s1",
"variable": "core:moss_court_leaf_chest"
}