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

Piston Module

The piston module allows the user to control pistons on the grid. Pistons are particularly vulnerable to phantom forces and the Almighty Clang, so we leverage the Activity Monitor to ensure pistons are stopped when not in use. Players can simply define a distance and speed without worrying about upper/lower limits.

  • Commands
    • distance
    • stop
    • reset
    • speed
  • Hooks

Commands

distance

Extend or retract a piston to a specific distance between 0 and Max meters.

piston/distance <Piston|Group> <Distance> [--options]

Note

Small grid pistons have a maximum distance of 2 meters, while large grid pistons have a maximum distance of 10 meters.

Example

Terminal
piston/distance TurretPistons 5;

stop

Stop a piston while in motion. Note that pistons do not lock like a Rotor or Hinge.

piston/stop <Piston|Group>

Example

Terminal
piston/stop TurretPistons;

reset

Reset a piston to its original position (0 meters).

piston/reset <Piston|Group>

Example

Terminal
piston/reset TurretPistons;

speed

Set the speed of a piston or group of pistons in m/s.

piston/speed <piston|Group> <Speed> <Options>

Options

OptionValuesUnitDescription
addIndicates that the provided speed should be added to the current speed. Allows increment speed changes while in motion.
subIndicates that the provided speed should be subtracted from the current speed. Allows decremental speed changes while in motion.

Examples

Set speed to 0.5 m/s:

Terminal
piston/speed TurretPistons 0.5;

Increase speed by 0.2 m/s:

piston/speed TurretPistons 0.2 --add;

Decrease speed by 0.1 m/s:

piston/speed TurretPistons 0.1 --sub;

Hooks

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

KeyTrigger
onExtendingActivated when a piston is extending.
onExtendedActivated when a piston is fully extended.
onRetractingActivated when a piston is retracting.
onRetractedActivated when a piston is fully retracted.

Example

Imagine our piston is connected to a fuel boom:

FuelBoomPiston > Custom Data
[hooks]
onExtending=light/blink "Fuel Boom Light" fast;
onRetracted=light/blink "Fuel Boom Light" off;

Tips

You can use this to refer to the block itself when targeting it from within its own custom data.

or

Mother > Custom Data
[hooks]
FuelBoomPiston.onExtending=
| light/blink "Fuel Boom Light" fast;

"Landing Gear Pistons".onRetracted=
| wait 2; 
| hinge/rotate "Landing Gear Hinges" 0;
Last Updated:: 4/29/25, 9:42 PM
Contributors: Luke Morrison
Prev
Flight Planning Module
Next
Programmable Block Module