Space Engineers

Space Engineers

29 ratings
Hull Breach Alert (Sound + Script)
   
Award
Favorite
Favorited
Unfavorite
Type: Mod
Mod category: Script, Other
File Size
Posted
Updated
404.772 KB
28 Jul, 2015 @ 5:36am
8 Aug, 2015 @ 12:11pm
2 Change Notes ( view )

Subscribe to download
Hull Breach Alert (Sound + Script)

Description
What it does:

- Adds a sound to the soundblock (female robotic voice)
- If used with the following script, it detects and warns you of hull breaches
- The voice says Warning, possible hull breach detected.
("Possible", because it might just be an open door. :D)
- Added 2nd sound: Warning, hull breach detected.

Use in combination with this script:
Link below is for the lazy guys, who want to use the ingame workshop to paste in the script and for those who don't like the sound, I provided or play the game vanilla.
http://steamproxy.net/sharedfiles/filedetails/?id=489701020


void Main() {

var airVents = SearchBlocksByName("Air Vent");
var pressureStatus = "Pressurized";

string soundBlockName = "Sound Block Hull Breach";

List<IMyTerminalBlock> mySoundBlock = new List<IMyTerminalBlock>();

GridTerminalSystem.SearchBlocksOfName(soundBlockName, mySoundBlock);

for (int i = 0; i < airVents.Count; i++) {
string pressureInfo = airVents.DetailedInfo;
if(pressureInfo.IndexOf("Not pressurized") != -1) {
if(pressureStatus == "Pressurized")
pressureStatus = "Depressurized";
}
}

for(int j = 0; j < mySoundBlock.Count; j++){
if(pressureStatus == "Depressurized") {
mySoundBlock[j].GetActionWithName("PlaySound").Apply(mySoundBlock[j]);
}
}
}

List<IMyTerminalBlock> SearchBlocksByName(string blockName) {
var blocks = new List<IMyTerminalBlock>();
GridTerminalSystem.SearchBlocksOfName(blockName, blocks);
return blocks;
}


How to use:

- Setup a ship or station with one or multiple air-sealed rooms.
- Place a timer block, a programmable block and a soundblock
- Make sure you placed air vents
- Every air vent must have the words "air vent" in it's name without quotes
- Name the soundblock: "Sound Block Hull Breach" without quotes and select the Hull Breach sound
- Set the timer block to 8 seconds and make it "run" the programmable block, aswell as repeat itself
- I chose 8 seconds, because the sound is 3 seconds long and i wanted to have 5 seconds between warnings, obviously you can change the value however you like, but if you go to 3 seconds or less you'll have a constant warning

For use in rooms with doors leading outside:

- Place a button and a timer block
- Set the button to make the timer block Trigger Now
- Set the timer block actions to open/close the door AND turn on/off the soundblock
- Be aware, this method simply turns off the soundblock while the door is open, so you won't be warned if there actually is a hull breach while the door is open

Did it work?:

- Pressurize the rooms
- Delete a block, so a room gets depressurized
- Within 8 seconds the soundblock should warn you
9 Comments
EnGinEAR 10 Apr, 2021 @ 9:10pm 
@maniac you could use visual script builder to do that, just google it
Twiz 5 Jul, 2020 @ 8:46am 
yeah this doesn't work
J_1111 30 Mar, 2020 @ 5:52am 
This was one of the mods that caused an error in my loading a saved game. When I removed it (with the other ones) from my mod list, I was able to then load the saved game successfully. Just an FYI to the author.
Slimbo  [author] 9 Jan, 2018 @ 10:11am 
hahahahaha good one :KSmiley:
Hull Breach 8 Jan, 2018 @ 5:35pm 
For some reason I like the name of this mod.
MasterNuts 22 Apr, 2017 @ 10:19pm 
Could the process work by clustering all sound blocks, and naming the group as "Sound Block Hull Breach"?
JamesWat127 9 Oct, 2016 @ 8:33pm 
good piont
Maniac 16 Feb, 2016 @ 9:20pm 
"but if you depressurize a room using an air vent the alarm doesn't go off. "

Yes, the alarm does go off, if there's a door open. What this script could do, and I hope to someday understand enough about scripts modify it, is check to see if the vent is set to depressurize, before activating the alarm. This could be useful in two ways.

One: A room, like a hangar, that's depressurized, before (or even after) opening, would not set off the alarm, as it is intentional

Two: The alarm could be silenced, by setting all air vents to depressurize.
Slimbo  [author] 9 Aug, 2015 @ 8:37am 
Not sure if that helps you but if you depressurize a room using an air vent the alarm doesn't go off. Only if you open the door and don't use a timer block to deactivate the sound block, but the alarm won't go off if you open the door, go through and close it back up. But yeah if you could actually check a room for it's hull integrity by checking the armor blocks, that would be awesome. :D: