Space Engineers

Space Engineers

Simple cruise control
214 Comments
Roon Mian 9 Apr, 2024 @ 5:35am 
Is there a way to tell the script not to just switch on thrusters i switched off on purpose?
hugums247 14 Dec, 2023 @ 12:04pm 
Was Working fine and then just quit and now cxant even fine it in scripts
[7HBK] Elrond McBong 4 Aug, 2023 @ 2:57am 
Is there a versio that works with wheels? On my plane it works just perfect but on rovers not at all, as if the script can't comunicate with wheels.
Admiral Vector 23 May, 2023 @ 5:59pm 
needs updated
Malhavoc 16 Sep, 2021 @ 4:26pm 
Could you elaborate on how to set up multiple displays in the cockpit, as you have displayed in the pictures?
Orion 16 Jul, 2021 @ 6:55pm 
Is there any way to adjust the color of the graphical interface? I want to make it orange to match the of the rest of my ship.
Sny 20 Jun, 2021 @ 6:20am 
Definitely need to add some exception handling when losing a thruster... but really slick script otherwise.
Golden Darkness 9 Jun, 2021 @ 3:04pm 
can you add to the plan gravity align?
StootWorts 9 Jun, 2021 @ 12:41am 
I'm sorry for the spam, but I've narrowed down the issue even further. It doesn't occur when taking lots of damage. Instead, the issue occurs when the cruise control is used with a damaged thruster. For example, if I destroy one of my front-facing thrusters, the cruise control will let me start to accelerate, but when I try to brake, the script crashes. I tested the same thing with my upwards-facing thrusters and got the same result. The script will function going up, but once I try to stop it, the script crashes and I lose control over whichever axes the crash occurred in. It appears that whenever the script calls upon the thrusters facing in a certain direction to fire, if one of those thrusters is destroyed the script crashes. It's difficult to explain, so I made another video which hopefully visualizes it. Sorry again for the spam, but since I think I found the root of the issue now, I don't have anything to post for now. https://www.youtube.com/watch?v=I6TxKxov31s
StootWorts 8 Jun, 2021 @ 1:33pm 
Following up again, the issue occurs with both vanilla and the plasma thrusters. I did get another more clear video of when the glitch happens ( https://www.youtube.com/watch?v=_gDcS5TV8ug ). It seems to occur right when the ship takes a large amount of damage from multiple projectiles. I'm not sure how the cruise control is written, but if it's written to detect changes to the ship on its own, maybe the sudden and large amount of changes crashes it?
StootWorts 4 Jun, 2021 @ 10:20am 
For the YouTube link, copy and paste it without the parenthesis, with them Steam thinks it's a virus link.
StootWorts 4 Jun, 2021 @ 10:19am 
Hey, I'm not sure if this will help, but I got the issue on video (https://www.youtube.com/watch?v=o8TXK4t7T60&t=52s) . at around 0:19 you can see my rear thrusters are no longer lit up, which is what led me to doing that weird roll thing so my bottom thrusters could keep pushing me. The crash at the end happened when I opened the control panel and attempted to manually turn the plasma thrusters back on. I went on again after and tested it, the plasma thrusters turn on and off without issue outside of combat/excessive damage. I'll also ask the author of the plasma thrusters mod about this, since there's a chance that their mod is also playing foul with something.
StootWorts 2 Jun, 2021 @ 11:36am 
I'm having the issue on single player, unfortunately. What do you mean by engine mod? If you mean for the actual ship's engines, I'm using plasma thrusters.
Andrew  [author] 2 Jun, 2021 @ 5:02am 
@StootWorts, I didn't seem to notice any problems.
Perhaps you are playing on a server that has a PBLimiter plugin? It burns program blocks when there are lags.
If not, write the name of the engine mod you're using, and I'll give it a try.
StootWorts 1 Jun, 2021 @ 10:41pm 
Hey, I've started experiencing a weird issue the past few days. When my ships start taking damage, the script will disable itself, requiring a recompile, before working for a second and crashing again. If during this I manually go into my control panel and try turning on all thrusters, it crashes the game. I have been playing with a few more mods than usual lately, but this issue only started a couple days ago. Is this an issue with the script or is Space Engineers just farting out on me?
Rusted Droid 13 Apr, 2021 @ 11:22am 
I use your script for atmo turbine lifts and that Half-Life inspired tram i posted GIF in artwork.
That tram use basically your "setspeed NNN" command. And script have no problem to guard that speed using atmo engines even fighting with wheel override.
Rusted Droid 13 Apr, 2021 @ 11:14am 
I read that you plan add wheels as separate engines (In the plans:).
They also have override called "wheel propulsion override" with value in +/- %.

Asking as Keen pushed update and released Wasteland DLC. Now wheels can be finally used as 4x4 drive. (wheels are less power hugry)
Meaning i do not need to use atmo turbines anymore for lifts on planets (Keen-bug was that wheels spin on place).
Also asking as your script has nice GUI.
Andrew  [author] 13 Apr, 2021 @ 10:23am 
@Rusted Droid It doesn't work with the wheels. Fundamentally different mechanics, it's like writing a new script.
Rusted Droid 13 Apr, 2021 @ 9:54am 
Any plan adding wheels to this script? (for wheel based lifts)
Andrew  [author] 23 Feb, 2021 @ 10:06am 
@StootWorts, Thanks) I have it on all the ships, too.
StootWorts 23 Feb, 2021 @ 9:17am 
This script has become required on every ship I build especially since I play with unlimited speed mods, thanks for making it!
KagedDaemon 6 Dec, 2020 @ 7:33am 
Would it be possible to get this over on mod.io? If so that would be great!!
Andrew  [author] 4 Dec, 2020 @ 9:31pm 
@🎃Niceguygamer🎃 I understand, but no, the graphics output is implemented only on 1 display
Niceguygamer 4 Dec, 2020 @ 8:16pm 
Oh sorry let me rephrase it what I was saying was is it possible to have the cruise display show up in multiple lcds not the cockpit but LCD.Because in my case when I display the cruise display in the lcd the display on the cockpit stopped working.
Andrew  [author] 4 Dec, 2020 @ 7:31pm 
@🎃Niceguygamer🎃 I didn't understand the question. The display number can be specified in the settings, for example " Cockpit(3)". This will be display number 3 in the cockpit "Cockpit"
Niceguygamer 4 Dec, 2020 @ 3:37am 
Hi the script works great but just asking is it normal that the display disappears when you have multiple lcds? Does it have to be just 1 cockpit then 1 lcd?
Niceguygamer 3 Dec, 2020 @ 11:45pm 
Oh wow this works great I love it. Great Job!
Niceguygamer 3 Dec, 2020 @ 9:54pm 
Oops sorry I did read it but not really read the entire thing just passing by some sentences my bad. Thank You
Andrew  [author] 3 Dec, 2020 @ 9:38pm 
@🎃Niceguygamer🎃the first parameter in CustomData is "Language=en", then recompile. You still haven't read the instructions. Why did I write it?
Niceguygamer 3 Dec, 2020 @ 8:54pm 
ok thanks. 1 more question how do I translate or change the language showing up in the screen?
Andrew  [author] 3 Dec, 2020 @ 8:51pm 
@🎃Niceguygamer🎃 nstructions are here in the description. Everything is configured by specifying parameters in the CustomData of program block
Niceguygamer 3 Dec, 2020 @ 5:45pm 
What do we name the lcd or cockpit lcds to show up this cruise control GUI? Is the instructions in the PB?
DoktorKrove 23 Nov, 2020 @ 12:18pm 
wow, this is a lot like the script I made that does the same thing.
https://steamhost.cn/steamcommunity_com/sharedfiles/filedetails/?id=2193876827&searchtext=throttle
Your display looks much better than mine and I never added localization, so I only have english.
Nice Script!
Astaron 1 Nov, 2020 @ 5:33am 
Скрипт вообще класс! Огромное спасибо автору:steamhappy:
Twiz 19 Jul, 2020 @ 5:00am 
Cool thanks for a detailed response. Hopefully you can figure out a solution eventually as your script is quite handy and easily customizable.
Andrew  [author] 18 Jul, 2020 @ 7:31am 
@Twiz, Yes, it is programmatically impossible to distinguish the type of engines, so the script manages all the engines at once. And since the script itself enables and disables engines, it is pointless to disable them manually. This is a serious flaw, and I haven't figured out how to cheat the game's mechanics yet.
The script development plans include the following item:
- separate control of atmospheric, hydrogen and ion engines, with the ability to turn on or off different groups of engines;
but I don't know how to do it well. I know how to do this poorly (list the names of engine groups in the settings), but I don't want to:)
Twiz 17 Jul, 2020 @ 12:17pm 
k cool I got that working now how do i stop it from activating my ion thrusters everytime I use it? I don't wanna use my Ions when I'm in Atmosphere and I have them in a group and turned off but every time I activate this it turns them all back on and wastes a ton of power
Andrew  [author] 14 Jul, 2020 @ 4:50am 
@Twiz, it works. When using the speed mod, you must specify the correct value in the "MaxSpeed" constant in the script body. This should be a guaranteed achievable value, for example, for 300 m/s, you can specify 299.9
Twiz 13 Jul, 2020 @ 8:33pm 
so this doesn't work with speed mods then?
Andrew  [author] 8 Jul, 2020 @ 6:02am 
@Rowwbit, Yes, programmatically. I have long wanted to adapt graphics to different screen formats. But when I started updating the script (in the description at the end there is something I wanted to finalize), I got too global a change, and it is not completed. It will probably have to be divided into several small updates, and then I will be able to complete them.
Charlie_Foxtrot25 23 Jun, 2020 @ 6:53am 
Got it working, had to delete the pb block and replace it. It was still displaying everything from the prior script.
Yes it had several cockpit blocks it could have used, it just wasnt updating the custom data until I replaced the block...
Andrew  [author] 23 Jun, 2020 @ 3:07am 
@Spectre25, In Program.GraphOutput() produces a graphics output on the display. Perhaps the script didn't detect the display?

