Space Engineers

Space Engineers

Not enough ratings
Airlock Management Software
   
Award
Favorite
Favorited
Unfavorite
File Size
Posted
Updated
10.919 KB
27 Jan, 2020 @ 4:41pm
27 Jul, 2020 @ 5:47pm
2 Change Notes ( view )

Subscribe to download
Airlock Management Software

Description
ALMS Solutions Inc.
"Breathtaking Software"

Yet another airlock script. This one is designed to be scalable. Easy to use for a single minimal airlock, but allows for many separate airlocks to be controlled using one programmable block.

The Minimal Airlock Setup section is intended for folks who just want to get an airlock operational, and may be novice to setting them up. You can skip it to get more top-down directions.

Minimal Airlock Setup
Required Blocks:
  • Programmable Block
  • 2 Doors
  • Vent
  • Oxygen Tank

Build a pressurized room with a vent inside. Name one door something that includes the string "[ALI]". This is the usually the door that leads to a pressurized environment. Name the other door something that includes the string "[ALO]". This door should lead to vacuum. Make sure the grid is powered.

Pipe the vent to the oxygen tank.

Put both doors, and the vent in a group. Name the group anything, but include the string "[AL]".

Build a programmable block, and copy-paste the script into it. Click "Run" in the control menu to cycle the airlock.


Basic Airlock
Airlocks require the following to be in a group to be operational:
  • 1 or more doors with the [ALI] tag in their name
  • 1 or more doors with the [ALO] tag in their name
  • 1 or more vents

The group must have the [AL] tag in its name
Upon compilation, the script will find the group, and take control of the doors and vent.
The doors tagged with [ALI] are the doors that will open only when the airlock is pressurized. Doors tagged with [ALO] will only open when the airlock is depressurized.

Running the script causes the airlock to cycle from its current state to the other one, i.e. if it is pressuriz(ed/ing) it will start depressurizing, and vice versa. When the airlock is cycling, the script is updating every 10ms. When idle, the script does not run at all.


Multiple Airlocks
The script handles unlimited number of airlocks. However, as long as one airlock is cycling, it will be running in continuous mode, updating every 10ms. Please consider this when using scripts in online games.

To add another airlock, simply follow the instructions above. It is wise to name each airlock something different (but still include the [AL] tag!) because the script sorts the groups all alpha-numeric-like. They are then associated with a number. for example: A group with the name "Airlock A [AL]" will be associated with the number 1, if the only other airlock group has the name "Airlock B [AL]", which will then have the number 2.

Run the script with the argument being the number of the airlock you wish to cycle.

Bells and Whistles
If you add lights to an airlock group, it will be green when pressurized, and turn red when depressurizing.

If you add any LCD Panel to an airlock group, it will display status for that airlock. Feel free to adjust the text size and colour, the script doesn't touch those.

The Programmable Block that runs the script will display status for all airlocks that it controls. You can adjust the text size to cut off less important info, to make more important info readable.

Although this is not at all unique to this script, it is handy to build button panels and set up cycling a specific airlock on button press.

Airlock Issues
A common problem when building airlocks, is that a vent piped up to a full oxygen tank will not depressurize a room. One solution is to have a dedicated tank for all airlocks, but have it piped up to the rest of the grid's conveyor system via connectors. Fill the Airlock tank, unlock the connectors, and depressurize all airlocks. Then the airlock tank will never be too full to depressurize. Perhaps a future update to this script could have an "initialize airlock system" that goes through this process automatically.
18 Comments
Zarkash 20 Aug, 2020 @ 8:51am 
It`s just a small server for myself and some friends and it`s pretty much only me that uses scripts.

