Space Engineers

Space Engineers

Not enough ratings
Gravity Level
   
Award
Favorite
Favorited
Unfavorite
Tags: autopilot
File Size
Posted
Updated
379.027 KB
30 Jan, 2022 @ 2:26am
9 Feb, 2022 @ 2:13am
2 Change Notes ( view )

Subscribe to download
Gravity Level

Description
The Gravity Level Script aligns your ship to total gravity affecting it by overriding effective Pitch and Roll. This script only allows for basic use at the moment, though there is the possibility for added features.

Setup Instructions
1. Add this script to a programmable block on your ship.

2. Set the script to run with default arguments via some sort of toolbar trigger,
button, timer block, etc.

3. Have control of the ship and override at least 1 gyroscope (perhaps with a
timer block before the script).

4. Trigger the programmable block.

5. Trigger the programmable block again to stop the script and automatically
turn off gyro override.

Tips and Design
~ I recommend having at least two gyros on the ship that is running this script.
It will work as intended with only one. But, only having a single gyro will only
allow a single degree of control, that being yaw.

~ The overridden gyros will still respond to input not related to pitch or roll.

~ If, for whatever reason you need, you have defined override values for your
gyroscopes this script will save them and redefine them once you turn it off.
You can check the terminal just to be sure.

~ Make sure to override first, then trigger the script.

~ As of now, arguments do nothing. This could change in the future.

~ You may want to reduce the override power of the overridden gyros while the
script is running. It's up to preference, but I normally use around 10% when
using the script outside of testing.

~ This script will recognize overridden gyroscope groups, though handling this
case specifically hasn't been implemented.

~ This script doesn't run until you start it, and needs to be turned off. This is in
the interest of not having a potentially impacting script.

~ Remote Control blocks worked before, but have been specifically tested and
will work just as if your engineer was on the ship.

Known Issues
- Rarely, when your craft has come to a complete stop, you will need to "wiggle"
it to get control of gyros. It seems this is known bug that affects thrusters or gyros.

- When changing the construction of your ship that changes gyros or cockpits,
you must hit the recompile button
in the programmable block's terminal.

- Overriding a gyro while the script is running will not add that new gyro to
level your craft. It will do its own thing and likely get it in the way. Make sure all
desired gyros are overridden before activating the script. The use of a timer block
would simplify this.

- Turning off override without triggering the script again will not stop the script, this
could be a potential change. However, if the script is "deactivated" after turning
off the affected gyros, it will still turn off and be ready for later use. Gyroscope
values may not be reverted properly. This will require testing.


- Related to the last point, leaving the craft will not stop the script.

- Works just as well with Gyro block groups. However, Space Engineers handles
override values in a simpler manner for the group. This script doesn't account for
that, but still works if using groups or not.

- If leaving a gravity well with the script active, the active gyros will be stuck with
their override values the moment the craft fell out. Since there is no gravity, there
is nothing to align to. An auto-stop feature when leaving gravity is in order. Currently,
this causes no errors and the script can be disengaged properly. In this no gravity
state, gravity is recognized as Not A Number rather than 0.

Potential Changes
+ The ability to determine the angle a ship should hold

+ The ability to determine the axis or axes the gyros should override

+ Set a gyroscope power when overriding, this would include saving and resetting
the old power value.

+ Optimize the program. In isolation, it isn't taxing. But, it adds to the load. Perhaps
an auto-stop feature is in order.

+ Potential usability with screens.

+ Add support for builds using only 1 gyroscope.

+ Potentially suggestions given by you all.
1 Comments
High Lord Crypto 19 Apr, 2022 @ 6:49pm 
this is an incredible script, basically can simulate an orbit with this very easily 10/10