Space Engineers

Space Engineers

Easy Throttle Control & Max speed Script
131 Comments
Jotaro 8 Feb @ 9:49am 
Most of the time it breaks if there is another programmable block with same script
Jotaro 8 Feb @ 8:16am 
Merge blocks breaks this script that won't work anymore even when recompiling and only says "Enter the main cockpit to initialise thrusters or control the remote control block, there is no LCD with index '1' in the main cockpit, please change LCD_INDEX"
Jotaro 18 Jan @ 5:35am 
Can't get subgrid control to work have another ship through connector
G43 mai waifu 1 Dec, 2024 @ 9:23am 
...wait I can't reproduce that in another save.lemme take another look
G43 mai waifu 1 Dec, 2024 @ 9:11am 
It has some issue
when ship has a cryo chamber it stops working
Kilo.Four 11 Jul, 2024 @ 6:07pm 
Sorry I got it to work. Had to remove the programmable block and start over. I must have messed something up.

Thanks again for making such a cool script.
Kilo.Four 11 Jul, 2024 @ 6:03pm 
Super cool script!

I have the same question as R5Dad though. I can get it to work with cockpits but not control seats. Tried adjusting setting to false as you recommended but still doesn't work. I set control seat to main and also tried adding !main to the title. Still nothing.

Really excited to get this to work! Thanks!
Delta Hawk 20 Jun, 2024 @ 6:11pm 
How do I add !Throttle to the screen of a programmable block so I can see the throttle information?
Ubermensch 11 Jun, 2024 @ 1:54pm 
It's one of the best modes of the game. I'm currently using it without any issues.
DoktorKrove  [author] 20 Jan, 2024 @ 7:33pm 
@BeetBurger
I fixed the Governor more now it should no longer accelerate uncontrollably when you fly in more then 1 direction!
DoktorKrove  [author] 20 Jan, 2024 @ 7:02pm 
I fixed an issue where the script would not work unless you recompiled the script while in the cockpit.
BeetBurger 30 Oct, 2023 @ 2:44am 
Reply to Jotaro on March 18th
There is some weird accelerations happen sideways when in governor mode it ignores max
speed and speeds up until i release buttons

