Space Engineers

Space Engineers

评价数不足
Automatic Doors and Airlocks
   
奖励
收藏
已收藏
取消收藏
文件大小
发表于
更新日期
18.656 KB
2018 年 9 月 30 日 上午 1:48
2019 年 8 月 17 日 上午 9:17
5 项改动说明 ( 查看 )

订阅以下载
Automatic Doors and Airlocks

描述
This script makes doors close automatically.

Features:
- Sets all doors in a given list to close automatically with a given delay
- Sets all doors in the grid to close automatically with a given delay, except the ones who's names begin with one or more given patterns
- Creates airlock systems of two doors each, so that one door closes automatically when the other is open
- Creates airlock systems of three or more doors to limit loss of oxygen or to create puzzles
- Create auto-sealing airlocks (one door powered down and closed while the other is open, opening or closing)
- Sets airlock systems to close automatically with a given delay
- The delay is configurable

Instructions and examples can be found at the top of the script's body.

SPECIAL THANKS to Stelio Kimbos for the auto-sealing airlock feature
SPECIAL THANKS to Silverdog for the group exclusion feature
14 条留言
catalinioan.georgescu  [作者] 2019 年 8 月 17 日 上午 9:30 
Now there is. Thanks for the idea, btw. I modified the doorToBeExcludedFromAutoclosing() method in AutoClosingDoorsManager - changed Equals() to StartsWith(). The config section at the top of the script remains the same, except now when you write autoClosingDoorsManager.excludeDoor("EXCL"); in InitAutoClosingDoors(), it will exclude all doors having names beginning with "EXCL". Of course, you can change "EXCL" with "HANGAR" ir anything you like.
Silverdog 2019 年 8 月 17 日 上午 7:22 
Is there a way to exclude a group of doors (In most cases hangar doors) from autoclosing without typing in every single one? Maybe someting like a part of the name (so you can still name each door)?
Punkachuros 2019 年 7 月 7 日 上午 4:28 
Since i'm French i have a hard time figuring out what to do, even when i call them "TEST EXCLUDED DOOR" and recompile it doesn't say anything in the bottom right ^^'
I'm new to script, but i don't understand why you tell me to do won't work
catalinioan.georgescu  [作者] 2019 年 7 月 7 日 上午 2:53 
Go to the programmable block where you put the script and press the "Recompile" button. After that, you should see a message in the script output, at the bottom right of the window, confirming that the door has been excluded from the auto-closing doors list. The indexing of objects only happens when the script initializes. This behavior is necessary to avoid CPU-expensive API calls at runtime.
Punkachuros 2019 年 7 月 6 日 上午 5:39 
It's a really nice Script, i love for the main door of my ship, but i got a problem with my hanger door, even with "TEST EXCLUDED DOOR" it won't open, it close itselft back up :steamsad:
Stelio Kimbos 2019 年 6 月 4 日 上午 3:47 
Nice job!! and thanks
catalinioan.georgescu  [作者] 2019 年 5 月 16 日 下午 12:51 
If it's any help, I added the feature you wanted. Thanks for the idea :) I tried to do the "until DOOR A not closed" part when I wrote the script last year, but wasn't able to using the TerminalPropertyExtensions. Now I see IMyDoor has a Status property which has the needed info.

Some times it's easier to start fresh rather than to add to existing code. The idea is pretty simple. Program() is called only when the script initializes, so you should get the references to the doors in there. to avoid unnecessary CPU usage. You can reuse findBlockOfTypeWithName. Main() runs periodically, so that's where you need to check the door status. You can use IMyDoor.Status and do something similar to my DoorEventWatcher.tick() to detect a status change.

Best of luck!
Stelio Kimbos 2019 年 5 月 14 日 上午 11:53 
Thank you very much, I thought u have a method written, that ex: If (DOOR A is open) then DOOR B PWR_STATE_OFF until DOOR A not closed. I was trying do that in your script, but not work how i want XD. im really noob scripting. Thanks for your work.
catalinioan.georgescu  [作者] 2019 年 5 月 12 日 上午 11:05 
Your english is fine :) I get what you're saying and you're right. If at least one of the doors is not completely closed, the ship will lose air.

This is a simple script. It doesn't handle vents for depressurization. There's a way you can minimize the loss of oxygen. You should stick the two doors together and set the airlock to automatically close. You can also set the AUTO_CLOSE_INTERVAL_CYCLES variables lower to decrease the wait time till the door closes. Then, all you have to do is wait for the door to close before opening the other one. The wait time is not as high as with air vents.

One other thing that was quick and easy to do: I updated the script to make it possible to chain up 3 or more doors in one airlock system. With 3 doors, there's no need for automatic close delays. Example::
airlockManager.createAirlock("AIRLOCK03 DOOR A", "AIRLOCK03 DOOR B", "AIRLOCK03 DOOR C");

I hope this helps to some extent.
Stelio Kimbos 2019 年 5 月 10 日 上午 7:18 
i was watchng the code, and i don't understand why with an airlock system, when i opened a door i open the next and i got out all my oxigen. The new open door close the other door, but it's enought time to lose your oxygen. i saw the method seal, but i think doen't work.

Sorry my english, i hope someone understand my problem, maybe im doing something worng.

And thanks for your work!!