Space Engineers

Space Engineers

View Stats:
Voin Jul 3, 2016 @ 3:29am
is it possible for a air breach to be detected and then it can trigger and air tight block to close?
ive got the idea from games and films and such like star wars and infinate warfare. so the thing is, because glass is easy to break and destroy and mot much good armour. well if i put an airtight hanger block behind it so if its breached (the glass) it cna pull up and keep the air! is this possiable though?
< >
Showing 1-10 of 10 comments
Roddy_McRizzle Jul 3, 2016 @ 5:29am 
There are some scripts out there that can control pressurization and such.
Loues.S.Cat Jul 3, 2016 @ 5:50am 
Air vents can be used to detect a sealed enviornment.
Check the detailed info. if it says not pressurised then there is abreach somewhewre. if it gives apercentage from 0 to 10% then it is sealed.
You could also have the vent triger an event when the o2 level drops to 0%, but that wont work on earth like oralien worlds, or anywhere there is an 02 atmosphere. this could be done without scripts, but is less reliable.
Voin Jul 3, 2016 @ 6:00am 
k, thanks for the idea loues
Voin Aug 25, 2016 @ 9:09am 
Originally posted by Loues.S.Cat:
Air vents can be used to detect a sealed enviornment.
Check the detailed info. if it says not pressurised then there is abreach somewhewre. if it gives apercentage from 0 to 10% then it is sealed.
You could also have the vent triger an event when the o2 level drops to 0%, but that wont work on earth like oralien worlds, or anywhere there is an 02 atmosphere. this could be done without scripts, but is less reliable.
ok so ive had a look, and i cant find any detect preassure levels. am i doing it wrong?
Loues.S.Cat Aug 25, 2016 @ 9:38am 
http://steamcommunity.com/sharedfiles/filedetails/?id=751662236
http://steamcommunity.com/sharedfiles/filedetails/?id=751662675
http://steamcommunity.com/sharedfiles/filedetails/?id=751663053

You have access to the description of the block through the detailed info variable.
It will change depending on whether O2 is disabled, or the room is open to exterior space, or closed off.
You can get that information through string parsing the detailed info.
There may be a beter way to check, but I can barly get O2 enabled worlds to load at all so it can be tricky to try anything out.

And on an unrelated detail I just spotted because of taking those snapshots, Steam tags uploaded screenshots with sequential IDs. I wonder if you can use that to snoop hidden screenshots... That would be why youtube doesn't use sequential IDs :p
Voin Aug 25, 2016 @ 9:45am 
Originally posted by Loues.S.Cat:
http://steamcommunity.com/sharedfiles/filedetails/?id=751662236
http://steamcommunity.com/sharedfiles/filedetails/?id=751662675
http://steamcommunity.com/sharedfiles/filedetails/?id=751663053

You have access to the description of the block through the detailed info variable.
It will change depending on whether O2 is disabled, or the room is open to exterior space, or closed off.
You can get that information through string parsing the detailed info.
There may be a beter way to check, but I can barly get O2 enabled worlds to load at all so it can be tricky to try anything out.

And on an unrelated detail I just spotted because of taking those snapshots, Steam tags uploaded screenshots with sequential IDs. I wonder if you can use that to snoop hidden screenshots... That would be why youtube doesn't use sequential IDs :p
lol yeah but is still dont get it. put it this way, would it be possible to program a senser to detect air preassure levels. and if so, can teh send out commands
Loues.S.Cat Aug 25, 2016 @ 9:58am 
Originally posted by sovient assassin:
Originally posted by Loues.S.Cat:
http://steamcommunity.com/sharedfiles/filedetails/?id=751662236
http://steamcommunity.com/sharedfiles/filedetails/?id=751662675
http://steamcommunity.com/sharedfiles/filedetails/?id=751663053

You have access to the description of the block through the detailed info variable.
It will change depending on whether O2 is disabled, or the room is open to exterior space, or closed off.
You can get that information through string parsing the detailed info.
There may be a beter way to check, but I can barly get O2 enabled worlds to load at all so it can be tricky to try anything out.

And on an unrelated detail I just spotted because of taking those snapshots, Steam tags uploaded screenshots with sequential IDs. I wonder if you can use that to snoop hidden screenshots... That would be why youtube doesn't use sequential IDs :p
lol yeah but is still dont get it. put it this way, would it be possible to program a senser to detect air preassure levels. and if so, can teh send out commands


Nope.
Only vents detect Air PResure. Sensors don't register anything to do with it.
Vents can opperate in a similar way to sensors but only trigger once when presure hits 100% or 0% and at no other times. (this could be an issue if you were on mars, or earth, or anywhere with a non-zero atmospheric pressure)
If you want to get a reliable reading of pressure between those values you need to have a script check the vents detailed info periodicly. once you do that you can easily see when you have a hull breach or an open exterior airlock.
I can write up a basic method to do it, but it would be up to you to apply it where you want it.
Dantheotherone Aug 25, 2016 @ 10:17am 
Originally posted by sovient assassin:
Originally posted by Loues.S.Cat:
http://steamcommunity.com/sharedfiles/filedetails/?id=751662236
http://steamcommunity.com/sharedfiles/filedetails/?id=751662675
http://steamcommunity.com/sharedfiles/filedetails/?id=751663053

You have access to the description of the block through the detailed info variable.
It will change depending on whether O2 is disabled, or the room is open to exterior space, or closed off.
You can get that information through string parsing the detailed info.
There may be a beter way to check, but I can barly get O2 enabled worlds to load at all so it can be tricky to try anything out.

