Space Engineers

Space Engineers

Not enough ratings
Save Oxygen, safe, hangar, doors, lights
   
Award
Favorite
Favorited
Unfavorite
File Size
Posted
Updated
407.124 KB
28 Aug, 2022 @ 3:25pm
2 Sep, 2022 @ 6:45am
8 Change Notes ( view )

Subscribe to download
Save Oxygen, safe, hangar, doors, lights

Description
This script allows to:

* Close doors when room loses oxygen, oxygen level is lower then 50% (depressurized room)

* Turn ON/OFF light(s) when room loses oxygen, oxygen level is lower/higher then 50% (depressurized room)

* Safe Open and Close Hangar Door(s)

* * Safe Open is: retrieve the oxygen from the room to the oxygen tank(s) and when finished open the hangar door(s)

* * Safe Close is: after the hangar door is closed is turn on the air vent, start pressurizing

* Prints Air Vent oxygen level on text surface(s)/LCD text panel(s)

* Controls limitless rooms with only one "Programmable Block"

* The configuration is on the "Custom Data" of the "Programmable Block"

* Configure only what you want, what you using, leave it blank what you don't use. For example:

* * You can setup only the doors to close, no lights, no hangar doors, no printing on LCD

** You can setup only the lights

** you can setup to only safe open/close hangar door(s).

* Setup auxiliary Air vent that will be active when still has reused oxygen from the room. The main Air Vent(s) (AirVentName) will be disabled until the room has more than 65% oxygen (Take damage only below 50%)

Instructions:

Copy&Paste this (configuration)text on the "Custom Data" of the "Programmable block"

[Room_AirVented1] AirVentName= LightsGroupName= LCDTextPanelName= DoorsGroupName= HangarGroupName= AuxiliarAirVentName= AutoLock= ChangeColorLightsGroupName= LightOriginaColor= LightAlertColor= ShowDepressurize= ShowStatus= ShowAutoLock= ShowTanksFilledRatio= ShowOpenDoors= ShowRoomName= [Room_AirVented2] AirVentName= LightsGroupName= LCDTextPanelName= DoorsGroupName= HangarGroupName= AuxiliarAirVentName= AutoLock= ChangeColorLightsGroupName= LightOriginaColor= LightAlertColor= ShowDepressurize= ShowStatus= ShowAutoLock= ShowTanksFilledRatio= ShowOpenDoors= ShowRoomName=

Its set to 2 rooms but you can add or remove, when you add, must start with [Room_AirVented*] after the name "Room_AirVented" (*) must be a different number or name.

put names of the corresponding blocks or groups in front of "=", example:

[Room_AirVented1] AirVentName= Air Vent LightsGroupName=Rotating Light 2 LCDTextPanelName= LCDs Hangars DoorsGroupName=Door HangarGroupName=Hangar Door 1 AuxiliarAirVentName=Air Vent 2 AutoLock=on ChangeColorLightsGroupName=Corner Light - Double LightOriginaColor=255,255,255 LightAlertColor=255,0,0 ShowDepressurize=on ShowStatus=on ShowAutoLock=on ShowTanksFilledRatio=on ShowOpenDoors=on ShowRoomName=on [Room_AirVented2] AirVentName=Air Vent 3 LightsGroupName= LCDTextPanelName=LCDs Hangars DoorsGroupName=Door HangarGroupName=Gate AuxiliarAirVentName= AutoLock=on

"AirVentName": can be the name of one block(Air Vent) or the name of the group.
A group of air vent may be needed for one connected to oxygen generator and other only connected to tanks to collect oxygen from the room when depressurizing.

"LightsGroupName": can be the name of one block(any kind of Light) or the name of the group. It will turn on when oxygen higher then 50% and turn off other wise.

"LCDTextPanelName": must be the name of one block(any type of panel), but it can be the same on different "Room_AirVented*", it will append.

"DoorsGroupName": can be the name of one "Door" block or a group. Can be any type of doors, anything that has open and close command.
It works similar to lights, if oxygen lower then 50% it will close.
There is a command to safe open and close this door(s)

"HangarGroupName": can be the name of one "Door" block or a group. Can be any type of doors, anything that has open and close command.
There is a command to safe open and close this door(s)

To Safe Open: "Run" the "Programmable block" with the argument: open mydoor
In my example the argument should be: open Hangar Door 1
or: open Gate
Similar to Safe Close: use the argument: close mydoor

Example
* On Sensor, in "Setup Actions" Drag the "Programmable block" and select "Run" it will ask the argument, first toolbar should be similar to: open myDoor, and the second: close myDoor (Replace the word mydoor with the name of corresponding door)

* to setup a button: On the "Button Panel", "Setup Actions" Drag the "Programmable block" and select "Run" it will ask the argument

If you connecting the grid by remotely, one option is to setup the argument on the "Programmable block" and hit "Run"

"AuxiliarAirVentName": this is optional like almost every other parameters.
This parameter should have the name of one block or group(Air Vent) that is not connected to oxygen generator and only connected to oxygen tanks, it collects oxygen from the room when the room is depressurized, before opening the hangar door(s), when the hangar closes, it will run alone until his tanks are empty, the air vent connected to oxygen generator will be disabled until the auxiliary air vent delivers oxygen.
Because the air is breathable until 50% oxygen in the room the main air vent only will be activated when the oxygen drops to 65%.

"AutoLock": When is "on" it will disable some doors to avoid opening manually by distraction.
Doors affected with this "auto disable" is the ones that is opened by this script, it will apply to a door only after the first command "open ****" or "close ****"
If you have some doors that this script affects but never used the commands open/close it will never disable them unless it was previusly disabled, it will preserve the previous status.

"ChangeColorLightsGroupName": name of one block or group of type Light, that wil change to "LightAlertColor" if room loses oxygen and "LightOriginaColor" otherwise, must be 3 o 4 numbers from 0 to 255, separated by comma, example:
ChangeColorLightsGroupName=Corner Light - Double
LightOriginaColor=255,255,255
LightAlertColor=255,0,0

More controls over the panel:
* ShowDepressurize
* ShowStatus
* ShowAutoLock
* ShowTanksFilledRatio
* ShowOpenDoors
* ShowRoomName




v1.01 29/08/2022
"AirVentName": now accepts the name of one block or group of blocks of type "Air Vent"

v1.02 29/08/2022
"LCDTextPanelName": can now be a name of one block or a group of text panels(any kind of writable panels)
For example in 2 different rooms I can see both rooms oxygen status if both panels are in one group.

New parameter on "Custom Data" on "Programmable block": "AuxiliarAirVentName"

Before safe open hangar the other doors(DoorsGroupName) are forced closed avoiding connected room depressurization.

The initialization of the parameters, the "Custom Data", is only read once, so if you change it, click on "Recompile" on "Programmable Block"

Some other minor improvements/optimizations made on the script, for example showing incorrect parameters inside Programmable block on the right side.

v1.03 30/08/2022
Added the possibility to safe open doors set in "DoorsGroupName"
"DoorsGroupName" can be a name of one door or group, this doors can be from interior or with access to exterior.

v1.04 31/08/2022
Added more safety measures by adding a new parameter "ForceAuto" "AutoLock" that when is "on" it will disable some doors to avoid opening manually by distraction.

v1.05 01/09/2022
Added setup light to change color when room loses oxygen
Added more control over what is shown on panel

Check the "Change Notes" for more info.
8 Comments
adam_sunlight  [author] 26 Jun, 2024 @ 9:01am 
After checking this script, its not possible that it dump all oxygen. It only interacts with blocks set on "Custom Data" configuration. And it only changes the state of air vents after activating the PB with open or close on run argument.
And if you certain that it was immediately after editing the PB maybe is because of some module you have installed.
Syphond 25 Jun, 2024 @ 4:24pm 
Let me simplify. 1. Build pb. 2 load script to pb. 3. All vents on grid immediately dump all oxygen out. It's not about the naming or the custom data I need to edit. I literally placed the script in the ob and before I could do anything else the vents blew out all the oxygen in my tanks.
adam_sunlight  [author] 25 Jun, 2024 @ 3:31am 
in one grid with multiple rooms there is allot of vents and doors, and not all doors are doors to outside, is not easy to auto discover what vents and doors belong to a room we are. The way to indentify all important blocks are by naming with special name or indentify them on the "Custom Data"/configuration. In this case you don't need to rename nothing only to make the groups if needed and put them on the configuration(Custom Data)
Syphond 24 Jun, 2024 @ 7:11pm 
I didnt even get as far and naming anything. Why bother when every vent suddenly expelled all my oxygen before I could. I litterly buit a pb. Installed script. Vents expelled all oxygen from tanks. Then had weird vent issues and air pockets. Had to grind down all blocks and rebuild plus reload to fix. Didn't even have time to set up the custom data field.
adam_sunlight  [author] 24 Jun, 2024 @ 3:15am 
I just tested and I see it working, check more carefull the configuration, The o2 tanks are expeled thru the air vents to a close room, maybe the door you open is not set in DoorsGroupName, when running the pb thru button or sensor, always put argument "open" or "close" followed by "name_of_door_or_group" that is already set on configuration "DoorsGroupName" (custom data)
If you set AutoLock=on you should not be able to open door manualy, make sure the air vent names are in correct location, one is for putting air(AirVentName) the other is to remove to save air(AuxiliarAirVentName).
The just installing is not enought, need to set the custom data properly.
Syphond 23 Jun, 2024 @ 7:12pm 
This script is broken. On two different saves when using just installing it to a pb causes ever vent to expell all air from my o2 tanks.
adam_sunlight  [author] 29 Aug, 2022 @ 4:16pm 
Update done!
adam_sunlight  [author] 29 Aug, 2022 @ 4:01am 
Because the auxiliary air vent made only to collect oxygen from the room during depressurization is filling pretty fast the oxygen tanks, soon as I can I will update the script, turning off the air vent connected to oxygen generators until the auxiliary air vent has empty his tanks.