Space Engineers

Space Engineers

37 ratings
Planet To Space Launch Script
   
Award
Favorite
Favorited
Unfavorite
File Size
Posted
Updated
4.085 KB
1 Jul, 2016 @ 10:10am
30 Aug, 2016 @ 2:28pm
5 Change Notes ( view )

Subscribe to download
Planet To Space Launch Script

Description
WORKS ON THE LASTEST STABLE VERSION
Not tested on the development branch!

UPDATE:
August 30th
- Now the script can start a timer upon leaving the planet gravity
- Changed default Remote Control name to "(Main Controller)" tag

July 5th
- Added graphical LCD display

July 4th
- Added support for multiple thrusters
- Added auto speed adjustment based on estimated sim speed (useful on dedicated server)

BREAKING CHANGES
Warning! Naming conventions of blocks has changed in this new version to support multiple thrusters. Now the script searches by default the "(Main)" tag. All thrusters having the tag in the name will be used by launch control script.

Please rename your thrusters accordingly.

Description
This is a very simple script that tries to optimize fuel consumption while launching from a planet.
It actually for ships with one or more backward thrusters.

Requires:
1 x Programmable Block
1 x Timer Block
1 (or more) x Hydrogen Thruster
1 x Remote Control

Setup:
1) Place your timer and programmable block as you like. Be sure to have your remote control placed.
2) Configure the timer to run the programmable block with default arguments every second.
3) Change the script configuration parameters as described below.
4) Place an LCD and add the "(Launch LCD)" tag to its name (if you changed the tag in configuration use the appropriate one instead)
5) Start the timer.
6) In your cockpit configure an action to run the programmable block with argument "run" (without quotes) to start the launch sequence
7) (Optional) Configure another action to run the programmable block with argument "stop" (without quotes) to stop the script

The script will do the following actions:
1) Turn off inertial dumpeners (needed on dedicated servers)
2) Turn on main thruster if off
3) Launches the ship trying to reach the configured speed
4) If speed threshold is reached, gradually reduces thruster power while trying to maintain the target speed
5) If speed drops under the threshold, gradually increases thruster power
6) when outside of natural gravity field, turns off main thruster and shuts down
7) (Optional) Starts a timer upon leaving the planet gravity field

Configuration Options:
m_mainThrusterName - Change this value to the tag you applied to your main thrusters (Default: "(Main)")
m_mainRemoteControlName - Change this value to the name of your main remote control block (Default: "(Main Controller)")
m_lcdName - Change this value to the tag you applied to your LCD (Default: "(Launch LCD)")
m_debugTextPanelName - Change this value to the tag you applied to your debug LCD (Default: "(Launch Debug)")
m_speedLimit - Change this value to change the target speed (Default: 98.0)
m_thrusterPowerStep - Change this value to change the percentage step at which the script increases or decreases thruster power (Default: 5)
m_triggerTimerUponExitGravity - Enables/Disables running a timer block after leaving the planet gravity field
m_timerToTrigger - Name (or partial name) of the timer to trigger

Launch LCD
The launch LCD will display a graphical rapresentation of the launch status with:
- current speed indicator
- target speed indication
- action indicator (thust up, thrust down, launch, waiting)
- launch progress (both numerical percentage and graphical view)

Debug LCD
If you want to view some detailed informations about the launch control, just place down an LCD (or Text Panel) and add the "(Launch Debug)" tag to the name (if you changed the default config value, make sure to use the one you choose).

Future Enhancements:
Add support for multiple thrusters - DONE
Support for starting a timer block after leaving the gravity field - DONE
Refine the speed alignment algorithm
Any other idea? :)

Color codes have been taken from:
https://steamhost.cn/steamcommunity_com/sharedfiles/filedetails/?id=627416824
33 Comments
A Very Stoned Frog 15 Apr, 2019 @ 3:17pm 
is this working now?
ronon_dex 25 Nov, 2018 @ 4:30pm 
and after a while,for no reason,it triggers an exeption at void Main() sandbox entities (I think)
ronon_dex 20 Nov, 2018 @ 12:42pm 
I have all the stuff correct,but when I click RUN with argument run ,the (Main) thruster only increases to 100n and stops,I cant even get off the launch pad,and I shake at like 0.03 m/s,please help.
Garith 21 Feb, 2018 @ 2:45pm 
can you make it so it will deploy parachutes if it fails to make it into space?
SRXcraft 6 Dec, 2017 @ 1:31pm 
Does this work in the actual version ?
flopp 5 Jun, 2017 @ 11:35am 
i got it. add to the timer setup timer start. the timer will not stop and onl lael (Main) on your thrusters that make you go forward, while facing the sky. (i think)
flopp 5 Jun, 2017 @ 11:19am 
when i got it set up, ran it, nothing happend. than i decided to try changing making so the timer wouldent stop running. all the thrusters i labeled (Main) went on. is it only the backwards one?
M0rsla 15 May, 2017 @ 6:37pm 
After labelling Engines, Remote Control, and LCD the script would run. Unfortunately the script did not actually work. My ship just sat on the launch pad. It appears that the script is not working with the current builds.
SpetS 21 Nov, 2016 @ 6:00pm 
it doesn't work in DEV?
caught exception under execution of script:
Index was out of range
Must be non-negative and less than the size of the collection
Parameter name: Index
CheekyHusky 14 Nov, 2016 @ 2:54am 
"It actually for ships with one or more backward thrusters" , is what confused me :P, i thought the ship would point its nose up for me, but it seems you need to have the nose up like the nasa rocket launches.

As you asked for suggestions, mine would be that :P, to make it align "up" automatically. I wonder if that would simply be changing something in the hover script?