Space Engineers

Space Engineers

Not enough ratings
Smart Reactive Rooms (Oxygen + Pressure)
   
Award
Favorite
Favorited
Unfavorite
File Size
Posted
2.549 KB
14 Jan, 2016 @ 3:50pm
1 Change Note ( view )

Subscribe to download
Smart Reactive Rooms (Oxygen + Pressure)

Description
***UPDATE: I am sorry for the absense I just got burnt out for a while however I am currently busy working on a rework of the system that should hopefully solve many of the problems***

Descrption
Make your rooms react to pressure and oxygen levels in an intelligent way (Works with Vanilla).

This mod allows you to tag blocks to have them react when the room depressurizes. This is achieved by adding a room name surrounded by <> to the name of the air vent. Then by adding the same room name tag to specific blocks (Instructions on how to do this are further down).The script will detect when the room loses pressure and adjusts that rooms state accordingly then the blocks linked to that room will also react accordingly.

A Quick example of the scripts capability:
The ship came under fire and there is a breach in the engineering bay. So the system kicks in, turning certain indicator light to red letting you know that the area is depressurized. The system will also close any doors that are connected to the engineering room so that the connected rooms can stay pressurized. An alarm sounds and by looking at the LCD screen from somewhere else on the ship you could see that the engineering bay is depressurized and has no oxygen.

States:
state 0 - When the room is pressurized and has oxygen (normal happy state)
state 1 - When the room is pressurizable (no holes) but there is no oxygen (often because the vent is turned to depressurize)
state 2 - When there is a breach in the room that means that it cannot be pressurized.

A Quick Note:
When I get back to my main system and with a semi-decent mic I wil create a video tutorial. However in the mean time feel free to drop a comment if you get stuck and I will do my best to help you. Also if you have any suggestions for adding further functionality also feel free to drop a comment as I plan on continually adding new functionality through the Extra Functions.

Blocks and their default interactions:
These are the current blocks and the default actions they will have when the room changes state:

1: Doors (including hangar and modded doors) - The doors that are connected to a room that has lost pressure or oxygen (state 1 or 2) are automatically closed thus sealing off the depressurized area.

2: Interior Lights - You can tag a light to change colour when the tagged room is in the different states (state 0 = Green, state 1 = Yellow, state 2 = Red). This is especially useful to have on the other side of the door so someone will know if the room they're about to enter has pressure.

3: Sound Blocks - You can have the sound block sound the set alarm when the tagged room is in state 2.

4: Text Panels (LCD) - The LCD will display the total percentage of oxygen you have in the tanks. As well as each room and its current state and oxygen level.

There are also extra features that you can enable for certain blocks that will be explained after the instructions:

Instructions:
Step 1: Place a timer block and Programming block (import the script to the programmable block). set the timer blocks timer to 1 second (all the way to the left)

Step 2: Set up the actions of the timer block to run the script in the programmable block with default arguments then make the timer trigger itself (for a loop).

Step 3: Add a room tag to the room's air vent (an air vent can only have one area or room tag if there is more than one it will use the first one). You can add a room or area tag to it by typing any name that willl then be used to identify that room by surrounding the name you wnat to assign to the room with <> in the air vents name (e.g. <Engineering>)
Example of a name of a vent: Air vent <Engineering>

Step 4: Add the same room tag to any blocks that belong to the room (these blocks e.g. a door can have multiple tags so for example a door can have 2 tags e.g. <Engineering>, <Living> so that the door will react to either and both rooms). These blocks will now react when the air vent with the same area tag changes state.
Example name of a door: Door 1 <Engineering> <Living>

Step 5: You may (optional) set up an LCD (text) panel which does not need an area tag but instead has to contain the letters SRR in its name.
Example of a name of an LCD screen: SRR Screen 12

Extra features:
These are a list of extra commands you can have with the blocks to have alterred actions. These are done by having the relevant tag in the name of the object (e.g. [Exit])

1. Doors: [Exit] - This will mark this door to not automatically close and also allows it to be opened when there is no pressure (useful for hangar or exit doors from the ship). It will also mean that the system will not go to state 2 when the door is open but rather stay in state 1.
Example: Door 2 <Engineering> [Exit]

2. Lights: [Global] - This will mark the light to change color not based on its rooms state but rather the entire ship or stations state. e.g. If any room goes to state 2 this light will go to state 2.
Example: Interior Light 23 [Global]

3. Sound Blocks: [Global] - This will work in the same way that the Lights [Global] works.
Example: Alarm 2 [Global]

4. Text Panels: [Help] - This is a special command that can be added to any text panels name (even those that don't have "SRR") and will make this panel show a short help screen listing the naming conventions and Extra features of this mod for easy access.
Example: Text Panel 3 [Help].

Please note: Area tags and Extra feature tags are case sensitive.

Planned features:
- Allow for the customization of light and screen colors
- Allow you to set up a button to override the door controls for a room (for if you need to get in regardless of it being depressurized)
- Making the tags case insensitive (i only realized after I had published the script that I was an idiot and made the tags case sensitive, it is an easy fix but I will push this change out at the same time as some planned features.
Popular Discussions View All (1)
1
10 Jul, 2018 @ 4:41pm
Some errors in code
RexTheCapt
13 Comments
NomadHook  [author] 26 Jul, 2016 @ 1:55am 
Just going to add this here aswell: ***UPDATE: I am sorry for the absense I just got burnt out for a while however I am currently busy working on a rework of the system that should hopefully solve many of the problems***
Cypress 25 Jul, 2016 @ 3:19pm 
Zero Ghost - I get that when ownership of one of the blocks isn't set to me most often. Can be a lot of things - missing tags, etc. but if you did everything right, check ownership.

That said - nice looking script - surprised it isn't more popular, and hope it works as well as you say!
zeroGhost 11 Jun, 2016 @ 3:43pm 
"Caught exception during execution of script:Object reference is not set to an instance of an object"
any idea of fixess????
floatybones 17 May, 2016 @ 9:58pm 
Could you perhaps make changes to the alarms? As it is, the Alarms seem to trigger several times a second, making the sounds awkwardly start and stop repeatedly. I'd love to use the sound blocks with this script but it's harsh on the ears as it is.
NomadHook  [author] 14 Feb, 2016 @ 3:51am 
Hahahahaha Okay thanks. Glad it sorted itself out
Zanzikahn 13 Feb, 2016 @ 1:49pm 
Don't worry about it. It fixed itself, lol. I did some reading and found out that the error I was gettting is something that sometimes jsut randomly pops up for no reason except for a bugged game affecting the programming block itself.
NomadHook  [author] 13 Feb, 2016 @ 1:18pm 
I'll take a look at it tomorrow. probably something silly
Zanzikahn 12 Feb, 2016 @ 5:43pm 
With the update came an error. It says, "Caught exception during execution of script:Object reference is not set to an instance of an object".
FPC 27 Jan, 2016 @ 8:22pm 
Awesome :)
NomadHook  [author] 27 Jan, 2016 @ 11:39am 
Thats a good idea and I will probably look into it when I get back to my desktop in Feb