Automatic Airlock Script для Space Engineers
A fully automatic air lock script. Airlock will pressurise/de-pressurise and automatically open the correct doors to let you in/out, doors remain locked while the airlock is working so you can't accidentally vent the whole ship. Supports status lights and/or LCD's for both sides of the air locks. Status lights/LCD's work even without the sensors, if you just want the displays for a manual air-lock.
Example world: http://steamcommunity.com/sharedfiles/filedetails/?id=865605993
(includes a couple of alternative set-ups)
Air Vents
Tag one (or more) air vents for the air lock [AL1V], and one inside the ship [AL1I], additionally if the outer side of the air lock opens into an area that can be pressurised (eg. a hangar), or if you want the airlock to work on planets with atmosphere, you'll need to tag a vent in this outer area too [AL1O].
Doors
Tag an inner door [AL1I], and an outer door [AL1O]. (hangar doors work too).
Automatic Airlock
Add a sensor for each door, the sensor field should cover an area each side of the door, entering the sensor zone will open the corresponding door, cycling the airlock as necessary.
If the airlock room is large or takes a long time to traverse (eg. a hangar, a long hallway), you can add an optional intra-lock sensor [AL1S], this sensor zone should cover the entire air lock room. This way the room will pressurise as you traverse the room, rather than waiting until you reach the exit to start pressurising.
Manual Airlock
If you'd rather tactile satisfaction of operating the airlock with the push of a button, simply forgo the sensors and add a button to toggle de-pressurise on the airlock air vent. Tagged doors will open and close automatically as required.
Oxygen Tanks
If an oxygen tank is tagged the script will allow doors to be operated manually when the tank is completely full or empty. There are no safeguards in this mode, so you are able open both doors and vent the ship's oxygen.
Sound
Sound blocks can be tagged, change the sound played by editing the code, look for "Alarm 1", "Alarm 2", (about line 45), replace with the name of the sound you want (as it appears in the sound block menu, case sensitive). Sound now works with arcade sound, and realistic mode!
LCD Displays
Tag status lights and/or LCD's to show the air-lock status, corner LCD's are ideal but regular LCD panels works too, wide LCD's not so much. The color indicates the pressure differential, the progress bar indicates the oxygen level inside the airlock.
Colors:
Green - pressure equalised, ok to open door
Yellow - not equalised, moderate pressure difference
Red - not equalised, high pressure difference
Colors are customisable.
Smooth color fade mode:
Custom LCD text
You can use use [title] your text here [/title] in the custom data of an LCD to display custom text on the LCD screens
Named Airlocks and airlock options
Add "name = your name here" to the custom data of the air vent tagged AL1V (the vent in the airlock) to set the name of the airlock. This name will show on the LCDs and the Status screen.
Status LCD
Shows the status of all airlocks.
Required
Optional
Use AL2XXX, AL3XXX etc. for multiple air locks.
Tags can go in the block name, or the custom data.
To tag a group the group name must be the tag and nothing else.
To get the script to run:
Load the script into a Programmable Block, timer no longer required.
DISABLE
disables all air locks, doors are set to On/unlocked, the state of the air-lock vents is configurable (default off).
ENABLE
returns all air-locks to normal operation.
VENT
Opens all air lock doors, use "ENABLE" to return to normal function.
SCAN
Re-scans for tagged blocks now.
(be default the script automatically scans every 10 seconds)
Setup
Example world: http://steamcommunity.com/sharedfiles/filedetails/?id=865605993
(includes a couple of alternative set-ups)
Air Vents
Tag one (or more) air vents for the air lock [AL1V], and one inside the ship [AL1I], additionally if the outer side of the air lock opens into an area that can be pressurised (eg. a hangar), or if you want the airlock to work on planets with atmosphere, you'll need to tag a vent in this outer area too [AL1O].
Doors
Tag an inner door [AL1I], and an outer door [AL1O]. (hangar doors work too).
Automatic Airlock
Add a sensor for each door, the sensor field should cover an area each side of the door, entering the sensor zone will open the corresponding door, cycling the airlock as necessary.
If the airlock room is large or takes a long time to traverse (eg. a hangar, a long hallway), you can add an optional intra-lock sensor [AL1S], this sensor zone should cover the entire air lock room. This way the room will pressurise as you traverse the room, rather than waiting until you reach the exit to start pressurising.
Manual Airlock
If you'd rather tactile satisfaction of operating the airlock with the push of a button, simply forgo the sensors and add a button to toggle de-pressurise on the airlock air vent. Tagged doors will open and close automatically as required.
Oxygen Tanks
If an oxygen tank is tagged the script will allow doors to be operated manually when the tank is completely full or empty. There are no safeguards in this mode, so you are able open both doors and vent the ship's oxygen.
Sound
Sound blocks can be tagged, change the sound played by editing the code, look for "Alarm 1", "Alarm 2", (about line 45), replace with the name of the sound you want (as it appears in the sound block menu, case sensitive). Sound now works with arcade sound, and realistic mode!
LCD Displays
Tag status lights and/or LCD's to show the air-lock status, corner LCD's are ideal but regular LCD panels works too, wide LCD's not so much. The color indicates the pressure differential, the progress bar indicates the oxygen level inside the airlock.
Colors:
Green - pressure equalised, ok to open door
Yellow - not equalised, moderate pressure difference
Red - not equalised, high pressure difference
Colors are customisable.
Smooth color fade mode:
Custom LCD text
You can use use [title] your text here [/title] in the custom data of an LCD to display custom text on the LCD screens
Named Airlocks and airlock options
Add "name = your name here" to the custom data of the air vent tagged AL1V (the vent in the airlock) to set the name of the airlock. This name will show on the LCDs and the Status screen.
Status LCD
Shows the status of all airlocks.
Tags
Required
Block
Tag
Air Lock Vents
AL1V
Inside Vent
AL1I
Optional
Block
Tag
Inner Doors, Inner Sensors, Inner Vent, Inner Status Lights, Inner Status LCD
AL1I
Outer Doors, Outer Sensors, Outer Vent, Outer Status Lights, Outer Status LCD
AL1O
Intra-Lock Sensor
AL1S
Oxygen Tank
AL1T
Sound Block
AL1S
Status LCD
ALSTAT
Use AL2XXX, AL3XXX etc. for multiple air locks.
Tags can go in the block name, or the custom data.
To tag a group the group name must be the tag and nothing else.
Set-up
To get the script to run:
Load the script into a Programmable Block, timer no longer required.
Arguments
DISABLE
disables all air locks, doors are set to On/unlocked, the state of the air-lock vents is configurable (default off).
ENABLE
returns all air-locks to normal operation.
VENT
Opens all air lock doors, use "ENABLE" to return to normal function.
SCAN
Re-scans for tagged blocks now.
(be default the script automatically scans every 10 seconds)