Mother DocsMother Docs
Buy me a Coffee
Steam Workshop
Discord
  • Mother OS (Ingame Script)
  • Mother GUI
  • Mother Autopilot System (MAPS)
  • Mother Core (Script Framework)
  • Cheatsheet
  • Brand Guidelines
Buy me a Coffee
Steam Workshop
Discord
  • Mother OS (Ingame Script)
  • Mother GUI
  • Mother Autopilot System (MAPS)
  • Mother Core (Script Framework)
  • Cheatsheet
  • Brand Guidelines
  • Cheatsheet
  • Mother OS (Ingame Script)
    • Getting Started

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

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

      • Air Vent Module
      • Battery Module
      • Terminal Block Module
      • Cockpit Module
      • Connector Module
      • Display Module
      • Door Module
      • Gas Tank Module
      • Hinge Module
      • Landing Gear Module
      • Light Module
      • Piston Module
      • Programmable Block Module
      • Rotor Module
      • Screen Module
      • Sensor Module
      • Sorter Module
      • Sound Block Module
      • Thruster Module
      • Timer Block Module
      • Wheel Module
    • Compatibility
    • Examples
  • Mother GUI
    • Getting Started

      • Installation
      • Configuration
    • Commands
    • Menus
    • Views
  • Mother Autopilot System (MAPS)
    • Getting Started

      • Upgrade Guide
      • Installation
    • Modules

      • Flight Planning Module
      • Map Module
      • Flight Control Module
      • Attitude Module
      • Docking Module
  • 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
      • Configuration
      • Event Bus
      • Intergrid Message Service
      • Local Storage
      • Log
      • Terminal
    • Utilities

      • Color Helper
      • Number Helper
      • Security
      • Serializer
    • Tutorials
  • Powered By Mother
  • Brand Guidelines

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
    • ulimit
    • llimit
    • stop
    • attach
    • detach
    • 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.

Options

OptionValuesUnitDescription
addtrue, falseboolIndicates that the distance should be added to the current distance. Allows incremental changes to distance.
subtrue, falseboolIndicates that the distance should be subtracted from the current distance. Allows decremental changes to distance.
shareIndicates that the distance should be shared across all pistons in the group. This means that if you have 4 pistons in a group and set a distance of 2 meters with sharing enabled, each piston will extend to 0.5 meters. If sharing is disabled, each piston will extend to the full 2 meters.

Example

Extend the turret pistons to 5 meters:

Terminal
piston/distance TurretPistons 5;

Decrease the distance of the turret pistons by 1 meter:

Terminal
piston/distance TurretPistons 1 --sub; 

Share a distance of 4 meters across 4 pistons in the "Landing Gear Pistons" group:

Terminal
piston/distance "Landing Gear Pistons" 4 --share;

ulimit

Set the upper limit of a piston or group of pistons in meters.

piston/ulimit <Piston|Group> <Limit>

Example

Terminal
piston/ulimit TurretPistons 7.5;

llimit

Set the lower limit of a piston or group of pistons in meters.

piston/llimit <Piston|Group> <Limit>

Example

Terminal
piston/llimit TurretPistons 1.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;

attach

Attach the head of a piston or group of pistons.

piston/attach <Piston|Group>

Example

Terminal
piston/attach TurretPistons;

detach

Detach the head of a piston or group of pistons.

piston/detach <Piston|Group>

Example

Terminal
piston/detach 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
addtrue, falseboolIndicates that the provided speed should be added to the current speed. Allows incremental changes to speed.
subtrue, falseboolIndicates that the provided speed should be subtracted from the current speed. Allows decremental changes to speed.

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.
onAttachActivated when a piston head is attached.
onDetachActivated when a piston head is detached.

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: 5/3/26, 1:48 AM
Contributors: Luke Morrison, lukejamesmorrison
Prev
Light Module
Next
Programmable Block Module