Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

FPSC Classic Product Chat / Play sound from Trigger Stop sound when entity is destroyed is it possible?

Author
Message
Troutflies
15
Years of Service
User Offline
Joined: 24th Feb 2011
Location: Stuck outside my map.
Posted: 2nd Jan 2012 00:50
Hello All,

I have a section of my map where the player walks into an area that has the camera from MP2, the player can avoid beeing "seen" by the camera by staying low (I have set the trigger up off the ground so if he croutches he's fine but if he stands he'll trip the trigger and set off an alarm, complete with blinking lights and a siren. I have the loopsound action in the trigger's fpi. I would like the player to destroy the camera and shut the alarm off along with the lights. Can anyone help. I searched the forums and I couldn't find anything. I know you can shut off a soundzone with a switch (Community Guide) but I would like it to shut off when camera is destroyed
BlackFox
FPSC Master
18
Years of Service
User Offline
Joined: 5th May 2008
Location: Knight to Queens Bishop 3
Posted: 2nd Jan 2012 03:24
This is a script issue, and should be posted in the Script's section.

Quote: " I know you can shut off a soundzone with a switch (Community Guide) but I would like it to shut off when camera is destroyed "


You can either use the "settargetname=x" and "activatetarget=x" commands in the camera script. When it gets destroyed, it can activate the sound trigger and have it destroy. OR you can set a global variable to a value of X, and if the camera is destroyed, the sound script checks that variable in a loop state and can be stopped if that value is reached.

If the camera is the main script and controls the sound and lights, then it can also stop the sound once it is destroyed if a sound is either attached to the camera properties and referenced in the script using "sound=$0" or "sound=$1".


Twitter: @NFoxMedia
Troutflies
15
Years of Service
User Offline
Joined: 24th Feb 2011
Location: Stuck outside my map.
Posted: 2nd Jan 2012 04:01
My apologize Black, I wasn't sure if it was a scripting thing or a entity thing. Thanks for the answer.
BlackFox
FPSC Master
18
Years of Service
User Offline
Joined: 5th May 2008
Location: Knight to Queens Bishop 3
Posted: 2nd Jan 2012 04:41
No worries.

Generally if you are asking how to get an entity to "do something", 99% of the time it is a script issue. This way we keep the script stuff all together instead of all over the place.


Twitter: @NFoxMedia
Troutflies
15
Years of Service
User Offline
Joined: 24th Feb 2011
Location: Stuck outside my map.
Posted: 2nd Jan 2012 21:59
When i use the settargetname=x Does X=1 or 0 or does it =the entities name? I would assume(we al know what happens when we do that) that activatetarget=x x would =1
BlackFox
FPSC Master
18
Years of Service
User Offline
Joined: 5th May 2008
Location: Knight to Queens Bishop 3
Posted: 2nd Jan 2012 22:37
Quote: "When i use the settargetname=x Does X=1 or 0 or does it =the entities name? "


The entity name. I am not too sure if having a space in the name makes a difference, but as a habit we always use an underscore. For example, if the target is a trigger, we might use "settargetname=trigger_guard_001,activatetarget=1" and making sure the start script for the trigger is "appearifactivate.fpi" then that trigger spawns. Another example, if the target is a colt45, we might have "settargetname=colt45,activatetarget=1" and making sure the spawn at start on the colt is set to No.

It is also handy to use these two commands if you want to use just one script to activate multiple targets since entities and triggers only have one IfUsed field.


Twitter: @NFoxMedia

Login to post a reply

Server time is: 2026-07-02 12:29:35
Your offset time is: 2026-07-02 12:29:35