Space Engineers

Space Engineers

113 arvostelua
JTurp's Hover Script
2
   
Palkinto
Lisää suosikkeihin
Lisätty suosikkeihin
Poista suosikeista
Tunnisteet: other_script, autopilot
Tiedostokoko
Julkaistu
Päivitetty
617.454 KB
21.11.2019 klo 13.19
21.4.2023 klo 19.32
13 muutosilmoitusta ( näytä )

Tilaa ladataksesi
JTurp's Hover Script

Kuvaus
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
Suositut keskustelut Näytä kaikki (1)
3
9.8.2021 klo 9.20
Suggestions/ ideas
CTH2004
244 kommenttia
Warlocc 15.5. klo 11.25 
Can confirm, "Land" goes to 25 meters, no matter what the height is actually set to.
Pablo Diablo 4.2. klo 11.56 
Amazing. Thank you!
jTurp  [tekijä] 3.2. klo 15.46 
Yep, I do see it thinks it's landed but not actually. I'll see about a fix in the near term
jTurp  [tekijä] 3.2. klo 15.14 
@Pablo Diablo

I'll run a test, thanks

@Stellar forester

Not likely the way it is written
Pablo Diablo 14.1. klo 17.15 
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 24.11.2024 klo 6.24 
is there a possibility to use this script with Vector OS https://gtm.steamproxy.vip/sharedfiles/filedetails/?id=2831096030
jTurp  [tekijä] 22.11.2024 klo 19.17 
@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 22.11.2024 klo 17.48 
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 8.7.2024 klo 16.20 
does this work in space, like a way to hover around an astroid on a space bike?
Warlocc 1.7.2024 klo 16.51 
Seems like it only works once per playthrough, then never turns back on. Just sits at "setup complete".