Space Engineers

Space Engineers

Simple cruise control
214 kommentarer
Roon Mian 9. apr. 2024 kl. 5:35 
Is there a way to tell the script not to just switch on thrusters i switched off on purpose?
hugums247 14. dec. 2023 kl. 12:04 
Was Working fine and then just quit and now cxant even fine it in scripts
[7HBK] Elrond McBong 4. aug. 2023 kl. 2:57 
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. maj 2023 kl. 17:59 
needs updated
Malhavoc 16. sep. 2021 kl. 16:26 
Could you elaborate on how to set up multiple displays in the cockpit, as you have displayed in the pictures?
Orion 16. juli 2021 kl. 18:55 
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. juni 2021 kl. 6:20 
Definitely need to add some exception handling when losing a thruster... but really slick script otherwise.
Golden Darkness 9. juni 2021 kl. 15:04 
can you add to the plan gravity align?
StootWorts 9. juni 2021 kl. 0:41 
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. juni 2021 kl. 13:33 
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. juni 2021 kl. 10:20 
For the YouTube link, copy and paste it without the parenthesis, with them Steam thinks it's a virus link.
StootWorts 4. juni 2021 kl. 10:19 
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. juni 2021 kl. 11:36 
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  [ophavsmand] 2. juni 2021 kl. 5:02 
@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. juni 2021 kl. 22:41 
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 kl. 11:22 
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 kl. 11:14 
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  [ophavsmand] 13. apr. 2021 kl. 10:23 
@Rusted Droid It doesn't work with the wheels. Fundamentally different mechanics, it's like writing a new script.
Rusted Droid 13. apr. 2021 kl. 9:54 
Any plan adding wheels to this script? (for wheel based lifts)
Andrew  [ophavsmand] 23. feb. 2021 kl. 10:06 
@StootWorts, Thanks) I have it on all the ships, too.
StootWorts 23. feb. 2021 kl. 9:17 
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 kl. 7:33 
Would it be possible to get this over on mod.io? If so that would be great!!
Andrew  [ophavsmand] 4. dec. 2020 kl. 21:31 
@🎃Niceguygamer🎃 I understand, but no, the graphics output is implemented only on 1 display
Niceguygamer 4. dec. 2020 kl. 20:16 
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  [ophavsmand] 4. dec. 2020 kl. 19:31 
@🎃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 kl. 3:37 
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 kl. 23:45 
Oh wow this works great I love it. Great Job!
Niceguygamer 3. dec. 2020 kl. 21:54 
Oops sorry I did read it but not really read the entire thing just passing by some sentences my bad. Thank You
Andrew  [ophavsmand] 3. dec. 2020 kl. 21:38 
@🎃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 kl. 20:54 
ok thanks. 1 more question how do I translate or change the language showing up in the screen?
Andrew  [ophavsmand] 3. dec. 2020 kl. 20:51 
@🎃Niceguygamer🎃 nstructions are here in the description. Everything is configured by specifying parameters in the CustomData of program block
Niceguygamer 3. dec. 2020 kl. 17:45 
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 kl. 12:18 
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 kl. 5:33 
Скрипт вообще класс! Огромное спасибо автору:steamhappy:
Twiz 19. juli 2020 kl. 5:00 
Cool thanks for a detailed response. Hopefully you can figure out a solution eventually as your script is quite handy and easily customizable.
Andrew  [ophavsmand] 18. juli 2020 kl. 7:31 
@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. juli 2020 kl. 12:17 
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  [ophavsmand] 14. juli 2020 kl. 4:50 
@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. juli 2020 kl. 20:33 
so this doesn't work with speed mods then?
Andrew  [ophavsmand] 8. juli 2020 kl. 6:02 
@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. juni 2020 kl. 6:53 
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  [ophavsmand] 23. juni 2020 kl. 3:07 
@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. juni 2020 kl. 8:53 
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  [ophavsmand] 30. mar. 2020 kl. 1:12 
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 kl. 19:09 
Ah thanks, should probably write that somewhere
Andrew  [ophavsmand] 28. mar. 2020 kl. 23:00 
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 kl. 18:27 
Any way to translate this from russian?
Menz Agitat 21. feb. 2020 kl. 18:32 
Good to know !
My issues are now solved and all of my questions answered, thank you for your time :)
Andrew  [ophavsmand] 21. feb. 2020 kl. 15:57 
@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 kl. 15:26 
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.