Space Engineers

Space Engineers

Not enough ratings
OPERATOR - Another Space Engineers Automation Script
   
Award
Favorite
Favorited
Unfavorite
File Size
Posted
467.123 KB
7 Jan, 2021 @ 3:08am
1 Change Note ( view )

Subscribe to download
OPERATOR - Another Space Engineers Automation Script

Description
OPERATOR combines a bunch of useful features, like displaying information around resources (hydrogen, oxygen, batteries, etc), your ships status, etc.
It also adds automations like self-closing/locking airlocks and hangar doors.
For detailed information about usage and features, check out the GitLab repository[gitlab.com]
All the scripts functionality is controlled via the CustomData properties.

Script settings
The script settings are defined in the programmable blocks CustomData.
The format is KEY:VALUE (one per line) where KEY is one of the following values:

  • mode: Determines the mode the script runs in. Possible values are Main, Miner, Fighter. Defaults to Main.
  • speed: Sets the ships intended max speed. Currently only used to display a speed bar on environment displays. Defaults to 100.
  • airlock_delay: Sets the number of ticks a doors in an airlock stays open. Defaults to 20. (Must be multiple of 10; 1 second = 60 ticks)

Updating the script
The script only searches blocks and processes custom data on startup to safe on ressources.
After changing the base, adding lcds or changing custom data, run init or recompile the script.

Display information on LCDs
On any LCD, you can display any of the listed information by adding display:TYPE to the displays custom data, where TYPE can be any of the following values:

  • hydrogen: Displays max. total capacity, available capacity, current fill, stockpile warnings, etc.
  • oxygen: Same info as hydrogen, just for oxygen
  • energy: Summarizes energy production. Will show current output percentage of batteries, solar, reactors and other. Also shows warning for low uranium levels.
  • batteries: Displays detailed information for batteries like current charge level, max capacity, current in/output, mode warnings, etc.
  • solar: Displays detailed information like current output, max possible output (depending on the sun angle) and max total output
  • reactor: Displays detailed information for reactors like current and max reactor output and uranium info.
  • environment: Displays natural gravity, outside air pressure, ship speed and - if within planets gravity - surface and sea level elevation.
  • autopilot: Displays the autopilots status. See Autopilot for details.
  • thrust: Displays current thrust in relation to max effective and max thrust
  • thrustweight: Display thrust in Newtons for each direction. When within gravity shows thrust to weight ratio for each direction. Useful for building ships.
  • rooms: Lists all detected rooms and their oxygen levels (if vents are )
  • airlocks: Lists all airlocks with no additional information atm. See Airlocks for details.
  • hangars: Lists all defined hangars, their status (open, opening, closing, closed) and the current oxygen level. See Hangar for details.
  • inventory: Lists inventory fill level, volume and mass.
  • ores: Lists amount of ores in ship inventory
  • ingots: Lists amount of ingots in ship inventory
  • connectors: Lists all connectors and whether there is a vehicle connected. Prints the name of the connected grid.
  • settings: Displays a list of settings and stored data. Useful for debugging mainly. The executing programmable block will display this information per default.

On cockpit LCDs use display#:TYPE where # is the index of the display (starting with 0).
To update displays onlys you can run the script with argument init displays. This is neccessary whenever you add a new display or change the type of an existing display.
All displays will be automatically set to the monospace font and necessary font size.
This script will not adapt to manually set font sizes.

Airlocks
On any sliding door add airlock:NAME where NAME can be any string. Doors will be grouped by this name to an airlock. When one of the doors in an airlock is open, the other doors are deactivated until the opened door is closed again. It will also automatically close any door after a defined delay (See airlock_delay in Script settings).

Additional parameters:
room:ROOM_NAME: Defines the room the door leads to. If set, the script only blocks doors to unsafe rooms. This is handy, because it reduces waiting time in airlocks.
Doors without the room parameter are treated like they face outside and will therefore be locked according to the outside pressure (see Air Vents).

Note: Room names must correspond with Air Vents. If the given room has no air vent, the script assumes 0 air pressure and blocks the door.

Air Vents
On any air vent, add room:ROOM_NAME, where ROOM_NAME is any string, to add the air vent to a room.
Having air vents associated with rooms is neccessary for things like displaying the air pressure in rooms, automatically pressurize and depressurize hangars and the airlocks working more smoothly.

Add one outside air vent with the property vent:environment and no room property to get additional support for airlocks and hangars.

Lights
On any light add room:ROOM_NAME to associate the light to the given room.
This allows to toggle on/off all lights in a room:

Toggling Lights
You can control lights by running the programmable block with the following commands:
  • lights on ROOM_NAME
  • lights off ROOM_NAME
  • lights toggle ROOM_NAME

Hangar
You can set up automated hangars (depressurizing before opening, repressurizing after, warning lights, etc). To do this, add hangar:ROOM_NAME to all hangar doors.
For the automated depressurizing to work, you will also need at least one vent in this room (see [Air Vents](#air-vents) for details how to set them up).

Warning lights
It is possible to add hangar:ROOM_NAME to any lights (recommended lights are the rotary ones). These will be used as warning lights (do not put room:ROOM_NAME on them).
They will be toggled on while opening and closing, and off when the hangar is open or closed. Set Color, blink rate, etc manually.

Status LCDs
It is also possible to add status LCDs (currently only corner LCDs are really supported) by adding hangar:ROOM_NAME (Make sure they DO NOT have an display property as well).
If set up, they will switch between a green "Hangar pressurized", a red "Hangar depressurized" or a yellow/orange "Hangar pressurizing/depressurizing", depending on the status.

Opening/Closing the Hangar
Opening and closing the hangar can be triggered via the programmable block with the following arguments:
hangar open ROOM_NAME or hangar close ROOM_NAME

Bugs, Suggestions, Questions and Disclaimer
I will likely continue to work on the script for a while, but I won't guarantee any active development or support. The script is provided as is.
That being said, I do have the sript in a public GitLab repository[gitlab.com], so feel free to open issues for bugs, feature ideas, questions or if you happen to be a developer yourself, drop a merge request with improvements or new features there.

The script is released under the GNU General Public License v3.0[choosealicense.com].
1 Comments
pro100tv 8 Jan, 2021 @ 3:28pm 
Great script! Good job!