Space Engineers

Space Engineers

Whip's Auto Door and Airlock Script
570 Comments
aTruckgril Beverly ✿ May 15 @ 11:22pm 
@blurrymetal53 Hey, I get where you're coming from. Adding new functionality can be a bit tricky when you're still learning, but it's great that you're diving into it.

For detecting when the airlock is open and turning the LCD on or off, here’s a basic approach you can follow:

Check the status of the airlock door. You’ll usually want to get its Status property and see if it’s DoorStatus.Open.

Use an if statement to detect if it’s open or closed.

Then toggle the LCD on or off using the ShowPublicTextOnScreen() or by enabling/disabling the surface.

Let me know if that helps at all :)
BlurryMetal53 May 14 @ 8:27pm 
I'm trying to add functionality to the script to turn on/off an LCD when it detects the airlock open, but can't for the life of me figure it out as I have no real experience coding. Anyway you can give me some tips for it?
Commander_Idiot Mar 1 @ 5:06am 
Nvm, apologies for my stupid question. I didn't read far enough.
Commander_Idiot Mar 1 @ 4:56am 
Will this work on an airlock with three doors? One leading to the interior and two to the exterior? If it does work, is it just following the same steps with the names?
Elafis Nov 7, 2024 @ 12:21pm 
it is possible make some update if ship is in atmosfer? outter door open immidiately without depressure becouse ouside is pressure? Or for double hangar door possibile open both doors together if both side is (de)pressure? Thank you a lot :)
NekoJess Nov 6, 2024 @ 5:45am 
[Rose]Noot Try checking the code again.
Adolf Rizzler Nov 6, 2024 @ 3:13am 
Im not sure what im doing wrong, I cant get the airlock part to work, I have two connected doors named [Garage] Airlock Exterior and [Garage] Airlock Interior, however the boths doors can be opened without the other being closed. Any suggestions?
Whiplash141  [author] Oct 22, 2024 @ 9:37pm 
This script finds every door not name tagged with "Ignore". It does not currently use groups.
PrinceSporus Oct 22, 2024 @ 8:19pm 
Does it work with groups or do I need to rename each individual block?
Whiplash141  [author] Sep 28, 2024 @ 5:28pm 
Yep, set "Ignore all hangar doors" in the program block custom data to false
DjFrost Sep 27, 2024 @ 6:10pm 
Does the auto close function work with Vanilla Hangar Doors, and if so, how do I get it to work, as I cannot figure it out lol
BCMortis Sep 19, 2024 @ 8:14pm 
Can I make a small request? Either an option to (or a different script) that ONLY manages specific doors. For example, I use a lot of modded window shutters on my base, and with most auto door scripts, I end up having to manually go through and exclude dozens of shutters and interior doors I don't want the script to keep closing. Would be a lot more convenient if I could label only the doors I want the script to manage and everything else is excluded by default.
VGAstudent Aug 18, 2024 @ 11:46am 
(I could imagine a shortcut to keep the blastdoors from being affected by the close door command would be to shut the blast door blocks off, and turn them on followed with a close command to close them fast during a leak.)
VGAstudent Aug 18, 2024 @ 11:32am 
I'd love to see a Blast Door option you could trigger to close if a room became de-pressurized; Is there a run argument you can create to close blast doors when an room no longer pressurized condition is met on a vent? like "Blast Doors Close" and "Blast Doors Open"?
Gontarekt Aug 16, 2024 @ 12:33pm 
Hm, I thought of that, but I prefer how this script handles it, with the changing from Blue to Blinking Red, it just looks so much cooler.
Whiplash141  [author] Aug 16, 2024 @ 12:31pm 
if you just want flashy lights when a door opens, i think the event controller might work
Gontarekt Aug 16, 2024 @ 12:25pm 
Well bugger :wrongpig:
Whiplash141  [author] Aug 16, 2024 @ 12:20pm 
nope, sorry
Gontarekt Aug 16, 2024 @ 9:14am 
Frequently use this script, but is it possible to use the Airlock System Light + Sound Blocks without having it lock the doors (Blinking lights / alarm when any door of an airlock is open)? I used to use the airlock system frequently, but the locked doors do get a bit painful after a while.
Whiplash141  [author] Jul 14, 2024 @ 3:17pm 
I do see one potential issue here: Your airlock doors are named in the pattern of "Sliding Hatch Door - Airlock Exterior". This means that the code detects the airlock prefix as "Sliding Hatch Door -". Anything before the airlock suffixes is treated as the name tag.
Whiplash141  [author] Jul 14, 2024 @ 3:15pm 
I see no blocks on this ship with the name tag "... Airlock Light" or "... Airlock Sound". Is this the right blueprint?
Sean W. Jul 14, 2024 @ 1:05pm 
Here is a blueprint for you to look over.
https://steamcommunity.com/sharedfiles/filedetails/?id=3280647837
Whiplash141  [author] Jul 14, 2024 @ 2:56am 
Have a blueprint i can look at?
Sean W. Jul 14, 2024 @ 2:18am 
Yes
Whiplash141  [author] Jul 14, 2024 @ 12:52am 
You need the prefix on those block names as well. Do you have the same airlock prefix on all the airlock doors, the light, and the sound block?
Sean W. Jul 13, 2024 @ 10:26pm 
Yes, I made sure to check all ownership. And I used the exact names in the script "Airlock Light" and "Airlock Sound" but it's still not working.
Whiplash141  [author] Jul 13, 2024 @ 8:00pm 
give me an example of the names you are using. Also, have you checked ownership of all blocks?
Sean W. Jul 13, 2024 @ 1:26pm 
I use this script a lot. But there is something wrong when I try to use it for lights and sound blocks. For some reason, the script isn't recognizing the lights and sound blocks even when I name them exactly how the script tells me to.
Whiplash141  [author] May 31, 2024 @ 4:31pm 
This script does not control airvents at all. It simply prevents you from spacing all of your oxygen out of a simple airlock. If you want to preserve air, simply set the airvent in your airlock to always depressurize.
DoPa May 31, 2024 @ 1:33pm 
Hi, it works quite well but one thing is missing. Before the airlock opens, the pressure in the airlock should decrease and when I'm in the airlock I should blow it in again so that oxygen isn't constantly lost.
Darth Porgus Feb 3, 2024 @ 3:36pm 
Thanks for the response!
Deapri Feb 2, 2024 @ 11:29pm 
@Darth Porgus Isy's script interprets the positioning of the doors and inherits behavior based on that with control in exclusions. I feel this script offers more overall control of the setup and effective application. More setup is required however it is my opinion this script better suits my uses.
Whiplash141  [author] Feb 2, 2024 @ 10:43pm 
This is 4 years older. Aside for that I have zero clue because I only use scripts I write.
Darth Porgus Feb 2, 2024 @ 3:10pm 
How does this differ from isy's simple door script?
Deapri Jan 19, 2024 @ 3:37pm 
Which I could edit a post, anyway, the setting is Ignore all hangar doors=true set it to false
Deapri Jan 19, 2024 @ 3:36pm 
Hangar doors are excluded by default change the custom data on the programming block to enable them.
xtravince Jan 13, 2024 @ 2:10pm 
hi, this script is great thank you very much :steamthumbsup: , but when I install a hangar door it doesn't work with it, it doesn't close and there is no custom data (I waited for the refresh time)
Bacon Sep 30, 2023 @ 9:45pm 
Thank you very much :)
Whiplash141  [author] Sep 30, 2023 @ 9:23pm 
Of course, these scripts are here for you to use
Bacon Sep 30, 2023 @ 8:47pm 
Can I use this script for a ship I'm currently building? I'm going to post the ship on the workshop and wanted to make sure you're good with it. :)
Whiplash141  [author] Sep 28, 2023 @ 5:23am 
Ignorance is bliss, and it seems you have an abundance of both.

