Space Engineers

Space Engineers

87 ratings
MGSS Airlock Script 2.0
4
2
2
2
   
Award
Favorite
Favorited
Unfavorite
File Size
Posted
Updated
490.016 KB
16 Sep, 2018 @ 3:52pm
20 Mar, 2022 @ 3:59pm
32 Change Notes ( view )

Subscribe to download
MGSS Airlock Script 2.0

Description
Update 2.0
You can finally connect grids to your airlock conveyors and not overfill your tanks! Just name the tank you want to connect to your main system as [AIRLOCK] (not [AIRLOCK A] for example) for it to be treated as a main tank. It will then turn off the generators and farms (even those on connected grids) temporarily while the airlock cycles. No longer need to worry about naming the generators.

LCD panels are also updated to a sprite based design rather than text based. The customization section has been updated so you can make the light and LCD colors your own. Rotating lights have also been added to show when the airlock is cycling. Lastly, the inner doors will auto-close (this addresses a Keen bug with airtightness); the outer doors will remain open when depressurized, so no risk of cutting your ship in half leaving the hangar.

Summary
MGSS Airlock Script is a zero air loss control system for multiple airlocks with some extra bonuses like being able to hook up tanks to the main system with generators and farms, LCD panels and lights for airlock status, and the ability to use in partial and full atmosphere conditions (perfect for taking off from and landing on planets) .

Script uses logic, not timers, to ensure no air is lost. Example: doors must be closed before turning the air vent on. This means it works with all door types including slow hangar doors and mods. It also means the airlock space can be as large as you want with multiple vents and doors.

Setup
See YouTube video for setup of the airlock with naming
1. Each component needs to know what airlock it belongs to. This is done through the naming. Add [AIRLOCK xx] to each components name, with 'xx' being the unique name for the airlock.
Example: [AIRLOCK A]
2. Each airlock needs 1 (and only 1) control light. Add the word Control to a light along with the airlock tag [AIRLOCK xx].
Example: Control Light [AIRLOCK A]
3. Name Inner door(s), Outer door(s), and Airlock vent(s)
Example: Inner Door [AIRLOCK A], Outer Gate [AIRLOCK A], Airlock Vent [AIRLOCK A]

That's all you need for basic operation.*If using in atmosphere, you will need an Outer air vent on the exterior of the ship/base. Otherwise the airlock will try to depressurize to 0 and may glitch out.

How to Control
Turn on/off the Control Light; on the airlock pressurizes, off it depressurizes. Easy to setup on button panels or sensors.

Optional Components (w/ naming)
Inner Vent [AIRLOCK XX] or Inner Vent [AIRLOCK]: Airlock specific or main interior vent. Can detect if there is a leak and unlock the airlock doors to allow repair. Main means it can be used by all airlocks.
Outer Vent [AIRLOCK XX] or Outer Vent [AIRLOCK]: Airlock specific or main exterior vent to detect outside air pressure. Critical for atmospheric ships/stations.
Light [AIRLOCK XX]: Status lights that change based on the state of the airlock. White = pressurized, blinking orange = cycling, blue = depressurized, red = error or lockdown. Can be changed in the START OF CUSTOMIZATION inside the script.
Rotating Light [AIRLOCK XX]: Turns on orange light when cycling; off when depressurized or pressurized.
Sound Block [AIRLOCK XX]: Turns on sound block to Alert 2 (default) while airlock is cycling.
LCD [AIRLOCK XX]: If corner style LCD, it will show a colored status of the airlock, see GIF. If a larger panel, it will display a more detailed breakdown of the airlock status along with warnings.
LCD [AIRLOCK]: Note no 'XX' airlock name. Acts as a main screen showing details for every airlock, auto scrolls for large systems with more than 6 airlocks.
O2 Tank [AIRLOCK XX]: Tank separate from main system, auto fills using vents if empty.
O2 Tank [AIRLOCK]: Main tank tied to the system, auto fills from generator or O2 farm if empty
Lockdown Light [AIRLOCK]: When on airlock doors lock and depressurize. Note this is not airlock specific, only has [AIRLOCK] without a 'xx'. Only need 1 for all airlocks.
O2/H2 Generator and O2 Farm:No naming required. If there is a main tank, the generators and farms will temporarily shut off during airlock cycle to not overfill tank. Option in script to turn this feature off.

