Space Engineers

Space Engineers

Not enough ratings
Configurable Pistons
   
Award
Favorite
Favorited
Unfavorite
File Size
Posted
Updated
428.494 KB
14 Aug, 2021 @ 8:37pm
4 Jan, 2024 @ 1:08am
3 Change Notes ( view )

Subscribe to download
Configurable Pistons

Description
---------------------------------------------------------------------------------
This is an in-game script for use with programmable blocks
---------------------------------------------------------------------------------

Configurable Pistons

@Author: Gate
@Date: 2023/05/22

@Version: 1.4

@Change-Log:
v1.4: Fixed logic bug, cause i'm an idiot
Auto retract and extend should now work for everyone
and not just our specific uses
v1.3: Fixed Documentation Spelling Error >.<
v1.2: Added Auto Retract and Extend support
v1.1: Bug-fix INI related
v1.0: Initial Release

@Arguments:
This script understands the following arguments
reset - This resets all internal caches.
Run this if you add/remove or change piston settings

@Usage:
Add (and edit) the following to the custom data of any piston you wish to add script functionality

[Piston Settings]
Ignore=False
RetractSpeed=1
ExtendSpeed=1
AutoRetract=False
AutoExtend=False

@Note:
Ignore - If this is set to True, this piston will be (actively)ignored.
- Useful for preconfiguring a piston for "future" use.
RetractSpeed - The speed (in m/s) the piston should move during Retraction
ExtendSpeed - The speed (in m/s) the piston should move during Extension
AutoRetract - Should the piston automatically retract once at full extension
AutoExtend - Should the piston automatically extend once at full retraction


You MUST either recompile the script,
or run with argument "reset"
to populate piston cache


Script (C)opyright 2021 Gate
Some Rights Reserved.

@License:
This work is licensed under the Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.
To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-sa/4.0/
or send a letter to Creative Commons, PO Box 1866, Mountain View, CA 94042, USA.


Space Engineers is (C)opyright Keen Software House
https://www.spaceengineersgame.com/


Created using the MDK-SE SDK
Malware's Development Kit for Space Engineers
https://github.com/malware-dev/MDK-SE


To Contribute to this Project, please visit:
https://github.com/tgkgate/Configurable-Pistons
2 Comments
Gate  [author] 30 Dec, 2021 @ 9:09pm 
@Zia Asuna

Yea, that's a typo in the instructions, it should be " AutoRetract " and not AutoRectract

If you alter the following line
[code]data.Piston.Velocity = data.AutoRetract ? -data.RetractSpeed : -data.RetractSpeed;[/code]
to
[code]data.Piston.Velocity = data.AutoRetract ? -data.RetractSpeed : data.RetractSpeed;[/code]

it should no longer autoretract on full extension, yet still prepare the piston for the alternate speed. my build environment is currently broken, so an mdk-deploy stopped working (nggggh). This will have to suffice for the moment.
Zia Asuna 30 Dec, 2021 @ 4:31pm 
Script not working right " Pistons will always AutoRectract "

if set to " AutoRectract=True " tjek that will work :selike:
but if set to " AutoRectract=False " the piston´s will still Rectract