Space Engineers

Space Engineers

566 ratings
Airlock Control
3
   
Award
Favorite
Favorited
Unfavorite
File Size
Posted
Updated
1.099 MB
May 2, 2015 @ 11:09am
Jul 10, 2022 @ 6:33am
23 Change Notes ( view )

Subscribe to download
Airlock Control

Description
v:0.976 (01.201 compatibility, fix wrong text length on corner LCDs & take LCD text padding setting into account)
In-Game script by MMaster & Morphologis

Last update: Fixed LCD flicker
* Fixed timing to improve airlock response times
* Updated for 01.186 version of game
* Timer block is not required anymore!
* (look at extra features section below)


Intelligent airlock system. Automatically controls any number of airlocks on ships and stations.
  • Any number of airlocks using single programmable block & timer
  • Any number of doors per airlock (can be used with Hangar Doors)
  • Any number of airvents per airlock (so you can use it for large airlocks)
  • Automatic pressurization / depressurization with optional pressure detection in rooms behind doors
  • Doors automatically closed & locked / unlocked & opened
  • Lights changing colors based on state of airlock
  • Play sound blocks when airlock is pressurized, depressurized or in both cases
  • LCD display support to display state of any number of airlocks on any LCD
  • Unlocks doors without opening when airlock can't be depressurized / pressurized
  • 3 button actions support: transfer to inner doors, outer doors or switch between them
  • Airlock can be also controlled by switching 'Depressurize' on airvents
  • Supports all official Space Engineers languages
NO PROGRAMMING NEEDED.

VIDEO GUIDE BY MORPHOLOGIS:
* https://www.youtube.com/watch?v=viWsqLvqkAM

If you like this script please give it positive rating, if you don't like it then please tell me why and I will try to fix it or learn from it. Thank you!

QUICK GUIDE:
* Load script to programmable block, Check code, Remember & Exit

Note: Airlock name mentioned below is name of the airlock that you can choose. Replace any mention of Airlock name by your chosen name for your airlock. You should have all 3 groups with same Airlock name unless you know what you are doing.

Setup 3 groups per airlock like this:
Group named "Airlock Control: Airlock name" should contain:
- airvents inside airlock
- lcds that should show this airlock state [optional]

Group named "Airlock Inner: Airlock name" should contain:
- inner doors (opened when airlock is pressurized)
- lights for showing inner door status [optional]
- sound block played when airlock is being pressurized [optional]
- [optional] place airvent behind inner doors and assign it to Airlock Inner group to let airlock automatically figure out what should be the pressure when opening inner doors

Group named "Airlock Outer: Airlock name" should contain:
- outer doors (opened when airlock is depressurized)
- lights for showing outer door status [optional]
- sound block played when airlock is being depressurized [optional]
- [optional] place airvent outside of outer doors and assign it to Airlock Outer group to let airlock automatically figure out what should be the pressure when opening outer doors

Setup buttons to Run Programmable block with argument (without quotes!):
"Airlock name in" - transfer to inner doors (pressurize)
"Airlock name out" - transfer to outer doors (depressurize)
"Airlock name toggle" - switch between inner doors / outer doors

"Airlock name" is name of your airlock! If your airlock is called ABC then use "ABC in", "ABC out" etc.

HINT:
You can build single sound block and add it to both Inner and Outer group
to play sound each time airlock changes state (e.g. hissing sound).

* Done.

LIGHT COLORS
Blinking Red - these doors will open when airlock is (de)pressurized
Red - these doors are locked
Orange - doors unlocked, but not opened when airlock cannot be (de)pressurized
This usually happens when you don't have enough oxygen to pressurize airlock or you don't have enough tanks to depressurize it.
Green - doors unlocked and opened

TROUBLESHOOTING
- Make sure that your own everything!
- Make sure that you used the same Airlock name in all 3 groups for single airlock.
- Always make sure that there are only the blocks that are supposed to be in the groups.
- If your doors are opening immediately as you cycle the airlock, make sure that you didn't put the airvent inside the airlock to one of the Inner / Outer groups.

EXTRA FEATURES
Place airvent behind inner doors and assign it to Airlock Inner group and also place airvent
outside of outer doors and assign it to Airlock Outer group to let airlock automatically figure
out what should be the pressure when opening inner and/or outer doors.

NOTE: You are now able to change colors of the lights:
Change color of lights in script LIGHT COLOR SETTINGS when you click EDIT in programmable block with this script and scroll down the guide.

Add closing time to doors name to make sure doors are closed before locking them by adding "CT:seconds":
* if your doors are named "Hangar Door 3" rename them to "Hangar Door 3 CT:10" to set closing time to 10 seconds
* if your doors are named "Door 3" rename them to "Door 3 CT:5" to set closing time to 5 seconds

