Space Engineers

Space Engineers

JTurp's Hover Script
244 Comments
Warlocc May 15 @ 11:25am 
Can confirm, "Land" goes to 25 meters, no matter what the height is actually set to.
Pablo Diablo Feb 4 @ 11:56am 
Amazing. Thank you!
jTurp  [author] Feb 3 @ 3:46pm 
Yep, I do see it thinks it's landed but not actually. I'll see about a fix in the near term
jTurp  [author] Feb 3 @ 3:14pm 
@Pablo Diablo

I'll run a test, thanks

@Stellar forester

Not likely the way it is written
Pablo Diablo Jan 14 @ 5:15pm 
Enjoying this script so far - but when I execute the 'land' command, my ship descends to ~25m and then hovers at that height. Won't descend further until I give it direct input. Set the default hover height to 75m in the script headers. I've tried recompiling, copy-pasting, reloading the save...
Stellar forester Nov 24, 2024 @ 6:24am 
is there a possibility to use this script with Vector OS https://steamcommunity.com/sharedfiles/filedetails/?id=2831096030
jTurp  [author] Nov 22, 2024 @ 7:17pm 
@SaitamOnun

I should be able to add that, sure :)

@Mac and Cheese

Negative, this requires gravity to function properly

@Warlocc

Hmm, I'll have to check that out. Been a few updates since I've played with this so who knows.
SaitamOnun Nov 22, 2024 @ 5:48pm 
Any chance of make it show the information on a cockpit sdisplay. It's perfect when I build my own cckpits, but if using a vanilla cockpit.....
Mac and Cheese Jul 8, 2024 @ 4:20pm 
does this work in space, like a way to hover around an astroid on a space bike?
Warlocc Jul 1, 2024 @ 4:51pm 
Seems like it only works once per playthrough, then never turns back on. Just sits at "setup complete".
jTurp  [author] May 20, 2024 @ 5:46pm 
@kinngrimm

I believe all of the ones that only have 2 states are toggles, and anything that has more than that requires an argument. Or do you have an example of which one does not? It's been a while since I've messed with it.
kinngrimm Apr 28, 2024 @ 4:34pm 
Currently in the process of getting this going for the first time.

There are several arguments that switch a state to on or off, why aren't they by default all togles instead of explicitly having to give the argument with the state on or off? With "mode" you have done it that way, why not with the others? Would seem to me a more easier and convenient way to handle these states or am i missing something?
Then they would claim only have the amount of slots in the toolbar which might make handling of the script a touch more convenient of not more intuitive.
jTurp  [author] Apr 15, 2024 @ 4:56pm 
@bigb3321

[*] Can it be used in ships: as long as you plan on the ship becoming a hover craft, yes - it isn't going to work in space tho, and above a certain altitude it will only align to gravity

[*] Will it work with Whip's subgrid thrusters - probably? It uses a block group containing all the thrusters you want it to manage so this should not be an issue
bigb3321 Apr 12, 2024 @ 6:44pm 
Two simple questions can it be used in ships and could it possibly work with whips subgrid thruster manager?
Into Mar 29, 2024 @ 4:06pm 
A weird issue, it just suddenly stopped working. I am in creative and dmg is disabled. How do I reset it back to working?
jTurp  [author] Jul 11, 2023 @ 10:57am 
This fell through the cracks. I’ll check this weekend when I get back home
Jem Jul 11, 2023 @ 4:45am 
Hey I've run into the same problem as Dan.Drummer with arguments not working. Was there a solution that anyone has found?
jTurp  [author] Apr 23, 2023 @ 11:57am 
I'll run a test and see. Was working last time I messed with commands, but who knows..
Dan.Drummer Apr 23, 2023 @ 4:47am 
holla, the script works as expected!
but arguments are not executed, no matter what command I enter. when i change the values ​​in the script, for example:
double HOVER_HEIGHT = 50; nothing changes after the recompile

Does somebody has any idea?
jTurp  [author] Apr 21, 2023 @ 11:41pm 
@Souls

It's a combination of the thrust power and weight, but 0.5 might be a good starting point in general.
Souls Apr 21, 2023 @ 9:04pm 
Yeah that seems to be fixed, that was fast! Thank you!

So what should that value be based on? Should the number be smaller the heavier the ship? Or is it more complicated than that?
jTurp  [author] Apr 21, 2023 @ 7:37pm 
@Souls

Okay, so the issue was due to the script trying to keep the height diff between desired and actual to less than 0.25m, and it was oscillating trying to do so.

I've added a HEIGHT_DIFF_TOLERANCE setting in the script that you can set to your liking. 0.5 worked well with your grid :)
Souls Apr 21, 2023 @ 6:24pm 
Oh, weird. Well, sure. Here's the ship. It was very simple, just the basics to test the script functionality.

https://steamcommunity.com/sharedfiles/filedetails/?id=2965467449
jTurp  [author] Apr 21, 2023 @ 1:34pm 
That link won't play for me, but if you want to link the ship you are working with I'll run a test with it
Souls Apr 20, 2023 @ 10:09pm 
Hey, I threw together a small ship to test this script and it kinda... bobs down about 1-2 meters every like 5 seconds or so, even if just hovering in one spot. I can't see why, I don't see any drops in simspeed or framerate at the same time either. Any ideas? (for reference) [i.imgur.com]
jTurp  [author] Feb 16, 2023 @ 11:15am 
Oh lol it would be related to the FAULT mode, yeah. You could probably search that hover mode and see where the mode is set, then you 'll be in the right spot (maybe)
UwU Feb 16, 2023 @ 10:38am 
_gfx.Display(_sb, HOVER_MODE == HoverMode.Fault);
_sb.Clear();
Those I guess?
UwU Feb 16, 2023 @ 10:36am 
Didn't mean to reupload, meant the number of lines responsible for disengaging
jTurp  [author] Feb 16, 2023 @ 10:29am 
You are welcome to use it in your personal game, but please refrain from re-uploading :)
UwU Feb 16, 2023 @ 10:26am 
And if I can change something in the code to remove the auto-disengage functiong?
UwU Feb 16, 2023 @ 10:24am 
I suppose the wobblieness comes from clang drives mounted slightly off the center of mass, which creates a rotational force, so I thoutgh there might be some settings to tweak to solve
the problem
jTurp  [author] Feb 16, 2023 @ 8:13am 
@UwU