The script logic is as follows: search for the display specified in CustomData "Display=MyCockpit(0)", where "MyCockpit" is the name of the cockpit, and 0 is the number of the display in the cockpit.
Or like this: "Display=Display 1x1", you can specify any display as a separate block.
If the display is not found, the first display of the cockpit specified in CustomData ("Cockpit=...") will be used. If the cockpit is not found, the script will try to find any cockpit that can control the ship.
Is there a single cockpit on the ship that can handle it?

I can recommend the following: make a temporary cockpit, install the script and run it for the first time to generate the initial settings in CustomData.
Charlie_Foxtrot25 22 Jun, 2020 @ 8:53am 
Im getting an error message after installing the script from the editor menu and custom data is not updating...
It reads;

Caught exception during execution of script:Object reference not set to an instance of an object.
at Program.GraphOutput()
at Program.Main(String argument, UpdateType updateSource)
at Sandbox.Game.Entities.Blocks.MyProgramableBlock.<>c__DisplayClass46_0.<ExecuteCode>b__0(MyGridProgram program)
Andrew  [author] 30 Mar, 2020 @ 1:12am 
Yeti, have you tried reading the instructions in the description?
The multi-language interface is made initially, the instructions are also made. But you ask how to do it, and then you say that you need to write about it somewhere...
Read the description first. PLEASE!
Jni 29 Mar, 2020 @ 7:09pm 
Ah thanks, should probably write that somewhere
Andrew  [author] 28 Mar, 2020 @ 11:00pm 
Yeti , the settings in Custom Data will be generated at the first launch. Edit the Language setting and recompile the PB. Yur can use ru/en/de parameter.
Jni 28 Mar, 2020 @ 6:27pm 
Any way to translate this from russian?
Menz Agitat 21 Feb, 2020 @ 6:32pm 
Good to know !
My issues are now solved and all of my questions answered, thank you for your time :)
Andrew  [author] 21 Feb, 2020 @ 3:57pm 
@Menz Agitat You cannot specify multiple commands in a row, this is not provided in the script. I didn't think about it)
By the way, the "setspeed" command automatically enables cruise control.
Menz Agitat 21 Feb, 2020 @ 3:26pm 
First, thank you for your responsiveness.

I didn't try without brackets because of some other scripts conventions, now it works as intended :)

About the PB execution parameters, it also works: I just forgot to increase the speed :x

By the way, is it possible to execute the PB with multiple arguments at once ?
like "cc_on setspeed 100" without quotation marks.