Space Engineers

Space Engineers

评价数不足
Airlock Manager
   
奖励
收藏
已收藏
取消收藏
文件大小
发表于
6.204 KB
2017 年 10 月 1 日 下午 6:43
1 项改动说明 ( 查看 )

订阅以下载
Airlock Manager

描述
A rather powerful and flexible airlock script, designed to conserve a scanty oxygen supply.

When any door is opened, the system first attempts to equalize the pressure. If both are open to space, it assumes they're already equalized. If both are interior and one or the other is pressurized, it attempts to pressurize both of them- closing doors to other depressurized regions as necessary- before opening the door. If it runs out of tanked oxygen, the script then waits only to be sure neither region is open to space before opening the door, for a potentially strong breeze. This easily handles someone entering the ship. For someone leaving the ship, if one side of the door is exterior and the other is sealed, it first attempts to depressurize the interior space, sealing doors against other pressurized zones as necessary. Once fully depressurized, or all oxygen tanks full, the door is opened.

This script can detect and respond to someone manually ordering the door block to open, if running on a Trigger Now timer. If the door would be opened immediately if ordered by the script, it is opened immediately. Otherwise, the open command to the door is overridden to maintain seal while the lock cycles to allow the door to be opened with minimal atmosphere loss- and minimal oxygen shockwaves. Any sealed region is automatically pressurized, if possible.

Furthermore, this script features a time delay system. Doors may be set to close automatically after standing open for a set period; I usually use this to maintain a smooth outer hull appearance, with the use of sliding doors, or to make sure I can't forget to close my bay doors. This system also works in the opposite direction- opening doors that have been closed for a set period. I haven't generally used this feature, except with some door-based collapsable stair mods (A 'null' airlock value on both sides works best for these non-pressuretight situations).

Even better, this script is fully expandable- it can handle theoretically unlimited locks and doors, within complexity limits. I have not tested it beyond the setup resting inside the initialize() function (29 locks, avg. 3-4 vents each; 55 doors, avg. 3-4 blocks each), but it should be able to handle any decently large ship or station. As this suggests, there is no limit to the number of vent or door blocks used in any given lock or door. They can be fed into it as single-vent locks or single-block doors, as regular block groups, or as a same-ship-filtered name search.

Note that this script does NOT support having an airlock between a pressurizable bay and another interior space, if all are managed by this script. Furthermore, this script assumes that every designated airlock space with a defined vent is pressurizable if all adjacent doors are closed. Hull breaches may result in (adjacent) sealed doors.

KNOWN BUG: When the script is forced to release atmosphere (tanks full), doors involved will tend to rattle before they open. That's because it's flicking them between open & closed so quickly.