Space Engineers

Space Engineers

Not enough ratings
Automatic Thruster Switcher
   
Award
Favorite
Favorited
Unfavorite
File Size
Posted
Updated
1.745 KB
Dec 5, 2015 @ 8:33am
Dec 16, 2015 @ 4:58am
5 Change Notes ( view )

Subscribe to download
Automatic Thruster Switcher

Description
Description
This is a script that will allow you to trigger timers based on your distance from the center of the closest planet, along with showing you the distance towards the center of the closest planet.
This can be used to control when to switch from Atmospheric to Hydrogen/Ion Thrusters, create an automatic staged rocket, etc.

How to setup for basic Controlling Thrusters
1) Install this script into a Programmable Block
2) Place Three Timers.
3) Name the first one: Plan.First <65000,false>
4) Name the second one: Plan.Second <65000,true>
5) Add your Atmospheric Thrusters in the First Timer, to turn them on and add your Hydrogen/Ion Thrusters to turn them off.
6) Add your Ion/Hydrogen Thrusters in the second timer to turn them on, and add your Atmospheric Thrusters to turn them off.
7) Run the Programmable Block with the argument: update
8) In the third timer set it to Start itself, and make it run the Programmable Block with no arguments.
9) You may have to edit the height (the 65000 number in the timer names) depending on how much atmospheric thrust and for that matter Ion/Hydrogen Thrust you have.

Advanced Setup
The script is pretty easy to use, but my descriptive abilities are not the best so please comment if I haven't described these things the best.
A good idea if you want to cut off atmospheric/space thrusters is to use 4 timers, and give them different cut off values so they are both on at the same time for a little while.

Timers have to start with Plan. and end with <Height(number in m),Above(true/false)>.
The Height is just as it says, the height above the planet center when you want the Timer to trigger.
The Above argument is a little harder to explain. If it is true it will trigger if you come from below the height, and go above it, and if it is false it will trigger if you are above the height, and you then go below it.

Everytime you edit your timers you have to run the Programmable Block with the argument "update" and it will update the list of timers.

You can also name an LCD "ShowHeight" and it will show what planet you are close to, and the distance to the closest planet.
14 Comments
SioxerNikita  [author] Jan 27, 2017 @ 8:09am 
Yeah you do, although I am with this script also using the GPS coordinates to determine the height above planets and it really only works with the vanilla planets.

So if you are using my script you just look through it to see if you can find the values.
woostyboy Jan 27, 2017 @ 7:13am 
Thanks. From the limited understanding I have from looking at some of the other posts, it seems the scripting is only able to 'see' the planet once you're in the gravity/atmosphere, I need to have it see the planet from greater distance.

With the auto pilot would you not have to already know the GPS location where you want to go? I'm trying to achieve a sort of 'intelligent' system that says" Oh look, there's the planet, I'll head towards it" from whatever distance you are away from it.

Thanks again.
SioxerNikita  [author] Jan 27, 2017 @ 6:50am 
I could potentially do it, but I am a little busy making a few mods that I currently have.
You could potentially put a couple of remote control blocks on your ship and use auto pilot.
woostyboy Jan 27, 2017 @ 2:58am 
Hi SioxerNic

I'm not able to program scripts myself so have great respect for those that can. I need to pick some collective brains, and hopefully someone already has / can come up with a script to do the following -

Point the cockpit or RC block toward the nearest planet, even if outside it's gravity or atmosphere.

I'm experimenting with fully automated escape pods. Once in atmosphere there are scripts available to align with gravity, so they remain upright and I can fire the parachute with sensors at a set distance from the ground.

What I can't do is get the thing to the planet in the first place!

Any advice or help would be most appreciated :)

Many thanks and keep up the good work.

Woostyboy..
SioxerNikita  [author] Dec 16, 2015 @ 12:20am 
That is a good idea. I'll add it later today.
artiedee Dec 15, 2015 @ 9:06pm 
Would be cool if you could give us GPS of the planet center in a GPS format on the LCD, would be really useful...
SioxerNikita  [author] Dec 10, 2015 @ 4:21pm 
It most likely will :) Be aware that all coded distances are based on planet center, not surface :)
Decker_MMIV Dec 10, 2015 @ 11:25am 
Thank you. - Now I just have to build this 3-staged rocket, and figure out if it will work ;-)
SioxerNikita  [author] Dec 10, 2015 @ 7:24am 
Updated
SioxerNikita  [author] Dec 9, 2015 @ 12:05pm 
Uhmm, sorry about that. I will fix it right away. I did test it, and uploaded it, but it might have published the wrong version.