Same thing I notice here while tilting down or up the speed is not correct but only when I get level, so I cannot really use this at any angle for a given governor speed whic is annoying a bit.
intolerant 14 Sep, 2023 @ 9:10am 
I can't get it to recognize that I'm in the cockpit, regardless of the !main tag or "Main Cockpit" toggle. It recognized the remote control, but didn't control properly (I could set the cruise speed, but the throttle only reduced speed).
Cyrus Tarkek 20 May, 2023 @ 8:05pm 
As of 5/20/23 there seems to be an issue with adding multiple cockpit type blocks to the same grid. When I have only one cockpit labeled !main and ticked as main in the control panel the script works fine. As soon as I add more cockpits the program block says the cockpit is not occupied.
DoktorKrove  [author] 28 Apr, 2023 @ 5:04pm 
@R5Dad, should work with Control seats. Just make sure to set the main cockpit, you may also need to change the value ENABLE_COCKPIT_LCD to false in the program block
R5Dad 27 Apr, 2023 @ 3:11pm 
Does this not work with control seats? Only cockpits?
Jotaro 18 Mar, 2023 @ 10:07am 
There is some weird accelerations happen sideways when in governor mode it ignores max speed and speeds up until i release buttons
乂Oo忘★了愛oO乂 24 Feb, 2023 @ 6:16pm 
Find more precise questions,The new version will become invalid after copying and pasting the grid
乂Oo忘★了愛oO乂 23 Feb, 2023 @ 4:04am 
I have a little question to know,Under the same settings, why does the 2021-05-28 version work normally, but the latest version does not work, is there something I did wrong?Both set the cockpit to main
Primarinabee 21 Feb, 2023 @ 1:13pm 
Oh, thanks! I'll try that out
DoktorKrove  [author] 20 Feb, 2023 @ 4:57pm 
@Primarinabee, oh I see, this should be easy to fix. What is happening your ship probably has really good acceleration and the script is overcompensating, it tries to accelerate and overshoots the speed then tries to slow down and overshoots the speed again, and repeat. You can fix this however, in the script settings you will find a part where you can adjust the “sensitivity” of the thrusters, find the line that looks like this
const float MULTIPLIER = 1.5f;
(line 103 in the programming block) and change it to something smaller like
const float MULTIPLIER = 0.5f;
(this is just a number with an f at the end, you could set it to any value you want but smaller is less sensitive). If that doesn’t work you can also try adjusting the dead zone, it’s the line that looks like this
const float deadZone = 0.0f; try setting it to 1.0f.
Primarinabee 20 Feb, 2023 @ 12:09pm 
Well I don't need it to escape orbit, I was mostly referring to use in horizontal or zero-gravity movement, where I'm seeing both the front and back thrusters go full power (Maybe the script isn't able to account for the modded thrusters having 4x the thrust and it's overusing them?)
DoktorKrove  [author] 20 Feb, 2023 @ 7:06am 
@fatalerror420 yes something is not set up correctly. Are the backwards thrusters from another mod? This script should work with all thrusters but that may not always be the case. Also if the thrusters are on a sub- grid then this mod can’t control them
DoktorKrove  [author] 20 Feb, 2023 @ 7:04am 
@Primarinabee Unfortunately, that is opposite to how the script is designed to work so I don’t believe it is something I would be able implement. With that said I am curious how the script is using more fuel. Ideally to get to orbit (by that I mean just out of the gravity well of the planet and not a literal orbit using the orbital mechanics mod) you would turn on cruise, hold forward until you reach a desired speed, I usually go about 95 m/s, then let go of everything and just wait. The script will only use as much thrust as it takes to maintain that speed (say 95m/s) and as the gravity well goes down, so will the amount of thrust used.
fatalerr420 19 Feb, 2023 @ 9:20pm 
backwards*
fatalerr420 19 Feb, 2023 @ 9:18pm 
I don't know if I'm setting it up wrong, but cruise & cruise+ only work when I have my forward thrusters off, and while that's better then nothing, its still really inconvenient.
Primarinabee 31 Jan, 2023 @ 8:59pm 
This is the closest I could find to what I want but it wastes so much fuel (The fuel it used while I was configuring it is greater than the fuel it takes to get me to orbit) and I really don't wanna clutter my ship with ion/atmo thrusters could you change eco mode to just...not fire the forward/reverse thrusters unless you give an input or it is absolutely necessary to maintain speed?
BlacKHaraZ 16 Dec, 2022 @ 5:38am 
Forget my question.

Recompile and one time run a mode in the programable block itself fix it. After that it also accept the commands from the toolbar. ;o)
BlacKHaraZ 16 Dec, 2022 @ 12:24am 
Hey. I love your script. That's an option SE needs in Vanilla. +1