I will not be adding support for clang drives, sorry

For wobbliness, that typically happens when the cameras are too close together. If you think of a plane that is formed from the 3 points, it is that plane that tries to maintain level with the terrain. Wobbliness is usually more prominent on hover bikes vs ships with a large surface area underneat.
UwU Feb 16, 2023 @ 8:08am 
@jTurp
Have just set up a script on a ship using clang drive, hovering works, but really wobbly, when descending script decidedes that my thrust is insufficient due to the lack of normal thrusters and disengages. Is there a way to fix, if not wobblying then just the script failure?
Siker_7 Aug 6, 2022 @ 6:13pm 
@jTurp

https://steamcommunity.com/sharedfiles/filedetails/?id=2845708986

The programmable block running the hover script is called "Hover Controller PB", and it is in control of 1/3 of the gyros on the ship. There is constant small oscillation in roll, and there is some temporary oscillation in pitch whenever the script needs to align pitch.

You may notice a pb called "Gravity Aligner PB"; this script is currently turned off (I was using it to align to gravity while your script was being used just to lock altitude until the issue gets fixed).

This is my first large ship design, and I know it doesn't have great maneuverability in atmo. This will be improved in future versions.
jTurp  [author] Aug 6, 2022 @ 5:08pm 
@Siker_7

If you can send me the blueprint, I'll see if I can figure out the reason and fix :)
Siker_7 Aug 6, 2022 @ 4:45pm 
I'm getting an issue where my carrier that I installed this on is rolling left and right repeatedly in very small movements. It doesn't impact the carrier staying in the air, but it is making me dizzy. How do I fix?
(note: I'm aligning to gravity because this carrier *cannot* stay in the air if it isn't level. The rocking is not present if I use align to terrain (tested at an ice lake)).
Kittamaru Jun 17, 2022 @ 4:46pm 
That'd be freaking sweet! I look forward to it!
jTurp  [author] Jun 15, 2022 @ 4:48pm 
@Kittamaru

Yeah, I need to update it to use the API. I'll add it in the near future :)
Kittamaru Jun 15, 2022 @ 9:59am 
Howdy @JTurp - is there any way to get this to detect water in the WaterMod as a surface?
jTurp  [author] Apr 29, 2022 @ 1:45pm 
@Zarantos

It is not setup to use control seats, but you can use a small grid PB as a terminal prop and it can use the PB screen for the display
Zarantos Apr 29, 2022 @ 4:38am 
Can i use my control seat display as info display? and how can i set it up?
jTurp  [author] Apr 26, 2022 @ 2:17pm 
@OldManLagz

I believe there are a couple Cruise Control scripts on the workshop. Search for “Cruise” and select Ingame Script from the drop down
OldManLagz Apr 17, 2022 @ 1:45am 
Hello! I'm trying to find a script that will let me limit how fast a ship can go, regardless of being in gravity or on a planet. I'm not proficient enough with SE scripting to try and modify this one. Anybody know of a script like this that exists? Or if it's possible to use this one? Or if somebody wants to write one? Thanks!
lostsoul3471 Mar 22, 2022 @ 6:21pm 
I'll try all of them next time I fire up the liberated LG Drifting Pursuant Mk2. Good to know about the damping value. Currently there are 8 gyros with one on script one overridden to 0 and the remaining 6 under pilot control, we'll see what it does when all 8 are under script control. The cameras are set up with one forward and the other two on the widest part of the circular hull, so in theory it should be very stable. Thanks for the info, keep up the great work!
jTurp  [author] Mar 22, 2022 @ 2:54pm 
Also, the Damping value isn’t for the wobble, it’s for hill traversal so heavier grids can use more force to maintain terrain alignment. As for gyros, you should all of them, minus any emergency gyros you want to keep handy
jTurp  [author] Mar 22, 2022 @ 1:20pm 
@lostsoul3471

I’ll have a look at it as I didn’t have any wobble with a larger grid, but it does depend on how close the cameras are from one another (further = smoother). I’ll see if there’s a PB API for the water mod, as well
lostsoul3471 Mar 21, 2022 @ 10:18pm 
This is one of the best working hover scripts I've run into, pretty stable but a bit wobbly. Actually very wobbly for a big sized large grid. Question, adding in the gyros to the group, should you add all of the gyros, one gyro or some of the gyros? Wondering if that would buffer out the either slow drunk wobble with damper set to 10 or massage chair rumble at 1? I did manage to damp it even more by setting one gyro for the scrip and one set to override with zero's for all axis. Also any thought on checking for the water mod and setting a hard floor at "sea level" that would be a real nice add. :)
jTurp  [author] Jan 23, 2022 @ 7:49am 
@TechCoder

I already use an altitude trigger, but I just turn off Terrain following above a certain alt vs turn everything off. The whole point of the script is to hover :P
TechCoder Jan 23, 2022 @ 3:08am 
@EthicalObligation - you should take a look at Isy's Altitude Trigger and use it to turn on/off Hover
jTurp  [author] Sep 22, 2021 @ 1:01pm 
<3