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
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
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
piston/stop TurretPistons;
reset
Reset a piston to its original position (0 meters).
piston/reset <Piston|Group>
Example
piston/reset TurretPistons;
speed
Set the speed of a piston or group of pistons in m/s.
piston/speed <piston|Group> <Speed> <Options>
Options
Option | Values | Unit | Description |
---|---|---|---|
add | Indicates that the provided speed should be added to the current speed. Allows increment speed changes while in motion. | ||
sub | Indicates 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:
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:
Key | Trigger |
---|---|
onExtending | Activated when a piston is extending. |
onExtended | Activated when a piston is fully extended. |
onRetracting | Activated when a piston is retracting. |
onRetracted | Activated when a piston is fully retracted. |
Example
Imagine our piston is connected to a fuel boom:
[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
[hooks]
FuelBoomPiston.onExtending=
| light/blink "Fuel Boom Light" fast;
"Landing Gear Pistons".onRetracted=
| wait 2;
| hinge/rotate "Landing Gear Hinges" 0;