Space Engineers

Space Engineers

Not enough ratings
Piston GoTo Position
   
Award
Favorite
Favorited
Unfavorite
File Size
Posted
359.207 KB
1 Jan, 2015 @ 10:03pm
1 Change Note ( view )

Subscribe to download
Piston GoTo Position

Description
This is my first program for Space Engineers. This code will move a piston to a hardcoded position. Using multiple code blocks you can easily toggle a piston between multiple different positions, for instance like an elevator with multiple floors. Its probably more complex than it needs to be but it gets the job done.
10 Comments
Crashoverride 22 Aug, 2018 @ 2:46pm 
Latest build of SE crashes when this script is complied.
The Erubian Warlord 31 Mar, 2015 @ 7:18am 
put the sensor on the lift platform to open doors
Deathpaw 29 Mar, 2015 @ 9:58am 
@ ESS. I have a sugestion. Try a set of Timer and sensors that detects player. Close all the doors when the lift starts and then open the door with the tripped sensor triggered after a max waited time from ground to top. It's not perfect but could work. Alternativey if you can code very basic triggers, either into a seperate Prog Block or into this one.
PanzerMarmerlade 26 Mar, 2015 @ 11:29pm 
Im using it like that. The problem is that the door opens without the elevator being in the corresponding floor. since the elevator is moving from length 15m to 70m and the maximum speed that works without getting everything destoyed is 1m/s. You would say I can set a second timer that opens the door with delay but you never know if the elevator has to move 55 or 10 meters. (from the 1st to 0 floor or from 4th to 0.
Alluceanot  [author] 22 Mar, 2015 @ 9:02am 
@Sarantis
I haven't looked at this program in a while and its probably outdated at this point; however, you should be able to get the functionality you want by tying each button in your elevator to a timer block that runs the piston script and also opens or closes the appropriate doors.
PanzerMarmerlade 19 Mar, 2015 @ 5:56am 
I use your script for a double long piston elevator (max length 70 meters. It's working great with four floors and with the addition of an elevator cabin with four buttons. One simple request. Can you add in the code a command that when the piston reaches the specific length it can open a door? For example when the joinlength is 20 open door "Floor1door" when it leaves from that length to close it. So you can have a simple calling button in each floor but the elevator door remains closed when the cabin is not in that floor.
Coastal Grandmother 8 Jan, 2015 @ 9:04am 
@Alluceanot Thanks - much appreciated
Alluceanot  [author] 7 Jan, 2015 @ 5:48pm 
The position is determined by the variable GotoZ. Its a double floating number but because of the way the pistons work you can only use increments of .5
DeAnti 6 Jan, 2015 @ 8:32pm 
yea an example please
Coastal Grandmother 3 Jan, 2015 @ 4:10am 
@Alluceanot This is good but please could you give an example of how to set where the piston position(s) in the programming?