Tell the script to open the doors after some time even if pressure is not right in the airlock:
Change line "MMConfig.OPEN_ANYWAY = false;" in Configuration() section at the beginning of the script
to "MMConfig.OPEN_ANYWAY = true;" (without quotes)

ALWAYS check the OWNERSHIP.
Programmable block needs to be have the same ownership as all the other blocks you want it to control.
So all doors, lights, airvents, sound blocks, buttons and LCDs need to have the same owner as programmable block.

HOW TO UPDATE?
This script is not a mod so it does not update by itself. You need to load new version of script to your programmable block to overwrite the old one. You do that in exactly the same way as when you first loaded the script into programmable block.
Open your programmable block, click Edit, click Browse Workshop, select Airlock Control, click OK, Check code, Remember & Exit. Done. Your script is now updated.



VERY SPECIAL THANKS
Morphologis for this idea, his help with debugging this script and for his support of community & awesome videos!
Make sure to check out his YouTube channel:
https://www.youtube.com/user/Morphologis

Also thanks to Direwolf20 for fix to depressurization on load issue.

MY OTHER POPULAR MODS
Automatic LCDs 2
http://steamcommunity.com/sharedfiles/filedetails/?id=822950976

Automatic Oxygen Lockdown
http://steamcommunity.com/sharedfiles/filedetails/?id=419465037

Medium Medbay
http://steamcommunity.com/sharedfiles/filedetails/?id=423346486

Colorable Airtight Armor Gate
http://steamcommunity.com/sharedfiles/filedetails/?id=415051704

Retractable Glass Bridge
http://steamcommunity.com/workshop/filedetails/?id=419124752

Retractable Glass Stairs
http://steamcommunity.com/sharedfiles/filedetails/?id=431420571


Watch MMaster's Steam group: http://steamcommunity.com/groups/mmnews
Youtube Channel: https://www.youtube.com/user/MattsPlayCorner1080p
Twitter: https://twitter.com/MattsPlayCorner
and Facebook: https://www.facebook.com/MattsPlayCorner1080p
for more crazy stuff in the future :)
Popular Discussions View All (11)
1
Jul 17, 2022 @ 12:53pm
[Bug Report] Compatibility with Large Grid Hangar Doors IR
PhoenixIO
1
Feb 20, 2021 @ 4:38pm
Script automatically triggers every ~5 seconds
Doctor Verum
2
Feb 20, 2021 @ 4:39pm
To Much Oxygen In Tanks and using Airlock script on Planets
Bobisback
552 Comments
Sacrifxion Dec 28, 2024 @ 6:55pm 
Hey, very nice script!
Thank you for this work!
Can you add an "autoclose" feature pls?
MMaster  [author] Aug 25, 2024 @ 2:37pm 
@RaZ its hard to say what's wrong I've got testing room with 2 airlocks and it works completely fine.

@Octavius that's not something I am planning to add as groups are much more suitable to group blocks together than having to write to custom data for every single block:
1. groups have in-game interface allowing easy change for multiple blocks at once
2. groups have scripting interface which allows for fast access in scripts
3. looking for blocks with specific custom data in them would require checking custom data of every single block on ship/station regularly which would be very bad for performance
Octavius Aug 25, 2024 @ 1:04pm 
would it be possible to have the setup of each airlock moved to the custom data of the doors and airvent themself instead of needing to make 3 groups each airlock
RaZ I L May 21, 2024 @ 3:25am 
having problems with this script, works fine with 1 airlock but when i add another airlock to the rear of the same room strange thing start happening, both airlocks have different names i.e Station Airlock, for the front Airlock and Station Rear Airlock for the airlock at the rear of the room, if i use just 1 airlock all the time everything works fine but if i attempt to use both airlocks then strange things start happening, i.e airlock doors don't open or close as they are supposed to or i get and air vent depressurise repressurise loop that drains all the oxygen tanks and the only way to fix it is to recompile the programmable block.
MMaster  [author] Apr 28, 2024 @ 10:53am 
I'm afraid I can't help you - It's video from 8 years ago, the game and interface looked different back then.
Princess Yoda Apr 27, 2024 @ 9:43pm 
Hey MMaster, thanks for the mod :) Please could you tell me what mod you are using to have this terminal appearance with colors ? I couldn't find a mod that retexture the terminal menues and I really like the one you are using in that video. thanks
Aschran Oct 5, 2023 @ 2:05pm 
Thank you, with the new buttons panels with integrated lcd, i think it would be very good addition, thank you for considering this!
Atomhirsch Oct 4, 2023 @ 11:34am 
Sure, i didnt test it yet :D
MMaster  [author] Oct 4, 2023 @ 11:21am 
@Aschran good idea. I do not have access to my development machine right now, but I will try to look into it.
@Atmohirsch As far as I know there is nothing that would offer out of the box airlock control with all the functionality like this script does, but everyone is free to use whatever they want :)
Atomhirsch Oct 4, 2023 @ 4:28am 
Does this script still make sense while having ECs now?