Space Engineers

Space Engineers

178 ratings
Hover Aligner
   
Award
Favorite
Favorited
Unfavorite
File Size
Posted
Updated
94.123 KB
Dec 24, 2015 @ 8:33pm
Apr 14, 2019 @ 7:39pm
23 Change Notes ( view )

Subscribe to download
Hover Aligner

In 1 collection by p3st|cIdE
Scripts
13 items
Description
Like Gravity Aligner, keeps a ship aligned within angular tolerance of the gravity vector, keeps it from flipping over, using gyros. This one can also lock the altitude using available thrusters, relative to sea level or the terrain.

To set it up, you'll need:

A programmable block, with this script inside.
A remote control or cockpit.
some gyros. probably not all of them.
some thrusters, mostly aiming down.
an optional text panel, for diagnostic information.
include all those blocks in a terminal group called Aligner.
now Run the programmable block with argument "go" and watch the ship align itself. By default it's in angular gyro aligning mode only.

Run'ning with blank argument just updates the state, ticks the script. There are some command line arguments you can use to control the script, I usually set these into a toolbar shortcut:

go - starts aligning, starts up the script
lock - locks present altitude relative to sea level and attempts to maintain it
lockh - locks present altitude relative to terrain (NOT bases/ships!) and attempts to maintain it
unlock - stops locking altitude and just aligns gyros
stop - shuts off the script gracefully

advanced use:
load - reloads changes you've made to settings in PB CustomData
save - stores settings in PB CustomData, in case you're about to recompile the script
reset - old command, same as stop now

There are many settings that may be customized in the CustomData. Use 'load' command to reload settings, or they may be set by command individually. Really the save command is rarely useful since all command line parameter changes are saved back into CustomData immediately automatically.

parameters: (see CustomData string in programmable block)
pitchofs=<degrees> - adds some extra rotation to the ship alignment, for VTOL/rockets
targetaltitude=<meters> - sets lock height but does not change lock state
thrustvellimit=<speed> - sets max speed limit in m/s
maxdownwardvelocity=<speed> - limits descent rate in m/s
tiltpower=<factor> - how strongly terrain slope affects pitch

Text panels may select one of various charts to view by putting string into Title. Try 'height', 'altlock', 'altitude', 'elev', 'gravity', 'tcap', 'tovr', 'steer', 'turn', 'slope', 'log', 'logo', 'time'; 'angle', 'long', 'lati', 'planet', there are many. I should make a full list!

It can effectively replace the vertical inertial dampeners on a ship, but it's not tuned to lock in smoothly, it's tuned to cut off and let the main ship controls function including standard inertial dampeners, so it will give a bit of a bumpy ride if you turn dampeners off. The thrustposslop zone can be made smaller. If you want to stop, you should line the ship up well with gravity.

If you want to run it on MP servers, I recommend lowering the updatefrequency!! Ask your friendly local server admin if this script is right for you.

See H2Hover for an example ship.

I didn't put a limit on the altitude, and people have managed to do interesting things with it! Thanks guys!

TROUBLESHOOTING

Ownership is a big issue with this script. The easiest way to ensure it will work is set ownership of all blocks to "Nobody".

Try with an LCD in the group first, you can remove when it works.

Old versions of the script used a timer block. The timer block is no longer needed and can cause problems if it was set up improperly. Just turn it off and take it out of the group or delete it.

If it doesn't seem to be doing anything, did you give it the new "go" command? Check the programmable block to see if it threw an exception.. if so the script must be Recompiled before it can work again.

if it won't let you steer, try increasing pitchangleclipdegrees and/or pitchangleslopdegrees slightly.

If it won't follow the terrain, did you give it the "lockh" command? Are there thrusters in the group? Enough thrusters? Is tiltpower set > 0? If slope following causes problems, it can be disabled by TiltPower=0

If you see "CLR Detected Invalid Program" you should update your .NET to 4.6 or higher.
Popular Discussions View All (2)
1
Mar 12 @ 5:01pm
Mouse steer wont work.
Firefoxa
2
Sep 27, 2023 @ 5:34am
Need help
Into
851 Comments
p3st|cIdE  [author] Mar 12 @ 4:55pm 
@SpringFoxy01 ah yes, Keen didn't want to support In-game scripts when they shipped, or on their public servers.
Your problem now sounds like a block ownership issue. Try owning everything.
SpringFoxy01 Mar 12 @ 12:43am 
And now I got the Problem of the script stating that there are no Gyros, thruster and LCD displays in the Group, but I tripple checked everything and there's defenetly a group called Aligner and it has Gyros, a remote control, trusters and even an LCD Display
SpringFoxy01 Mar 12 @ 12:10am 
Found it. Turns out I had to activate custom scripts in the advanced options
p3st|cIdE  [author] Mar 11 @ 4:55pm 
@SpringFoxy01 idk what you mean... try constructing a Programmable Block, in terminal select it and click its "Edit..." button. From the script editor, click "Browse..." iirc. If you subscribed to the script, it should be in that list.
SpringFoxy01 Mar 11 @ 7:47am 
Where can I find the script?
p3st|cIdE  [author] Jun 27, 2024 @ 1:04pm 
sorry I said 'light', I meant "textpanel', they work similarly in the script, lights get the chart's bg color
p3st|cIdE  [author] Jun 27, 2024 @ 1:02pm 
if you have multiple charts, these days it gets wonky for some reason. Try one at a time.

the general idea is your LCD must be in the Aligner group, and include the chart name or short name in the light's Title property iirc. You'd pretty much need to scan the script for Chart names for a complete list, but many are listed above. Try text mode, debug font, though it should set that up for you automatically..
Deathpaw Jun 27, 2024 @ 5:16am 
Hi, thank you for the lovely script. I am having trouble getting my transparent LCD to show any data. Could you maybe advise?
p3st|cIdE  [author] Apr 22, 2024 @ 9:06am 
it should be possible to splice code between the two scripts, mostly.
p3st|cIdE  [author] Apr 22, 2024 @ 9:05am 
it could, in theory, but there's no code for that in this script. Full Control script has it. Maybe try that.