Anyway... I have problems to use it on dedicated Server. Is there any workaround? He said to me "No Data in MP" =(
Ahza 1 Nov, 2022 @ 10:08am 
update 2: works with other cockpits, but it gets confused if u have more than 1 cockpit/control seat on your ship. dont have more than 1
Ahza 1 Nov, 2022 @ 9:59am 
After troubleshoot- only works with 1 cockpit the "control seat" no other cockpits work with this script.
Ahza 1 Nov, 2022 @ 8:48am 
Doesnt work, says cockpit not occupied and tells me to choose a mode doesnt see the arguement nor me at the helm.
DoktorKrove  [author] 28 Sep, 2022 @ 3:56pm 
@BadDevilGrind, Ill have to take a look
BadDevilGrind 28 Sep, 2022 @ 1:20pm 
I noticed a fatal exception when trying to run the governor command while controlling a remote control block with the !main tag
DoktorKrove  [author] 14 Aug, 2022 @ 12:51pm 
Ya the sub grids can cause problems, I suggest clicking the recompile script button after you add a sub grid or add !main and don't have any cockpits with the "Main Cockpit" setting checked.
Trapper Wolf 14 Aug, 2022 @ 12:09pm 
Looks like the script works correctly, but it starts acting up when you build multiple subgrids on a the same ship.
DoktorKrove  [author] 14 Aug, 2022 @ 10:21am 
@weberspy Check the program block, on the right side there should be a message saying what the problem is. Most likely it can't find a Cockpit with Main Cockpit checked.
weberspy 12 Aug, 2022 @ 10:42am 
the script doesn't seem to be doing anything, i have tried changing modes and i start decelerating when i let go of W
DoktorKrove  [author] 24 Jul, 2022 @ 9:57am 
@Trapper Wolf, Sorry, I have heard about the issue but I can't recreate it myself. I would suggest making sure only 1 cockpit is set as main and the ship is not connected to any other ships or doesn't have any other ships connected to it then recompile the script.
Trapper Wolf 22 Jul, 2022 @ 2:39pm 
Same as Gifted Lion, tried all the instructions, keeps saying cockpit/remote not occupied on a large grid, vanilla ship. Any ideas?
Curcuma 21 Jul, 2022 @ 8:23am 
I woul but Steam dont let anyone send non friends any messages.
By the way today the script went back to normal.
DoktorKrove  [author] 20 Jul, 2022 @ 4:32pm 
@Curcuma, can you blueprint the ship and privately publish it on the workshop and send me the link. I can't create the issue but I know your not the only one who has had it.
Curcuma 20 Jul, 2022 @ 3:40pm 
The Script worked fine but now it says Cockpit/remote not occupied and i cant get rid of it neither replace the cockpit or the programable block. I used it on my large Ship
Gifted Lion 16 Jun, 2022 @ 6:32pm 
I'm having an issue setting the main cockpit on a large grid ship. As I have two decks i want to avoid using the K menu "main cockpit" setting as it locks me out of flight controls from the other deck. However using the "!main" tag on the primary seat does not register with the script. I seem to only have this problem with Large Grid ships. Is there any work around i can use? Thank you for any feedback.
Trapper Wolf 5 Jun, 2022 @ 10:40am 
Awsomite! thank you very much!:steamhappy:
DoktorKrove  [author] 5 Jun, 2022 @ 8:44am 
@TrapperWolf
Good news, I looked at the code again and it turns out my understanding was wrong for what happens when the player leaves the cockpit. Now even when the player leaves the cockpit/remote control the script will continue updating the speed. This means if you change exit seat to false the ship will continue to try and maintain speed!
Trapper Wolf 4 Jun, 2022 @ 9:00pm 
Love this script, well done. But is there anyway to keep the ship in cruising at the designated speed after I exit the control seat? I have already set the exit seat option to "false"
DoktorKrove  [author] 31 May, 2022 @ 2:12pm 
@A fat assed himbo Rathalos
I haven't been able to recreate the issue with big ships, could you blueprint the ship and send me a workshop link? (if you get the image to large error take a screen shot of the ship really close up with as little detail as possible)
stupid sexy mothman w/fat ass 31 May, 2022 @ 11:55am 
I seem to have issues with this with larger vessels, I read through the comments here to try and find a fix but all the fixes I tried seem to not work... I am pretty sure I did everything right, like naming my main seat as "!main" and such, but the script doesn't seem to work? Any help would be highly appreciated! <3
Wolf 19 May, 2022 @ 4:37am 
Hello @DoctorKrove, here is some feedback I believe concerns your script, however I may be wrong. It appears all my cockpits on my ships using the script have their first screen switched to displaying the "script" category no matter what cockpit they are. That is a small problem that neutralizes some unrelated cockpits and prevent the use of their first screen.
Do you think it's worth checking ?
Thank you