Quick Nav


Back To Top

Description

This script allows automatic hangar systems where the main doors will open automatically when something is waiting to enter or exit, without any risk of air loss. It will handle this automatically, by manipulating doors and pumping air in or out of the hangar as necessary, before allowing the hangar doors to open.

To use it, simply plop a sensor near the hangar door, set its ranges, and name it appropriately - see the configuration settings for details - and the script will monitor it to control the various blocks as necessary.

Additionally, it can also control appropriately-named lights to illuminate the hangar in various colors to show whether the door is pressurized and unsafe to open, about to open, or is in the process of opening or already open.

It will also render hangar air level to an appropriate screen if one exists.

Script Options

The script contains the following configurable variables/functions to adapt the script to your ship configuration or needs:

DISPLAY_TAG

Type: string
Current Default Value:
"Beam"
Any spotlight with this (and a hangar ID) in its name will be color-controlled.

AUX_DISPLAY_TAG

Type: string
Current Default Value:
"Color Lights"
Any lighting block in a group named "<HangarID> - <AUX_DISPLAY_TAG>" will be counted as an auxiliary color-controlled light.

AUX_GROUP_TAG

Type: string
Current Default Value:
"Lights"
Any lighting block in a group named "<HangarID> - <AUX_GROUP_TAG>" will be counted as an auxiliary light for that hangar.

VENT_GROUP_TAG

Type: string
Current Default Value:
"Air Vent"
Any vent with this (and a hangar ID) in its name will be counted as a Hangar supply vent and will be consulted for oxygen levels.

EXTERNAL_VENT_TAG

Type: string
Current Default Value:
"External Air Vent"
Any vent with this in its name will be counted as an external vent and will be consulted for atmospheric oxygen levels.

SENSOR_TAG

Type: string
Current Default Value:
"Door Sensor"
Any sensor with this (and a hangar ID) in its name will be checked for what grids it detects to know when to open the door of the hangar.

RED_THRESHOLD

Type: float
Current Default Value:
10
Spotlights will be red if air level is below this percentage.

GREEN_THRESHOLD

Type: float
Current Default Value:
98
And green if it is above this; they will be yellow if it is in between.

AMBIENT_LIGHT_THRESHOLD

Type: float
Current Default Value:
GREEN_THRESHOLD
Any auxiliary lights in the hangar will be toggled on and off, being on if the oxygen level is above this.

RED_IF_PRESSURIZED

Type: bool
Current Default Value:
true
Enable this to flip red and green, so that instead of an air level indicator, you get a "safe to open the door" indicator.

COLOR_FADE_DURATION

Type: float
Current Default Value:
60
How many update cycles (in 1/60th of a second) should be spent fading between colors.

OPEN_ATMO_THRESHOLD

Type: float
Current Default Value:
80F
If atmospheric O2 is above this percentage, hangars will be left open; set this over 100 to disable that behavior.

allowOpenIfNoO2Space

Type: bool
Current Default Value:
true
Whether to allow the hangar to open when pressurized but there is no space to put the air in tanks.

SCREEN_TAG

Type: string
Current Default Value:
"AirLevel"
Any LCD panel with this (and a hangar ID) in its name will show the air level in its hangar.

HANGAR_GROUPS

Type: string[]
Current Default Value:
{"Hangar"}
Each string in this list is treated as a separate hangar group ('ID').

isConnectedToHangar(string blockName, string id)

Return Type: bool
Current Default Code:
return blockName.Contains(id);
Whether a given vent or internal door is connected to the hangar of a given ID; This is usually "hangar and vent/door are part of the same group", but might be different if for example the hangars are all connected, sharing doors and/or vents.

Source Code

The source code for Automatic Hangar Air and Door Control can be found here:GitHub

Downloads

Via Steam Workshop