Overview
Motion Sensor (StructureMotionSensor) in Stationeers: device, hash -1713470563. With build steps, 6 IC10 logic values and connection diagram.
The motion sensor is the switch for everything that should only run while somebody is around: corridor lights, door openers, a note on a display. It mounts in the 0.5 m grid on a wall, floor or ceiling, needs no power according to the game data and has one shared port for power and data.
What it covers: according to the game code it watches exactly one large cell – the 2 × 2 × 2 m cube it sits in. It remembers every movable object that enters this cell and drops it again as soon as it leaves. That means player characters, but also loose items: if somebody drops something there, the sensor stays triggered until it is picked up again. What somebody carries in hand or inventory does not count separately.
Activateis 1 while at least one object is in the cell, otherwise 0. The sensor keeps setting this value itself; whatever you write into it is overwritten right away.Quantityis the number of objects it currently tracks in the cell.Oncan be read and written. The detection in the game code does not checkOn, though – do not rely on a switched-off sensor staying quiet.
For a long corridor you therefore need several sensors, one per 2 m section. Give them all the same name and read them with batch mode 0: the average of Activate is above 0 as soon as somebody is anywhere along it.
It is built from the Kit (Sensors), which also builds the gas, daylight, occupancy and proximity sensors. If you need an adjustable range, use the Proximity Sensor; for a whole room, the Occupancy Sensor.
A proven pattern is the light with run-on: every detection resets a counter, and the light stays on until it has run out – 60 ticks for 30 seconds, for example. If the sensor is missing, lbn returns NaN; then it is better to leave the light on. The complete program is in Sensors: gas, daylight, motion, occupancy.
IC10 and logic
6 logic values, 6 readable and 2 writable.
-
ActivateRW 9 -
QuantityR 27 -
OnRW 28 -
PrefabHashR 84 -
ReferenceIdR 217 -
NameHashR 268
Example: address by name
Reads Quantity, shows the value on the IC housing and writes On. Name the device with the labeller first; devices with the same name are addressed together.
# Motion Sensor address by name
define DEVICE -1713470563 # StructureMotionSensor
define NAME HASH("Motion Sensor") # name in game (labeller)
define TARGET 1 # On 1 = on
alias value r0
start:
yield
lbn value DEVICE NAME Quantity 0 # 0 = average of all with this name
bnan value start # no device with this name
s db Setting value # show on the housing
sbn DEVICE NAME On TARGET # set value
j startAcademy: devices by name Academy: batch modes IC10 academy IC10 editor
Connections
- 1Power and data
Building and deconstruction
Grid: small grid (0.5 m) · mounting: on wall or floor
- 1
Total material
Deconstruction returns
Built with: Kit (Sensors)
Raw values from the game code (1)
Field names as in the game code, untranslated. Useful for mods and exact limits.
Sensor.ConnectionType | FlatExhaustive |
See also
- Sensors: gas, daylight, motion, occupancyWhich sensor measures what, which logic values it delivers and how to combine several sensors cleanly – with a worked example on oxygen partial pressure and two programs.