Space Engineers

Space Engineers

Not enough ratings
VCZ Airtight Connector Autodoor Script
   
Award
Favorite
Favorited
Unfavorite
File Size
Posted
Updated
16.747 KB
29 Sep, 2018 @ 2:51am
26 Apr, 2019 @ 6:11am
11 Change Notes ( view )

Subscribe to download
VCZ Airtight Connector Autodoor Script

Description
Automatically opens when connected, closes when disconnected
Automatically closes 10 seconds after manual or sensor opening

No Set Up Required

Only affects VCZ Airtight Connector and Doors on same grid
- Include grid with by putting keyword crossGrid into Custom Data of Connector on target grid
-- Keyword is a changeable setting named crossGridKeyword, I recommend making it unique for each grid

Ignores blocks with keyword exclude in Custom Data
- Keyword is a changeable setting named exclusionKeyword

Optionally connects vanilla connectors
- Enabled by default, controlled with setting vczOnly

Saves the connector and door pair at script start
- Forgets destroyed pairs - Improved

Adjustable Settings
Set in Custom Data, load with command 'load'
  • manualOpenSeconds - Delay in seconds until 'VCZ Airtight Connector Door' opened manually or via sensor closes automatically - Default: 5
  • autoConnectSeconds - Delay in seconds before auto connect - Default: 10
  • disconnectSeconds - Delay in seconds before enabling disconnected connector - Default: 5
  • exclusionKeyword - Keyword put in Custom Data to ignore any block - Default: exclude
  • baseName - Base name assigned to main Programmable Block - Default: Custom Name - Prog VCZ - Count: x
  • crossGridKeyword - Keyword put in Custom Data of Connector on target grid to control entire target grid - Default: crossGrid
  • doorLockOverrideKeyword - Keyword put in Custom Data of 'VCZ Airtight Connector Door' to prevent locking - Default: override
  • autoClose - Automatically close 'VCZ Airtight Connector Door' opened manually or via sensor - Default: True
  • autoConnect - Automatically connect 'VCZ Airtight Connector' and if enabled vanilla Connector - Default: True
  • requirePairs - Requires a 'VCZ Airtight Connector Door' for each 'VCZ Airtight Connector' - Default: True
  • vczOnly - Exclude vanilla connectors - Default: False
  • lockUnconnectedDoors - Lock 'VCZ Airtight Connector Door' when it's paired connector is not connected - Default: True
  • disableConnectorsOnDisconnect - Turn off recently disconnected connectors to prevent magnetizing back - Default: False

Commands
Case insensitive
  • Save - Save settings to Custom Data
  • Load - Load settings from Custom Data
  • Scan - Get new list of VCZ Connectors
12 Comments
nicknds  [author] 13 Apr, 2019 @ 4:29pm 
Your welcome :steamhappy:
TiGeR 13 Apr, 2019 @ 4:27pm 
@nicknds
Ok, everything is clear :)
Thank you for your time and best regards.
nicknds  [author] 13 Apr, 2019 @ 4:07pm 
TiGeR,
No need to program or change the script, just change the setting in Custom Data and press Recompile.
This script connects Airtight Connectors on its grid, then opens doors on its grid.
If you want doors on other grid opened, use this script on that grid too.

Grid A and Grid B both have this script

Grid A aligns connectors with Grid B

Grid A and Grid B connect connectors

Grid A and Grid B open doors

If Grid B doesn't have script, Grid B doesn't open doors but connectors still connect
TiGeR 13 Apr, 2019 @ 3:11pm 
@nicknds
Thank you very much for the updates :)
I can not program but I think I can do it :)
I do not know if I understood correctly that one script, for example in a station, will serve ships equipped with Airtight Connector? and on ships does not have to be a script anymore?
Correct me if they are wrong.
Again thank you very much.
nicknds  [author] 13 Apr, 2019 @ 2:37pm 
TiGeR, I added a fix for controlling sub-grids or parent grids.

Simply put the keyword 'crossGrid' into the Custom Data of any one connector on the grid you want the script to find. It will find all connectors and doors on that grid now.

Since the script is intended to run on both grids for VCZ Connectors, it is a setting called crossGridKeyword . I would recommend changing that setting so only one script controls that grid.

Programmable Block A on Grid A > set crossGridKeyword to 'crossGridA'
- Insert keyword 'crossGridA' into connector on sub-grid or parent grid
- Programmable Block A now sees and controls connectors and doors on that grid

Programmable Block B on Grid B > set crossGridKeyword to 'crossGridB'
TiGeR 13 Apr, 2019 @ 1:20pm 
Hello
I noticed that a small program block connected by a large rotor with a small head does not see the Airtight Connector: (using your script I do not know if this is an error.
Greetings.
XEN 15 Nov, 2018 @ 2:50am 
With the one I use an example of an airlock tag would be:
Door Airlock-0.5 [Main:Inner]
the decimal is the distance the door opens and the rest is self explanitory. That is for the airlocks.
For basic doors the tag is 'Autodoor'
XEN 15 Nov, 2018 @ 2:43am 
That doesnt sound too bad. So it would function the same? also would it be possible to adjust the distance the door opens?
nicknds  [author] 15 Nov, 2018 @ 12:12am 
It would also require that you rename atleast one of the doors to something like 'inner' or 'outer' so the script knows if your looking in or out.
nicknds  [author] 15 Nov, 2018 @ 12:10am 
That is a mod not an in-game script so he has more options like getting the locations of all players.
I could make something similar but it would require sensor(s) within range of the doors.
I would save the empty areas between the doors as airlocks and open one door or the other based on where you are looking and the status of the other door.