The sim speed is a steady 1 and I have not heard any complaints about lag. I do have some lag sometimes, but I don`t have a very good internet connection.

When the doors stop too early, there is only a thin opening. If it was real life, I`d say it would be about 2-3 cm. Hope that helps you imagine the gap :P
I get the impression that the PB sometimes skips ahead a bit compared to the animation.
I`ve started keeping an eye on the door that is closing, so that as soon as I see that it has stopped too early, I cycle the lock again. Never had it stop twice in a row when I do that.
calvin0_0  [author] 19 Aug, 2020 @ 8:27pm 
Zarkash, also I would like to know how 'closed' the door gets before turning off, both in what the 3d model looks like as well what the percentage readout on an attached LCD panel shows.

Thanks,
calvin0_0  [author] 19 Aug, 2020 @ 8:25pm 
Thanks for raising this issue, Zarkash. I have not tested this on a multiplayer server, let alone one that is under load.

The script really should wait until it can detect that the door is fully closed. I suspect the lag is somehow causing the script to "skip a step" or something. I could see about making the script wait a little longer until it is closed. Perhaps I will have to make a house call to a server that allows scripts to see if I can recreate what you experience.

Although I don't fully understand multiplayer yet, please, Zarkash, let me know the conditions of your server: is sim speed okay when it doesn't work? are there many players on the server? is you fps pretty standard? Can other players recreate the bug on their own grid, too? Can you recreate the bug in a single player game as well? Answers to these may or may not help me.

When I get the time, I will investigate this.
Zarkash 14 Aug, 2020 @ 7:50am 
Is it possible to make it slightly slower? I am using this script on a server and it happens quite often that the door won`t close properly before being turned off. This breaks the seal and the airlock stops working
MezzaDuStalker 30 Jun, 2020 @ 6:47am 
Thank you for this nice script. I added a sensor to avoid pressing buttons and it's really nice.
calvin0_0  [author] 18 Mar, 2020 @ 10:20pm 
Herr Doktor, are you hell bent on solving this by scripting? Are you not interested in the solution detailed in the section "Airlock Issues"? the one where it uses connectors to isolate the oxygen tank?

But if you really want to try writing scripts then go for it. I can try to help you if you need it.
Herr Doktor 18 Mar, 2020 @ 6:32pm 
But an airlock like this really helps for when I start running low on ice. I used to improvice by having a chamber with a perpetually depressurizing airvent, as long as I close the door behind me the vent does what it can before I open the next. Really the only time the vent would need to turn off is if only the inner door is open, since it'll just cause a ventilation loop.

Sadly, that's all I know right now. I'll look over that weblink and see what I can do. Maybe I can blindly make a miracle happen.
Herr Doktor 18 Mar, 2020 @ 6:32pm 
I suppose if I'm a position where I'm generating so much oxygen that it breaks the airlock, I did my job well enough. After all, the only time you can have too much air is when there's a fire. xD

I am not a great engineer yet, so I can't/don't calculate how much of what thing I need for a grid. So I just err on the side of caution. 1 OTank? Why not 10? 1 Reactor? 4 of them plus some hydrogen engines in case I run out of Uranium. Plus I only play singleplayer, so it's really easy for me to end up have a surplus of o2 and h2.

I kinda take pride in that, security in redundancy.

calvin0_0  [author] 18 Mar, 2020 @ 6:09pm 
Honestly, you are on to something. I wouldn't even have to specially name the tanks. I can just grab all Oxygen Tanks on the grid (well, I guess the ones that are piped up) and only if they are all 100% will the outside door automatically open.

If I do this, it defeats the purpose of the airlock, which is to preserve oxygen, thus saving on ice or whatever. So if a grid is constantly filling the tanks, then the emergency-open will always activate. This comes down to grid design, i.e. it is the engineer's fault, not the script, heheh.
calvin0_0  [author] 18 Mar, 2020 @ 6:09pm 
Almost everything I learned was from this: https://github.com/malware-dev/MDK-SE/wiki/Quick-Introduction-to-Space-Engineers-Ingame-Scripts

I do not recommend two two separate scripts with the same blocks, or even on the same grid, if you do not know exactly how they operate. They are clearly in conflict with one another.

Remember that a player cannot get truly trapped; they can access the panel on the door, switch off the ProgBlock, switch on the door, then open it. This however, is still not the desired method for this script, but it is a work around until I think of something better (and get around to implementing it).