Space Engineers

Space Engineers

Not enough ratings
Automatic Airlock Script [Updated]
   
Award
Favorite
Favorited
Unfavorite
File Size
Posted
Updated
66.534 KB
Jan 18, 2020 @ 10:05am
Jan 18, 2020 @ 12:10pm
2 Change Notes ( view )

Subscribe to download
Automatic Airlock Script [Updated]

Description
This is just a fix for Syntak's Automatic Airlock Script.
This changes several lines of code for the new API for text surfaces, so no more code errors.
Everything else in this script is the work of Syntak.

A fully automatic air lock script. Airlock will pressurise/de-pressurise and automatically open the correct doors to let you in/out, doors remain locked while the airlock is working so you can't accidentally vent the whole ship. Supports status lights and/or LCD's for both sides of the air locks. Status lights/LCD's work even without the sensors, if you just want the displays for a manual air-lock.

See Automatic Airlock Script by Syntak below for full description and details on setup/usage.

***************************************************************************
Example world: http://steamcommunity.com/sharedfiles/filedetails/?id=865605993
(includes a couple of alternative set-ups)


SETUP
Air Vents
Tag one (or more) air vents for the air lock [AL1V], and one inside the ship [AL1I].
Additionally, if the outer side of the air lock opens into an area that can be pressurised (eg. a hangar), or if you want the airlock to work on planets with atmosphere, you'll need to tag a vent in this outer area too [AL1O].
Note from Spyyre: In my experience, the airlock script only works on a planet with atmosphere if you build a room on the outside of the airlock with a vent tagged [AL1O] that is set to always depressurize. You must also tag the outer airlock door and the exit door (to outside) as [AL1O].

Doors
Tag an inner door [AL1I], and an outer door [AL1O]. (hangar doors work too).

Automatic Airlock
Add a sensor for each door, the sensor field should cover an area each side of the door, entering the sensor zone will open the corresponding door, cycling the airlock as necessary.

If the airlock room is large or takes a long time to traverse (eg. a hangar, a long hallway), you can add an optional intra-lock sensor [AL1S], this sensor zone should cover the entire air lock room. This way the room will pressurise as you traverse the room, rather than waiting until you reach the exit to start pressurising.

Manual Airlock
If you'd rather tactile satisfaction of operating the airlock with the push of a button, simply forgo the sensors and add a button to toggle de-pressurise on the airlock air vent. Tagged doors will open and close automatically as required.

Oxygen Tanks
If an oxygen tank is tagged the script will allow doors to be operated manually when the tank is completely full or empty. There are no safeguards in this mode, so you are able open both doors and vent the ship's oxygen.

Sound
Sound blocks can be tagged, change the sound played by editing the code, look for "Alarm 1", "Alarm 2", (about line 45), replace with the name of the sound you want (as it appears in the sound block menu, case sensitive). Sound now works with arcade sound, and realistic mode!

LCD Displays
Tag status lights and/or LCD's to show the air-lock status, corner LCD's are ideal but regular LCD panels works too, wide LCD's not so much. The color indicates the pressure differential, the progress bar indicates the oxygen level inside the airlock.

Colors:
Green - pressure equalised, ok to open door
Yellow - not equalised, moderate pressure difference
Red - not equalised, high pressure difference
Colors are customisable.

Smooth color fade mode:


Custom LCD text
You can use use [title] your text here [/title] in the custom data of an LCD to display custom text on the LCD screens



Named Airlocks and airlock options
Add "name = your name here" to the custom data of the air vent tagged AL1V (the vent in the airlock) to set the name of the airlock. This name will show on the LCDs and the Status screen.



Status LCD
Shows the status of all airlocks.


Tags

Required
Block
Tag
Air Lock Vents
AL1V
Inside Vent
AL1I

Optional
Block
Tag
Inner Doors, Inner Sensors, Inner Vent, Inner Status Lights, Inner Status LCD
AL1I
Outer Doors, Outer Sensors, Outer Vent, Outer Status Lights, Outer Status LCD
AL1O
Intra-Lock Sensor
AL1S
Oxygen Tank
AL1T
Sound Block
AL1S
Status LCD
ALSTAT

