Space Engineers

Space Engineers

53 人が評価
Airlock Master Computer v1.72 - with air seal/depressurize waiting!
   
アワード
お気に入り
お気に入り
お気に入りから削除
ファイルサイズ
投稿日
更新日
4.375 KB
2015年1月14日 17時40分
2015年7月16日 16時35分
14 項目の変更履歴 ( 表示 )

サブスクライブしてダウンロード
Airlock Master Computer v1.72 - with air seal/depressurize waiting!

解説
If you find this description to be too long, I have wrote quicker instructions in the code itself.
Or watch the video demo :P

This is a controller script for airlocks, one script can control multiple airlocks at the same time.

Blocks for this script:
- Programmable block
- Timer block
- 2x Doors for each airlock
- Trigger block for each airlock (any functional block that can be turned on or off, a light for example)
- Buttons or something to press :P
- Optional: light for each airlock
- Optional: 1 or 2 sound blocks for each airlock

You only need 1 programmable block for any number of airlock pairs and you can even recycle a timer block that triggers some other script to trigger this script as well.

To start off load the script into the programmable block and configure the timer block to run the script and start itself again and set its delay to 1.

ADVANCED: You can also have improved response and greater delay accuracy by replacing "Start" with "Trigger Now" but you need to edit the calledTicks variable in the script accordingly (to 60) and set skipCalls to at least 5 because 60 times a second is too fast and it gets glitchy.

Then name your door, trigger, light and sound blocks to the combination of Prefix+AirlockID+Suffix, here's the default names:
Doors: "Airlock 1 Inside" and "Airlock 1 Outside"
Trigger: "Trigger Airlock 1"
Optional blocks: "Light Airlock 1", "Sound Airlock 1 Open", "Sound Airlock 1 Close", "Air Vent Airlock 1", "Screen Airlock 1"

The "1" is the airlock ID, which you can change/add in the "airlocks" list at the top of the code, they can be numbers, letters or words.
The prefixes and suffixes for blocks can also be edited.

Next, you'll need some buttons (you can use anything really, even sensors) to trigger the airlock cycle, in which you must add the Trigger Airlock *ID* block as turn ON, do not add it as toggle ! The script will turn it off once it finished cycling.

NOTE: If you turn the trigger block on and off again, both doors will remain closed until you turn it on again, might be of use in certain situations.

Additionally you can place a decorative light and sounds to trigger when doors open and when they close (if you have some depressurization sound mods or something), but they're optional, like I said, which means the script will run fine without them.

Since v1.2
You can edit the lights colors and other settings on each state.

Optionally you can add an Air Vent block ("Air Vent Airlock <ID>") which will be set to "Depressurize" when both doors are closed by default, you can change that in the code however.

v1.4
You can also add LCD/text panels to be updated by the script with the airlock status, again, see code to configure :P
NOTE: You can have as many screens with the same name as you want, it will update all of them.

v1.71
Since this version the airlocks are set to wait for depressurization or seal (for pressurization).
This only works if the airlocks have an air vent, if they don't then the open delay variables are used.
Additionally it updates screens with the oxygen level and has a failsafe in case oxygen levels do not drop to avoid a permanent cycle.

Known issues
1. Fixed since v1.6b Since there's no interface for the air vent I had to do a workaround to find out if it's despressurize status is checked or not, which is language sensitive.
If you're using anything other language than english this won't work properly with air vents.
I will fix this once they implement an interface to get the depressurize status internally.



2. Because of some issues in the API, the light settings might not work if you add more than one action (set color and set blink for example), while the script is made to support that, the game fails to apply them (as far as I know, might've been fixed by now xD)
110 件のコメント
maverick 2019年12月8日 20時16分 
needs to be updated
Adi 2017年5月6日 14時09分 
An OnOff toggle for the doors would be godly to lock the doors after the script opened/closed the doors. That way people won't be able to accidentally open the doors manually.

I've tried to change the script to do this, but I don't really know how to add a delay and because of that sometimes the doors won't turn on fast enough and the script can't close them.
Chip Patton 2016年12月21日 13時55分 
Digi, can you add a simple OnOff_On and OnOff_Off to the door properties during the main loop. I had this working in your script before I wiped my server and didn't save it :P

Basically I had simply made a new function to turn doors on and off after waiting 10 ticks.

If you try doing it before and after Open_On or Open_Off, it bugs out the airlocks, the doors will still be in their last state but the control panel will have them registered as opposite of what you see... It's a mess :P Its just a lot easier to place a pause in there before doing it.

Should be pretty simple to do, if you need any help or code sniplets, let me know, though I'm more than sure you're capable.
A__Gun 2016年8月25日 3時03分 
I changed line 279 to 'if(!seal || oxygen < 1)' , instead of just 'if(!seal)' and that seems to have made it wait for airlock re-pressurization before opening the inner door. I did also have to move the declaration of the oxygen variable for this to work.

Been a long time since i've coded and first time looking at it within SE, so please take this with a pinch of salt.
buder28 2016年2月7日 0時36分 
now i know a sugestion having a wait time for each airlock set because hangar is way slower to close/open than sliding door
Twitch.tv/Jafu29 2016年2月2日 4時32分 
y i think it works just try it... i dont have any issues
buder28 2016年2月1日 23時18分 
is it working with hangar door?
Twitch.tv/Jafu29 2015年12月17日 13時55分 
Is it possible to make a delay inside the Script to delay the detection of the activation of the trigger block?
werdna23 2015年11月14日 17時04分 
keeps saying failed to find inside doors
werdna23 2015年11月14日 17時03分 
i keep coming up with a failed execution for the doors everything is named correctly i even tried it in creative mode and doesnt work