Mother DocsMother Docs
Buy me a Coffee
Steam Workshop
Discord
  • Cheatsheet
  • Announcements
  • Mother OS (Ingame Script)
  • Mother GUI
  • Mother Autopilot System (MAPS)
  • Printed by Mother
  • Mother Core (Script Framework)
  • Mother Dev Tools
  • Motherland
  • Powered by Mother
  • Brand Guidelines
Buy me a Coffee
Steam Workshop
Discord
  • Cheatsheet
  • Announcements
  • Mother OS (Ingame Script)
  • Mother GUI
  • Mother Autopilot System (MAPS)
  • Printed by Mother
  • Mother Core (Script Framework)
  • Mother Dev Tools
  • Motherland
  • Powered by Mother
  • Brand Guidelines
  • Cheatsheet
  • Announcements
  • Mother OS (Script)
    • Getting Started

      • Upgrade Guide
      • Installation
      • Command Line Interface (CLI)
      • Conditional Logic
      • Configuration
    • Modules
      • Activity Monitor
      • Air Vent Module
      • Almanac
      • AutoLCD Module
      • Battery Module
      • Block Catalogue
      • Cockpit Module
      • Connector Module
      • Display Module
      • Door Module
      • Gas Tank Module
      • Hinge Module
      • Intergrid Message Service
      • Jump Drive Module
      • Landing Gear Module
      • Light Module
      • Local Storage
      • Merge Block Module
      • Piston Module
      • Programmable Block Module
      • Rotor Module
      • Screen Module
      • Sensor Module
      • Sorter Module
      • Sound Block Module
      • Terminal Block Module
      • Thruster Module
      • Timer Block Module
      • Wheel Module
    • Compatibility
    • Troubleshooting
    • Examples
  • Mother GUI (Script)
    • Getting Started

      • Upgrade Guide
      • Installation
      • Configuration
    • Commands
    • Menus
    • Views
    • Examples
  • Mother Autopilot System (MAPS) (Script)
    • Getting Started

      • Upgrade Guide
      • Installation
    • Modules

      • Flight Planning Module
      • Map Module
      • Flight Control Module
      • Attitude Module
      • Docking Module
  • Printed by Mother (Script)
    • Getting Started

      • Installation
      • Configuration
    • Commands
    • Conditions
    • Print Jobs
    • Alignment
    • Hooks
    • Examples
  • Mother Core (Script Framework)
    • Getting Started

      • Upgrade Guide
      • Installation
      • Architecture Overview
      • Managing Script Size & Complexity
    • Building A Module
    • Mother CLI (Console)
    • Core Modules
      • Activity Monitor
      • Almanac
      • Block Catalogue
      • Clock
      • Command Bus
      • Conditions
      • Configuration
      • Event Bus
      • Intergrid Message Service
      • Local Storage
      • Log
      • Terminal
    • Utilities

      • Color Helper
      • Number Helper
      • Security
      • Serializer
    • Testing
    • Tutorials
  • Mother Dev Tools
  • Motherland
  • Powered By Mother
  • Brand Guidelines

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.

  • Properties
  • Hooks

Properties

Tips

Properties and predicates are very useful in conditions. A property is compared with an operator and a value (distance > 100), while a predicate stands alone (detected). See Conditional Logic to use them in when rules and if steps.

PropertyDescription
detected1 when the sensor detects an entity, 0 when it does not.
distanceThe distance in metres to the last detected entity, or -1 if none.
PredicateTrue when
detectedThe sensor detects an entity.
clearThe sensor does not detect an entity.

Because distance is -1 when nothing is detected, a condition such as distance < 100 is also true when the sensor is clear.

Compare a property

Mother > Custom Data
[rules]
Distant=
| when LandingPadSensor distance > 100;
|   light/color "Landing Pad Light" yellow;

Use a predicate

Mother > Custom Data
[rules]
Approach=
| when LandingPadSensor detected;
|   light/blink "Landing Pad Light" fast;
| else;
|   light/blink "Landing Pad Light" off;

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: 10/31/26, 10:26 PM
Contributors: Luke Morrison, lukejamesmorrison
Prev
Screen Module
Next
Sorter Module