Space Engineers

Space Engineers

Not enough ratings
Thrust Limiter
   
Award
Favorite
Favorited
Unfavorite
File Size
Posted
412.941 KB
24 Apr, 2021 @ 8:30am
1 Change Note ( view )

Subscribe to download
Thrust Limiter

Description
Thrust Limiter Script

This script will limit thrust when you reach max velocity so you use the minimum fuel to maintain that speed. This will save vast amounts of fuel and energy when travelling long distances.
It works both horizontally and going up/down.

E.g. Hydrogen Thruster ship to orbit on the Earth Like planet.

Description
Fuel Usage
Holding down up key to orbit
33%
With Thrust Limiter to orbit
3%

It will stop limiting thrust as soon as you stop providing input or are going at less that 99m/s. The job of the script is to stop you wasting fuel when you've hit the world speed limit but are still holding down the thrust keys. Not to slow you down in other circumstances.

Instructions

Simply build a programmable block, Edit it and copy this script into it using the Browse button. (If you can't figure out how to do this, see the Q&A section at the end).
The ship does need a control seat/cockpit of some kind even if unmanned. If the cockpit has a screen then it will display info on it.

Advanced Usage

You don't need to do any of these if you don't care, the script will just work out the box with no additional configuration.
The script also has autopilot modes for getting into space (by going straight up) and returning from space (by going straight down), both using minimal fuel.

Run with argument:

Argument
Description
Just runs the script in whatever mode it was last in, default is freeflight
off
Turns the entire system off and disables all thrust overrides
ascend
Start auto ascent, will turn off once out of gravity. Will trigger any timer block containing the tag "#TLA" when complete. e.g. named "Timer Block #TLA"
descend
Start auto descent, needs to be in gravity when triggered. Will trigger any timer block containing "#TLD" when complete. e.g. named "Timer Block #TLD"
Will cutoff at 2000m above ground by default - can be changed by setting descentShutoffHeight.
freeflight
Normal user controlled flight with thrust limiting. Only really needed if you set ascend or descend before and want to turn it off

You can disable the use of cockpit screens by setting useCockpitScreen to false.
Alternatively, you can use an LCD screen instead of a cockpit screen by tagging the screen with #TL
The world top speed is hard coded - you can change it if you have a modded top speed and want to be able to go that fast. See maxSpeed at the top of the script.

Questions

Q: I can't edit or run scripts in Programmable blocks?
A: You need to enable "Experimental Mode" in Options->Game and then enable "In-game scripts" in your world (under Advanced).
Q: Does it support subgrid thrusters?
A: No, it could, but it would make no sense as normally to use them you'd be running another script which is expecting to set the thrust override itself.
Q: Does it support the vanilla autopilot?
A: No, there is a bug in the API that prevents us reading what the autopilot is trying to do. Additionally scripts such as SAM's autopilot already throttles thrust just as efficiently as this script. Having said that, you could hook this script in as part of a vanilla autopilot setup using the ascend/descend functions.
Q: Does it work with wheels?
A: No, the clue is in the name!


7 Comments
Unruly 4 Mar @ 10:59am 
Some sort of bug prevent ascent from going straight up. Things start out ok, but eventually it goes way off vertical. Also, on some (admittedly not vanilla) worlds, TL declares itself outside gravity WAY before it P-Gravity is actually 0. It still works fine for thrust limiting, though. I haven't found another script that beats it in that respect. 4/3/2025
-Data- 8 Jan, 2023 @ 4:40pm 
1: You need settings to choose which lcds to display stats on. Believe it or not, people use their main cockpit lcd for other things than your stats.
2: In freeflight, there should to be a way to change what speed the vehicle is limited to, and not just 100m/s all the time.
Unruly 9 Mar, 2022 @ 12:43pm 
How about a 'cruise' mode, where backwards thrusters are disabled? I have multiple kinds of thrusters in different groups, so the on/off toggling leads to some unexpected combinations.
Unruly 8 Oct, 2021 @ 3:27pm 
> No, there is a bug in the API that prevents us reading what the autopilot is trying to do.

And I just figured out why TL "wasn't working" on a number of my ships - I had taken to using the remote control all the time so that I only ever had one shortcut bar to maintain. I've melted two ships so far though, so I guess i'll go back to NOT using this trick.
Bystander  [author] 1 Sep, 2021 @ 12:17pm 
@BloodAngel099 it will use whatever thrusters are active and knows how much thrust they generate the whole time. Atmo thrusters will stop generating thrust as they approach the threshold so this script will push up the contribution from the H2/Ion thrusters automatically.
To answer the question though - it won't favour any type of thruster over another, it just looks at how much they are pushing.
BloodAngel099 8 Aug, 2021 @ 7:23pm 
When using the Accend is it possible to have it prioritize use of electric thrusters over hydrogen?
Unruly 30 Apr, 2021 @ 11:26am 
So, I think you mean 'Thrust Limiter'? I only noticed because I subscribed and then searched locally for 'thrust' and couldn't find it. Either way, thanks for this script.