Space Engineers

Space Engineers

Not enough ratings
Codius's Basic Piston Control
   
Award
Favorite
Favorited
Unfavorite
File Size
Posted
Updated
1.692 KB
8 Feb, 2018 @ 1:09am
9 Feb, 2018 @ 9:15pm
3 Change Notes ( view )

Subscribe to download
Codius's Basic Piston Control

Description
My first Space Engineers script. Spent around 6 hours trying to get my IDE working and figuring out how to script for this game.

It controls the pistons in a given block group via jump and crouch.
It looks for a group called "ControlPistons" and affects all pistons in that group. The group name can be easily changed in the code.

You can control the extend and retract speeds using the two speed variables near the top of the file. You can also reverse the controls by changing the signs of the variables by adding/removing the negative sign for each one.

It will check for a new usable control block, being the first occupied cockpit or control station capable of controlling the vehicle when the current one is not occupied, and update the list of pistons every 10 seconds. The timer can be seen in the control panel alongside the piston group and controller status. On load, it will set the first control block it finds to the controller temporarily for convenience.

Made at the request of Cassius Faux. https://steamproxy.com/id/rindalthi/
Go have a look at his Workshop uploads. He makes some really amazing things.


Potential Changes:

-Have speed of the pistons taken from somewhere other than the code itself.
-Have the name of the piston group taken from somewhere other than the code itself.
20 Comments
Codius Hilol  [author] 6 Dec, 2019 @ 11:21am 
It's been about 2 years since I originally wrote this script. But it should be possible by just changing what action is performed when you press the mapped buttons.
LASSIE 6 Dec, 2019 @ 10:39am 
Nice script. Is this also possible with Rotors?
Codius Hilol  [author] 29 Aug, 2019 @ 2:56pm 
Did you also set the piston group?
Codius Hilol  [author] 29 Aug, 2019 @ 2:55pm 
By default it uses whatever your "jump" and "crouch" keys are. These are spacebar and c by default I believe.
MattPlaysSimulations 29 Aug, 2019 @ 2:51pm 
@Codius, its selecting the correct cockpit. it just doesnt work
Codius Hilol  [author] 29 Aug, 2019 @ 2:40pm 
It should be looking for occupied cockpits every 10 seconds and setting the "controller" to that. It's been over a year since I wrote this logic originally, so I may not remember exactly.
MattPlaysSimulations 29 Aug, 2019 @ 12:31am 
Also how do i set it to one cockpit only?
MattPlaysSimulations 29 Aug, 2019 @ 12:30am 
Im stummped. IDK why but im using this script and I can get the piston to work using a cockpit on another ship via connector but when using the cockpit on the station it wont move at all. Ive tried all different directions
InvolvedSpark 6 Jan, 2019 @ 4:38am 
Did some fiddling about with it in an attempt to make a crane for repairing vehicles. You do need to change WASD.Y to WASD.Z for the input to be W and S, instead of space and C. Unsure about W and A, unless that was a typo.
Codius Hilol  [author] 23 Oct, 2018 @ 8:54am 
You can indeed. It’s been a while, but you might be able to change WASD.Y to X or Z maybe. I’ll have a look when I am not busy.