CONTENT CONTRACT · VERSION 1
StructureSwitch
A switch: a lever, a floor plate or a strike switch. Its placement's `variable` holds its state (1 active, 0 not) and its `open_prefab` is its active look; each change raises `switch_changed`.
Signature
{ duration_ticks: (PositiveTicks)?, mode: SwitchMode, pressed_by: (SwitchPressedBy)?, sound: (AudioCueId)?, trigger: SwitchTrigger }Fields
| Name | Type | Meaning |
|---|---|---|
duration_ticks | PositiveTicks | Hold mode: a lever or strike switch stays active this long after each actuation (required there); a plate stays active this long after it is released (absent: releases at once). Absent in other modes. Range: 1…2147483647; Unit: tick |
mode | SwitchMode | How it answers being actuated. |
pressed_by | SwitchPressedBy | For a plate: what presses it. Required for plates, absent otherwise. |
sound | AudioCueId | Sound played at the switch whenever it turns active; absent: silent. Length: 1…129; Pattern: ^[a-z][a-z0-9_]{0,31}:[a-z][a-z0-9_]{0,95}$; Reference: audio_cue |
trigger | SwitchTrigger | What actuates it. |