Group Naming
Naming a group with the airlock tag will rename all parts in the group. Lights [AIRLOCK A] will rename the parts to Light 01 [AIRLOCK A], Light 02 [AIRLOCK A],... Since the blocks are renamed you can delete the group after if you want. Helps keep the terminal list clean as you can hide blocks but not groups.

Customization
Look for START OF CUSTOMIZATION inside the script.
  1. Door close delay
  2. Minimum tank fill
  3. Screen cycle delay for main screen (if more than 6 airlocks)
  4. LCD text/forground and background colors
  5. Fill bars (red, orange, green) colors
  6. Status light color schemes for pressurized, depressurized, cycling, error, and lockdown
  7. Naming tags and keywords
  8. Automatic control of generators and farms
Popular Discussions View All (6)
2
7 Jun @ 4:38am
Output info to blocks with LCDs?
LumpySpaceKing
2
31 Aug, 2021 @ 4:19pm
Can multiple Airlocks work together?
Asarjan [GER]
1
31 Aug, 2021 @ 2:48pm
Rotation lights on when outer doors/ gates are open
Asarjan [GER]
138 Comments
Roccanan 31 Mar @ 2:18pm 
Firstly, I would really love this script, IF, if it would find my properly named Airlock Vet [AIRLOCK A]. No matter the naming convention, that Airlock Vent is never found.
DuckyToDucker 8 Oct, 2023 @ 8:34pm 
I have been having an issue where the script just quits working. I have 3 airlocks on a ship. They all have hangar doors. I use the rotating door for all other personnel entrances. Normally logging out and back in fixes it, but I cannot get it to work any more. I was working on the ship, so I thought maybe it was something I did, but all 3 broke at the same time and are fully separated from each other. I have double checked all the naming conventions and get no error from the programming block. I tried removing the script from the programmable block and then loading fresh from the script list, but no joy. Any thoughts?
DuckyToDucker 4 Oct, 2023 @ 6:37am 
Is there a way to show a sprite based pressure for the next room? I know how to add the corner LCD to show the airlock status, but I am looking for something that will allow me to show the pressure in the next room connected to my hangar. Great script BTW.
RandomVintage 2 Oct, 2023 @ 6:56am 
Have been really enjoying this script on my latest play-through of SE, and I would like to make a feature request. If possible it'd be great if support could be added for LCDs inside non "LCD" blocks such as cockpits and programmable blocks etc. I took a look over the code, and the API documentation for SE scripts, and I got about as far as getting the Echo running on the "keyboard" LCD of the programmable block, with hopes of maybe getting the "main LCD" of the script to display on the large LCD of the programmable block, but my C# is extremely rusty, and this is the first time I've poked at SE scripting at all. I'm going to keep poking at it in my own time, but I figured it couldn't hurt to ask somebody that knows better than I do before bashing my head into it for a week.
Engineered Coffee  [author] 31 Jul, 2023 @ 7:22am 
I noticed that in my last play through too. I am not sure what changed. I will look into it when I find some time.
CovertJaguar 31 Jul, 2023 @ 2:32am 
Has a tendency to shut off my 02 Gens and then never turn them back on again. I keep thinking I'm out of ice, but no, the generators are just off again.
Pringels09 9 May, 2023 @ 8:11am 
This is awesome, but is there a way to show make the Sci-Fi Button terminal show the airlock status? If not, then this would be an awesome feature
DuckyToDucker 28 Jan, 2023 @ 8:54pm 
I think you just need to not fill the O2 tank so you can manually depressurize the interior back into the tank. I might be very wrong though :)
Delois 28 Jan, 2023 @ 7:01pm 
I would love a 'Maintenance Mode' Control light that empties all air so I can work on the interior without loosing air. (Unless this is there and I missed it)
DuckyToDucker 28 Jan, 2023 @ 3:06pm 
I am sorry if I missed it somewhere, but is there a way to update the display on the Sci-Fi one button terminals? It has a pretty large screen. I was hoping to have that button trigger the airlock and provide a display of the status. Thank you and great work on this amazing script.