Space Engineers

Space Engineers

99 ratings
MGSS Airlock Script 2.0
5
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, 2024 @ 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]
156 Comments
Elafis 21 Jul @ 2:45pm 
I have a isse with airlock. For every steps I need click on recompilate. Do you know where is a issue? Thank you
Engineered Coffee  [author] 22 May @ 8:11am 
I wish that were possible. Exterior vents just stop working, except depressurize to bring air in.
GalvazimGX 22 May @ 8:07am 
@ MrMallenby You need an outer vent to dump excess oxygen
MrMallenby 26 Feb @ 4:38am 
How do i purge the tanks? they keep filling up too much and breaking them does nothing
Elafis 11 Jan @ 11:33am 
Hello. I have a large hangar with smaller ones in it, both the large one and the small ones can go out, from the smaller ones to the large one. How to set the airlock to work correctly?

Is it possible to have both sides open (inner and outer) in case there is atmosphere outside?
MrMallenby 14 Dec, 2024 @ 2:09pm 
Yea the door open and close thing had me wondering, swapped the doors for some from rebels gates (outer doors) and worked a treat so guessing the doors i was using just dont like the script.

As for the Auto closing i tried changing the auto close value to things ranging from 30 seconds to 600 seconds and there was no effect, Got around it by using another auto close door mod which seems to override the issue haha
Engineered Coffee  [author] 14 Dec, 2024 @ 5:39am 
The doors autoclose on purpose. It was an attempt to address Keen's bug. You can turn it off inside the script settings.

Not sure why the doors aren't fully opening. The script doesn't use timing. It looks for when doors are full open or closed.
MrMallenby 13 Dec, 2024 @ 9:33am 
As an update to my previous comment the outer doors dont open fully either i think something in the timing of the script is broken
MrMallenby 13 Dec, 2024 @ 9:15am 
Note sure if its just me running into this but when i cycle the airlock which works fine, Once my inner doors open a few seconds later they will close again without any input from me or reason too
MrMallenby 12 Dec, 2024 @ 2:45pm 
Really hoping you can find the time to update this, Best airlock script i have found