Space Engineers

Space Engineers

Not enough ratings
NDS Ascent Control
   
Award
Favorite
Favorited
Unfavorite
File Size
Posted
Updated
34.488 KB
13 Aug, 2019 @ 1:53am
14 Aug, 2020 @ 4:49am
4 Change Notes ( view )

Subscribe to download
NDS Ascent Control

Description
Automatically flies your ship off the planet


Features
  • Automatically finds the side with the most effective thrust and uses that direction to get off the planet
    • If the side with the most effective thrust changes, the script will switch to that side
  • Orients the ship with the planet so thrusters are only needed in one direction and the dampeners can be safely disabled
  • Keeps the ship at a consistent speed so no fuel is lost trying to accelerate past this speed
  • Works with all thrusters and modded thrusters

Requirements
  • A cockpit or remote control
  • Gyro(s)
  • Thrusters
    • *With enough thrust to get you off the planet, this script doesn't perform miracles ;)
  • A programmable block running this script

Instructions
  • Load this script into a programmable block
  • Use the command go to toggle the script
    • Alternatively enter a number for a desired ascent speed e.g. 150
    • Any command that is not a number will toggle the script e.g. toggle, yes, fly
    • Any number will enable the script allowing for speed adjustments mid-ascension
  • Start a little off the ground so your ship has room to orient, if your forward thrusters are the strongest then it will point the back to the planet and if you're too close to the planet your ship will smack into the ground

Settings
  • dampenIfShiftingDirections - If the side with the most thrust changes, should dampeners be enabled while reorienting with the planet
    • Default - false
  • minimumThrustNewtons - Ignore thrusters whose max effective thrust at the current altitude is below this
    • Default - 1000
    • The weakest thruster is 88,000N at max effective thrust
  • ascentSpeed - The speed to maintain while ascending
    • Default - 95
    • The speed will not be reduced if it passes this
    • If you set this with a command it will save to your settings
  • gyroStrengthMultiplier - Multiplier for gyro strength used from 0-1
    • Default - 0.5
    • Decrease if your ship turns too fast, increase if it turns too slow
  • gyroAccuracyPercentage - Accuracy when aligning to the planet
    • Default - 0.1
  • recalculateEffectiveThrustDelay - Delay in seconds between recalculating the thrust of each side
    • Default - 5
    • Recalculate all sides when the delay is up but only one side per tick
  • recalculateSufficientThrustDelay - Delay in seconds between recalculating if your max thrust is sufficient to accelerate the ship off the planet
    • Default - 2.5
    • Also calculates your potential acceleration which is displayed in the control panel while running
  • checkForCompletionDelay - Delay in seconds between checking for an absence of gravity to disable the script automatically
    • Default - 2.5
  • idleTicksOverheatPrevention - Number of ticks to spend idle doing nothing
    • Default - 0
    • This is good if your programmable block 'overheats' or you wish for it to run less frequently
  • calculateAverageRuntimes - Track past runtimes and output the average
    • Default - false
    • The average runtime is very low, around 0.3ms on a large ship
8 Comments
Klous 18 Mar, 2022 @ 6:47pm 
Doesnt work, it lifts off about 50 feet. Then drops back and hits the ground then lifts off and repeats that over and over.
nicknds  [author] 14 Aug, 2020 @ 5:31pm 
I'm happy to help. Let me know if you find any bugs and I'll squash them

Be safe, have a good day
ronon_dex 14 Aug, 2020 @ 8:58am 
thats interesting,nice to know that
Spaceman Spiff 14 Aug, 2020 @ 7:06am 
I''ll check it out. This tweak to your script will make it one that I will probably use the most. Thank you for your knowledge of coding and willingness to do this change.
nicknds  [author] 14 Aug, 2020 @ 5:30am 
For the coder whose name I don't remember; loops like for, foreach, and while don't require the curly brackets if you only enclose one line

for (int i = 0; i <= 10; i++)
Echo($"Counting From {i} to 10");

while (true)
Echo("Endless loop");

foreach (string text in stringList)
Echo(text);


To enclose more than one you require the brackets

while (true)
{
Echo("Endless loop");
Echo("End the loop");
}
nicknds  [author] 14 Aug, 2020 @ 5:25am 
NostalgicFruit, I added an update that double checks everything is disabled when done

Spaceman Spiff, I didn't notice your comment and I am very sorry but I added your request. Thrusters that aren't needed turn off. Thrusters turn on if you give input so you can dodge asteroids. Dampeners toggle as needed to make sure you are ascending straight up



Added secondary deactivation process to ensure nothing is overridden after completing the ascension

Added automatic fall protection function

Upgraded directional calculations to properly determine if the ship is going forwards, instead of just calculating speed

Added thrust efficiency process which constantly toggles Thrusters as needed
-Relevant Thrusters turn on when you provide input
-All Thrusters turn on when ascension is complete

Added gravity radius calculations

Added an optional early brake distance
NosFruit 12 Aug, 2020 @ 1:16am 
Hey is there a way to automatically turn off "Gyro Override"? I have to manually do it after I get to space.
Spaceman Spiff 24 May, 2020 @ 1:42pm 
I really like your script (it's pretty cool how it rotates the ship at the point where the up thrusters are less powerful than the rear thrusters). Could you modify it so it starts shutting off thrusters when they are no longer needed so it'll conserve hydrogen? That would make the usefulness of this script stellar!