Overview
Occupancy Sensor (StructureOccupancySensor) in Stationeers: device, hash 322782515. With build steps, 6 IC10 logic values and connection diagram.
The occupancy sensor is the calmer sibling of the Motion Sensor. According to the game data it needs no power, mounts in the 0.5 m grid and has one shared port for power and data.
What it covers: according to the game code it counts the player characters in the same room – the area the game recognises as a closed room. Loose items do not count. If it hangs outside or the room is not sealed, it always reports 0. Activate is not a 0/1 signal here but the number of people; Quantity gives the same value. With an access restriction it only counts authorised people. All values, StackSize included, are read only, and it has no On.
The 18 memory slots: a chip reads them with get at addresses 0 to 17. get does not work by name – the sensor has to sit on one of the housing's pins, or you pass its ReferenceId. The sensor rebuilds the list on every logic tick: for each person in the room there is one entry for the person, followed by one entry for every occupied slot of their inventory. After 18 entries the list ends; unused slots read 0. Every entry is a packed number:
- the lowest 8 bits (
andwith 255) are the kind: 1 = person, 2 = item, - for a person, the prefab hash of the character starts at bit 8 (
sraby 8), - for an item, bits 8 to 15 hold the slot number and the item's prefab hash starts at bit 16 (
sraby 16).
That way a chip can check, for example, whether somebody wearing a helmet stands in the airlock. A person with many occupied slots fills the 18 entries quickly, though.
It is built from the Kit (Sensors). According to the game data it is flammable (auto-ignition from 573 K). Typical uses are lights, heating or ventilation that only run while somebody is in the room. More about sensors is in Sensors: gas, daylight, motion, occupancy.
IC10 and logic
6 logic values, 6 readable and 0 writable.
-
ActivateR 9 -
QuantityR 27 -
PrefabHashR 84 -
ReferenceIdR 217 -
NameHashR 268 -
StackSizeR 280
Example: address by name
Reads Quantity, shows the value on the IC housing and writes –. Name the device with the labeller first; devices with the same name are addressed together.
# Occupancy Sensor address by name
define DEVICE 322782515 # StructureOccupancySensor
define NAME HASH("Occupancy Sensor") # name in game (labeller)
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
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)
Material, fire and recycling
Flammable according to game data: flash point 373.2 K (100 °C); Autoignition 573.2 K (300 °C); burn time 2.33 s
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.