And on an unrelated detail I just spotted because of taking those snapshots, Steam tags uploaded screenshots with sequential IDs. I wonder if you can use that to snoop hidden screenshots... That would be why youtube doesn't use sequential IDs :p
lol yeah but is still dont get it. put it this way, would it be possible to program a senser to detect air preassure levels. and if so, can teh send out commands


The airvent has a sensor on it. There are two input boxes just like the sensor block has.

The one on the left triggers if there is pressure and the other one triggers when pressure is lost.

You can prove this to yourself if you want.

I use Lone Survivor as a test world. Start it in creative (to make it easier) and build an enclosed room big enough for a oxygen generator and airvent. Also put a door on it.

Go into the control panel on the airvent and select "Set actions" then you will see the two command inputs. On the right one put the door and set it to close.
Now open the door. After the air escapes the airvent should close the door.

You can also use timer blocks for more actions like turning on red lights and sounding a warning plus closing doors.

I hope this helped you.
Loues.S.Cat Aug 25, 2016 @ 10:34am 
As I said the vents events only triggers at 0% and 100% which means any other condition wont trigger them, including being on any planet with a non-zero atmosphere.
They also wont tell you if the event was caused by a breach or caused by being depresurised by another vent.
Using string parsing on the detailed info you can tell if an area is exposed to the exterior enviornment allowing you to detect breaches, and that will work on any planets, even ones with 100% atmosphere (avoiding nasty surpises when you leave that atmosphere).
Last edited by Loues.S.Cat; Aug 25, 2016 @ 12:27pm
Loues.S.Cat Aug 25, 2016 @ 12:18pm 
Well, pasing code onto the steam forum has just about never worked, but I havent done it in a while so here goes.

The function of intrest is "int isAreaSealed( IMyTerminalBlock block )"

It returns an int which will be:
0 if O2 is turned of in the world,
1 if the room isexposed to exterior space,
2 if the room is sealed and thus the vent can presurise/depresurise it

It will also return a range of negative numbers depending on what kind of failure happens. basicly if it returns anything less than 0 something went wrong.

The terminal block to be passed into it must be a vent, ( possibly even a mod vent provided the detailed description of the mod vent follows the same format as the default vent )

I used regex string parsing to identify the difrent states, so people can feel free to poke fun at his monder: pattern = new System.Text.RegularExpressions.Regex( @"^[: a-zA-Z0-9]*[\n|\r\n]?[\\.: a-zA-Z0-9]*[\n|\r\n]?(([ a-zA-z]*)|([: a-zA-Z]*)|([\.%: a-zA-Z0-9]*))$" ); but doing so without providing at least an equaly functional alternative will at best only make me roll my eyes.

Sadly, string parsing can be language sensative so this may not work in all cases, but hey, with examples of the other language strings... //someone// that knows how to deal with the relavent font/special characters will likely be able to produce a working regex patern again

string TARGET_VENT = "[APC] Vent [Engineering]"; System.Text.RegularExpressions.Regex pattern; // set by script /** Output 0: o2 disabled 1: room not sealed 2: room sealed Output Errors -5: match but not known state??? (no idea why this would happen) -6: null block passed in -7: description match failed ( not a vent type block???) -8: WTF */ int isAreaSealed( IMyTerminalBlock block ) { if( block == null ) { return -6; // Error: null block value pased in } else { System.Text.RegularExpressions.Match match = pattern.Match( block.DetailedInfo ); if ( match.Success ) { for( int e = 2; e <= 4; e++ ) { // 0: whole matched string // 1: last line // 2-4 test groups System.Text.RegularExpressions.CaptureCollection cc = match.Groups[e].Captures; // only asingle match should be made for each group if( cc.Count != 0 ) { //Echo( " " + "Got: "+ i +" = '"+ cc[0] ); return (e-2); // Output: Good match made } } return -5; // Error: not a known match type ( should only happen if pattern string is changed ) } return -7; // Error: no match made ( possible causes: wrong block type pased in // detailed info changed // incompatable language ) } return -8; // Error: WTF ( The function would have to be edited for this to happen ) } public Program() { // called at world load // if line 3 is only a-Z then O2 is off, // if line 3 contains : and no % then the room is open // if line 3 contains : and % then o2 is on and room is sealed // litteral line:: "Oxygen disabled in world setings" // "Room pressure: Not pressurised" // "Room pressure: 100.00%" pattern = new System.Text.RegularExpressions.Regex( @"^[: a-zA-Z0-9]*[\n|\r\n]?[\\.: a-zA-Z0-9]*[\n|\r\n]?(([ a-zA-z]*)|([: a-zA-Z]*)|([\.%: a-zA-Z0-9]*))$" ); } /* public void Save() { // called at save Echo( "SAVE" ); // Nope } */ public void Main( string strIn ) { // called at run //Echo( "ET: "+ ElapsedTime ); // Legacy //Echo( "ET: "+ Runtime.TimeSinceLastRun ); // detailed Echo( "ET: "+ Runtime.TimeSinceLastRun.TotalSeconds ); // EOR Echo( " CAT - Default" ); IMyTerminalBlock block = GridTerminalSystem.GetBlockWithName( TARGET_VENT ); int val = isAreaSealed( block ); Echo( "VaL "+ val ); //Log = "RUN"; }

Edit: blast "i" parsing to italic even in code blocks X.x
Last edited by Loues.S.Cat; Aug 25, 2016 @ 12:25pm
< >
Showing 1-10 of 10 comments
Per page: 1530 50

Date Posted: Jul 3, 2016 @ 3:29am
Posts: 10