Use AL2XXX, AL3XXX etc. for multiple air locks.
Tags can go in the block name, or the custom data.
To tag a group the group name must be the tag and nothing else.

Set-up
To get the script to run:
Load the script into a Programmable Block, timer no longer required.


Arguments
DISABLE
disables all air locks, doors are set to On/unlocked, the state of the air-lock vents is configurable (default off).

ENABLE
returns all air-locks to normal operation.

VENT
Opens all air lock doors, use "ENABLE" to return to normal function.

SCAN
Re-scans for tagged blocks now.
(be default the script automatically scans every 10 seconds)
Popular Discussions View All (1)
0
Feb 1, 2020 @ 2:56am
Air vent slows then locks up during decompression cycle.
KnightReaver
27 Comments
BCslave1 Oct 20, 2024 @ 5:55pm 
That I am did tried make Connet for Vent with LCD no show fill. I not need that Door. I am make time Block for Door Airlock. I need find LCD with Vent Fill. I cant find easy. No Mod Bars
Davetiger Apr 23, 2023 @ 12:12pm 
There is the normal issue if you don't separate the oxygen tank and not allow them to fill from o2 gens on your ship they won't open the outter door because the room can't be depressurized that's normal always make a tank not connected to the rest of ship for air locks and I find putting a O2 gen on top of it with event on/off for 50% so that it won't over fill the tank is a good way to go
Davetiger Apr 23, 2023 @ 12:10pm 
Seems to be working for me?
DrNukeLear Apr 15, 2023 @ 5:08am 
I think the latest update has broke the airlocks locking.
Spyyre  [author] Jan 22, 2023 @ 7:44pm 
I'd also like to note that no matter what, you shouldn't run into the below issue on planets like the moon or in space. This problem only exists on planets with atmosphere or in a scenario where your airlock leads to a pressurized hangar.
Spyyre  [author] Jan 22, 2023 @ 7:43pm 
Also for those of you saying that the doors are stuck quickly opening/closing during the depressurization process - this is because you are building the airlock in a pressurized environment. Like on a planet, for example - once you depressurize the airlock, now the inside of the ship, and outside of the base are still pressurized. The airlock script knows it *can* open the door because the airlock is depressurized, however, when the outer door opens, oxygen slips inside, and the vent begins trying to depressurize again, the script closes the door because the room is no longer depressurized, and that just continues endlessly. TO FIX THIS PROBLEM:
A) Build another room on the "outside" of the airlock, with another vent [AL1O] set to ALWAYS depressurize
B) Dont build an airlock at all on a planet with atmosphere - dont need to keep the base pressurized if theres plenty of free oxygen around anyways.
WildLynx Jan 20, 2023 @ 4:53pm 
Thank you!
Spyyre  [author] Jan 20, 2023 @ 1:58pm 
I managed to use waybackmachine and get an archive of the page. I'll update the mod page with the original info. If you don't see it updated yet: https://web.archive.org/web/20201112035414/https://steamcommunity.com/sharedfiles/filedetails/?id=863852250
Spyyre  [author] Jan 20, 2023 @ 1:36pm 
This does still exist, however. It could be of help. If it's usable on the current game version, anyways:
https://steamcommunity.com/sharedfiles/filedetails/?id=865605993
Spyyre  [author] Jan 20, 2023 @ 1:28pm 
Honestly there are probably much better airlock scripts out there. Unfortunately, like Lumpy mentioned below, it looks like Syntax took down the original mod page. That was the only place where he had all of the usage information on the script available. I uploaded this over 2 years ago and have since stopped playing the game and unfortunately I don't really remember how this script works, otherwise I would be glad to post the usage info here as well. Honestly, all that I did was fix some missing/incorrect pointers in the code when the API for vanilla objects got changed. Again, that was years ago now and the game has been updated a lot since then so I can't say for certain that more vanilla changes haven't changed this script's behavior anyways.