Space Engineers

Space Engineers

Not enough ratings
Auto Gravity Generator Controller
   
Award
Favorite
Favorited
Unfavorite
File Size
Posted
375.116 KB
9 Jun, 2023 @ 10:01pm
1 Change Note ( view )

Subscribe to download
Auto Gravity Generator Controller

Description
Overview:

The Auto Gravity Generator Controller is a handy script for Space Engineers that automates the management of your ship's Gravity Generators based on the presence of natural gravity.

The script works by detecting the natural gravity from the first ship controller it finds on your grid. If natural gravity is detected, it automatically turns off all Gravity Generators on the grid. If no natural gravity is detected, it will turn all Gravity Generators back on. Additionally, Gravity Generators prefixed with '!' in their name will not be affected by the script.

Usage:

Setting Up the Script:

Open the Programmable Block interface on your grid.
Paste the script into the code editor.
Click the "Check Code" button.
If no errors are found, click the "Remember & Exit" button.
Configuring the Run Frequency:

Open the Programmable Block interface again.
Click the "Edit" button.
Find the line in the Program method that reads Runtime.UpdateFrequency = UpdateFrequency.Update1;.
Make sure it's set to UpdateFrequency.Update1; to run the script every game tick.
Setting Up the Exclusion Prefix:

If you have any gravity generators that you don't want to be affected by the script, you can exclude them by adding a '!' at the beginning of their name.
For example, rename a generator from "GravityGenerator" to "!GravityGenerator" to exclude it from being controlled by the script.
Please remember to set your Gravity Generators' names correctly for the script to work properly.

Updates:

Keep an eye on this workshop item for updates and improvements to the script. If you have any suggestions or feedback, please leave them in the comments below.

Enjoy and happy engineering!