Your profile was a hilarious shrine of stupidity, but you privated it :'(
Slinkerdeer Sep 27, 2023 @ 6:30pm 
Pfff hahahaha! sadder than I thought, knew you would also thank me for the points xD, enjoy the meaningless internet numbers
Slinkerdeer Sep 27, 2023 @ 6:27pm 
Hahahah I knew when I made that typo you would point it out because you have literally nothing else to respond with
Whiplash141  [author] Sep 26, 2023 @ 5:34am 
I'll label your chin with deez nutz. Also how'd you manage to misspell "auto"? The helmet must have slid over your eyes.

:missing: <- The contents of your mind represented by a texture (thanks for the free steam points, I'm enjoying them lol)
Slinkerdeer Sep 26, 2023 @ 3:28am 
Once again, its labelled "auto door", you said "hence title" when I asked about it not auo opening the doors. Lmao how stupid can you be
aTruckgril Beverly ✿ Sep 25, 2023 @ 5:03pm 
@Slinkerdeer do you wear that helmet when you use the stove or something? I can see reading comprehension is beyond you
Firewarrior44 Sep 25, 2023 @ 4:56pm 
> This script will close any door once it has been fully open for over 3 seconds (10 seconds for hangar doors).

The first line of the description is really unclear, please fix. Also Does Is this weapon core compatible?
Whiplash141  [author] Sep 25, 2023 @ 4:55pm 
Also, here are some resources that you'll definitely find helpful: https://www.wikihow.com/Teach-Yourself-to-Read
Whiplash141  [author] Sep 25, 2023 @ 4:52pm 
:jarate: <- you irl
Slinkerdeer Sep 25, 2023 @ 4:07pm 
Oh, and enjoy the jester