Quick Nav


Back To Top

Description

This script will automatically handle the (de)pressurization of the various rooms (defined as sections which can be isolated from each other and from the exterior by the actuation of doorways) in your ship. Simply make sure each section has at least one air vent, named after that section, and name the doors separating sections appropriately. See the configuration settings for naming details.

From there, the script will automatically, work to keep pressurized sections accessible from one another and to seal off any which have been breached by collisions or weapons, by managing door states and raising applicable warning alarms (light and/or sound) as appropriate.

There is also the ability to have it display a shipwide graphical overview (like shown above) of all sections on applicable LCD panels, with air level indicators as well as "depressurized" or "breached" statuses.

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:
"O2Status"
Any LCD panel with this in its name is overridden to show the pressurization/breach status.

VENT_ID

Type: string
Current Default Value:
"Air Vent"

LIGHT_ID

Type: string
Current Default Value:
"O2 Light"

SOUND_ID

Type: string
Current Default Value:
"O2 Alarm"
Any vents/lights/etc containing this in their name are assumed to be involved in monitoring O2 status or part of an alarm system, and are activated accordingly. Section names are parsed by removing this string from their name (and trimming any leading or trailing " ", ":" or "-" characters, and any trailing numbers); whatever remains is considered the section the block is in/acts for. So "Cockpit Air Vent", "O2 Light - Reactor 7" and "O2 Alarm: Hangar A" become "Cockpit", "Reactor", and "Hangar A" respectively.

EXTERNAL_BLOCK_ID

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

INTERFACE_DOOR_SECTION_PATTERN

Type: string
Current Default Value:
@"\[(.*?)\]"
Hope you like Regex if you want to change this...

INTERFACE_DOOR_SECTION_SPLIT

Type: char
Current Default Value:
'|'
The separator char between section 1 and section 2 in the door name; under default settings, an ID looks like [Sec1|Sec2] to indicate that the door separates sections Sec1 and Sec2, and closing it (and any other doors with the same pair of tags) will isolate the two from each other, in case only one is breached.

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 and in which lockdowns apply.

CLOSE_ALL_DOORS

Type: bool
Current Default Value:
false
Whether to close (and keep closed) all doors in the ship whenever a breach is detected.

SEPARATE_BREACHES

Type: bool
Current Default Value:
true
Whether to close doors between two breached sections; not recommended to disable this.

SCREEN_UPDATE_RATE

Type: int
Current Default Value:
5
How fast to update displays; larger is less often. More rapid updates mean more lag, especially if you have lots (15+) of screens. Default is about 1.5 times per second.

isExternalDoor(string name)

Return Type: bool
Current Default Code:
return name.Contains(EXTERNAL_BLOCK_ID) || ((name.Contains("Hangar") || name.Contains("Airlock")) && name.Contains("Outer"));
isExternalDoor.

Source Code

The source code for Pressurization Control And Display can be found here:GitHub

Downloads

Via Steam Workshop