Quick Nav


Back To Top

Description

This script manages the doors, vents, and (if any) status lights in airlocks, as well as providing an overview of all airlock statuses on the grid.

Details

The primary functionality is the control of both sets of doors, preventing any possibility of accidentally venting the main atmosphere by opening both sets of doors (unless breathable external atmosphere is present, in which case all doors are held open). The script will also manage the air vent(s) to avoid losses to space, and will update lights in the airlock to use color and flash to indicate airlock status and alert conditions. Red airlocks are those which have one set of doors open, disallowing the other to be opened; yellow through green indicate airlocks that can be opened, with the mix between the two indicating how much air will be lost if opened to space (green if none). Flashing red airlocks indicate that they have been breached in some way.


Script Options

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

VENT_ID

Type: string
Current Default Value:
"Air Vent"
The name of air vents to look for.

AIRLOCK_SCREEN_ID

Type: string
Current Default Value:
"AirlockScreen"
Anything whose name contains this is used for overall display of airlock states.

EXTERNAL_BLOCK_ID

Type: string
Current Default Value:
"External"
Anything whose name contains this is assumed to be exposed to the ship/station exterior.

AIRLOCK_BLOCK_ID

Type: string
Current Default Value:
"Airlock"
Anything whose name contains this is assumed to be part of an airlock.

MAX_ATMOSPHERE

Type: float
Current Default Value:
0.5F
The value (out of 1) below which atmospheric pressure is low enough to be considerered space/unbreathable.

allowOpenIfNoO2Space

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

isOuterAirlockDoor(string name)

Return Type: bool
Current Default Code:
return name.Contains(EXTERNAL_BLOCK_ID) || name.Contains("Outer") || name.Contains("Exterior");
Whether a door is part of the outer half of an airlock.

isInnerAirlockDoor(string name)

Return Type: bool
Current Default Code:
return name.Contains("Inner") || name.Contains("Interior");
Whether a door is part of the inner half of an airlock.

Source Code

The source code for Airlock Protection And Indicators can be found here:GitHub

Downloads

Via Steam Workshop