Space Engineers

Space Engineers

109 ratings
JTurp's Hover Script
2
   
Award
Favorite
Favorited
Unfavorite
File Size
Posted
Updated
617.454 KB
21 Nov, 2019 @ 1:19pm
21 Apr, 2023 @ 7:32pm
13 Change Notes ( view )

Subscribe to download
JTurp's Hover Script

Description
Hover Script v1.4.4 released 21 April, 2023

Hello, engineers! This is script is designed to maintain a ship's altitude while also aligning the ship with either gravity or the terrain beneath it. That's it, I hope you enjoy!

Here's a couple of ready-made hover bikes, thanks to Spite (Atmo version featured above)! Please check the script version in the blueprints as they may need to be updated to the latest version.
Current Features
  • Ability to .. well, hover.. at a configurable altitude, within reason
  • Ability to toggle between aligning with gravity or terrain
  • Speed Limiter - ensures the grid remains under a configurable speed
    • Vertical speed not counted
  • Cruise Control - will move in the forward direction at whatever the set speed limit is
    • Tapping any of the movement keys (WASDC or Space) cancels Cruise Control
  • NEW! Ability to save a docking configuration, and dock / land via PB commands!

I’d appreciate your help in making this better by providing feedback as to what you like or dislike :)

Setup
Create a block group with the following blocks added to it:
  • Exactly 3 cameras, placed on the bottom of the ship, facing down in a triangular pattern (see picture)
  • ALL thrusters on the grid (you can keep some of them out of the group as emergency thrusters)
  • One gyroscrope
  • One ship controller (cockpit, remote, etc)
  • (Optional) One LCD to display info on (can also use the PB screen)
  • (Optional) Connector(s) for use with docking

Enter the name of your block group into the variable HOVER_GROUP, found in the top portion of the script. Other configuration items are also found in the top portion of the script. Set them up to your liking, and hit OK!

Commands
The following commands may be entered as a PB argument:
  • Hover <on/off> - Turns Hover Mode on / off
  • Height <number> - Sets the Hover Height to number
  • Add <number> - Adds number to the current Hover Height
  • Sub <number> - Subtracts number from the current Hover Height
  • Lock <pitch/roll> - Locks the pitch or roll at the current value
  • Unlock <pitch/roll> - Unlocks the pitch or roll
  • Mode - Switches between aligning to Gravity or Terrain
  • Speed <number> - Sets the Speed Limit to number
    • Only used in Cruise or Speed Limit mode
  • Speed <up/down> <number> - Adds or Subtracts number from the current Speed Limit
  • Cruise <on/off> - Turns Cruise Control mode on / off
    • Also disengaged by tapping a movement key (WASDC or Space)
  • Limit <on/off> - Turns Speed Limit mode on / off

    Docking commands
  • Set Dock - saves the current grid position and orientation for use with docking
  • Dock - auto navigates to the saved dock position, aligns with the saved orientation, then lands. If no dock position saved, switches to Land
  • Land - slowly lowers the grid to the ground. If connectors found, will attempt to lock them as it descends
  • TakeOff - disconnects any connectors and resumes normal hover. Can be used to cancel docking / landing commands

Things to Know
  • Because the script uses raycasts to create the ground plane, it will also detect man-made obstacles such as roads and other grids, and will hover above them accordingly.
  • This script utilizes the thrusters available to attempt to maintain a given altitude. Ships at speed cannot stop on a dime or change direction immediately. Allow yourself enough time to slow down before tackling a hill.
  • The more thrusters facing down the better!
  • The greater the distance between the cameras, the smoother the ride will be.
  • It is best to place the cameras at the very front and very back of the ship, so it can detect hills faster in an effort to avoid hitting them. Placing cameras at the left and right corners of the front of the ship will ensure that hills are detected most efficiently.
  • The calculated Actual Height uses the average position of the three cameras. If you depress the cameras up into the hull, it is possible that the bottom of the ship may strike the ground if you hover too low. Keep the cameras as close to the absolute bottom of the hull as possible, or account for their location in your height setting
  • If you're having issues after pasting in a grid (speed limit not working, for instance), try deleting and remaking the block group. Sometimes they get bugged out on paste

Known Issues
None that I know of, but there may still be bugs. Let me know, and I'll squash them asap :)

Updates
21 April
  • Added HEIGHT_DIFF_TOLERANCE setting to script config
Popular Discussions View All (1)
3
9 Aug, 2021 @ 9:20am
Suggestions/ ideas
CTH2004
236 Comments
Mac and Cheese 8 Jul @ 4:20pm 
does this work in space, like a way to hover around an astroid on a space bike?
Warlocc 1 Jul @ 4:51pm 
Seems like it only works once per playthrough, then never turns back on. Just sits at "setup complete".
jTurp  [author] 20 May @ 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 28 Apr @ 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] 15 Apr @ 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 12 Apr @ 6:44pm 
Two simple questions can it be used in ships and could it possibly work with whips subgrid thruster manager?
Into 29 Mar @ 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] 11 Jul, 2023 @ 10:57am 
This fell through the cracks. I’ll check this weekend when I get back home
Jem 11 Jul, 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] 23 Apr, 2023 @ 11:57am 
I'll run a test and see. Was working last time I messed with commands, but who knows..