Mother DocsMother Docs
Buy me a Coffee
Steam Workshop
Discord
  • Mother OS (Ingame Script)
Buy me a Coffee
Steam Workshop
Discord
  • Mother OS (Ingame Script)
  • Mother OS (Ingame Script)
    • Getting Started

      • Upgrade Guide
      • Installation
      • Command Line Interface (CLI)
      • Configuration
      • Modules
    • Core Modules

      • Activity Monitor
      • Almanac
      • Block Catalogue
      • Local Storage
      • Security
      • Intergrid Message Service
    • Extension Modules

      • Air Vent Module
      • Battery Module
      • Terminal Block Module
      • Cockpit Module
      • Connector Module
      • Display Module
      • Docking Module
      • Door Module
      • Flight Control Module
      • Gas Tank Module
      • Gyroscope Module
      • Hinge Module
      • Landing Gear Module
      • Light Module
      • Flight Planning Module
      • Piston Module
      • Programmable Block Module
      • Rotor Module
      • Sensor Module
      • Sound Block Module
      • Thruster Module
      • Timer Block Module
    • Command Cheatsheet
    • Compatibility
    • Examples
  • Powered By Mother

Sensor Module

The Sensor module allows the user to control Sensor blocks on the grid. We can use hooks to trigger actions when an entity is detected or not detected by the sensor.

  • Hooks

Hooks

The following hooks can be define in the block's Custom Data, and will be triggered when the corresponding command is called:

KeyTrigger
onDetectRun when a Sensor block detects an entity.
onClearRun when a Sensor block does not detect an entity.

Example

Imagine our Sensor has a status light we want to view elsewhere:

LandingPadSensor > Custom Data
[hooks]
onDetect=light/blink "Landing Pad Light" fast;
onClear=light/blink "Landing Pad Light" off;

or

Mother > Custom Data
[hooks]
LandingPadSensor.onDetect=light/blink "Landing Pad Light" fast;
"Airlock Sensor".onClear=door/close AirlockInnerDoor;

Note

Sensors can read details about the entity they are detecting. I hope to leverage this in future features related to docking and collision avoidance.

Last Updated:: 3/21/25, 9:52 PM
Contributors: Luke Morrison
Prev
Rotor Module
Next
Sound Block Module