Space Engineers

Space Engineers

View Stats:
Triggering sound blocks when exiting a cryo pod
I am trying to have a sound block trigger when I exit a cryo pod, but the only way I found is a sensor which you have to stand near then enter the cryo pod so when you exit it triggers. The problem with that is then it triggers when I enter the cryo pod from that spot. So does anyone know some way to get it to trigger only when I exit the cryo pod?
< >
Showing 1-7 of 7 comments
ShadedMJ Mar 2, 2017 @ 5:55pm 
This is off the top of my head.

Sensor#1 in cryopod room as you have it, plays sound block as you have it.
Sensor#2 in hallway to cryopod room that activates TimerBlock#1 immediately.
TimerBlock#1 shuts off sound block and starts TimerBlock#2
TimerBlock#2 with 20 second or so delay that puts sound block on (not play though).

Player goes through hallway, activates sensor#2 that shuts off sound block, goes to cryopod that plays sound block that is off for 20 seconds while player enters cryopod.

Player exits cryopod, activates sensor#1, sound plays, leaves room, activates sensor#2 which shuts off the sound block for a while but who cares since they are leaving.


TestSubject_2519 Mar 2, 2017 @ 6:33pm 
thanks that should work
Loues.S.Cat Mar 2, 2017 @ 7:18pm 
You could also have a script check if someone is in the cryopod, log that status and only play the sound when that state changes, or specificity when the state changes from occupied to unoccupied
TestSubject_2519 Mar 2, 2017 @ 7:30pm 
Originally posted by Loues.S.Cat:
You could also have a script check if someone is in the cryopod, log that status and only play the sound when that state changes, or specificity when the state changes from occupied to unoccupied
if I can figure out how
ShadedMJ Mar 2, 2017 @ 8:03pm 
Originally posted by Loues.S.Cat:
You could also have a script check if someone is in the cryopod, log that status and only play the sound when that state changes, or specificity when the state changes from occupied to unoccupied

I thought about suggesting programming block, but didn't want to take tadkins320 down that potentially frustrating route.
I checked my sources and it doesn't look like the cryopod has any data that can be used by the programming block (no "occupied" variable). My sources might be out of date though.
Loues.S.Cat Mar 2, 2017 @ 8:06pm 
use the IMyShipControler interface rather than the IMyCryoChamber interface

A really, really crappy script that does so:
string gs_CryoPodName = "[APC] Cryo Chamber [Loues]"; string gs_SoundBlockName = "[APC] Sound [ALERT-A]"; bool CryoState = false; public void Main () { if( isPiloted( gs_CryoPodName ) != CryoState ) { CryoState = !CryoState; if( !CryoState ) { playSound( gs_SoundBlockName ); } } } public void playSound( string soundBlockName ) { IMyTerminalBlock block = GridTerminalSystem.GetBlockWithName( soundBlockName ); if( block != null && block.BlockDefinition.ToString().Contains( "Sound" ) ) { Echo( "Got Sound Block" ); (block as IMySoundBlock).ApplyAction( "PlaySound" ); } else { Echo( "Didn't Get Sound Block" ); } } public bool isPiloted( string cryoName ) { IMyTerminalBlock Pod = GridTerminalSystem.GetBlockWithName( cryoName ); bool piloted = false; if( Pod != null && Pod.BlockDefinition.ToString().Contains( "CryoChamber" ) ) { Echo( "Got Cryo Chamber" ); if( (Pod as IMyShipController).IsUnderControl ) { piloted = true; } } else { Echo( "Didn't Get Cryochamber" ); } return piloted; }
Last edited by Loues.S.Cat; Mar 2, 2017 @ 8:06pm
TestSubject_2519 Mar 2, 2017 @ 8:32pm 
I will try it.
< >
Showing 1-7 of 7 comments
Per page: 1530 50

Date Posted: Mar 2, 2017 @ 5:28pm
Posts: 7