Jump to content
Sign in to follow this  
colosseum

Help with alarm system

Recommended Posts

All,

Trying to create a script that turns an alarm on and off when zombies enter a set area defined in a trigger.

My logic leads me to this, but I don't know the right coding syntax:

1. Have the trigger set up so that when zombies are detected by BLUFOR, a variable is set to true.

2. When the variable is true, the game will hit a script to loop an alarm sound file.

3. When the trigger is deactivated (i.e., no zombies in that area), the variable is set to false.

4. The script stops looping the alert now that the variable is false.

Does this make sense? All of the stuff I've tried hasn't worked. Thanks very much in advance!!

Share this post


Link to post
Share on other sites

Make sense. But you could also run a alarmsound via trigger, thus you dont need a scriptfile. Only disadvantage: The alarm wont stop, until the sound is over.

The problem with your first approach is maybe:

1. Trigger is not on multiactivation.

2. The Loop is not sleeping while your sounds play, so the sound starts over and over again.

3. How do you play a sound? playsound? say?

Share this post


Link to post
Share on other sites

1. Have the trigger set up so that when zombies are detected by BLUFOR, a variable is set to true.

Are you sure this it what you want? In your opening paragraph you say the alarm should go off when the enemy enteres trigger, but here you say when BLUFOR detect them. Which is it?

Share this post


Link to post
Share on other sites

If it is okay the sound originate from the position of the trigger then just set it to BLUFOR PRESENT whatever condition your need and REPEATABLE. Then in effect (bottom left I think) find the sound you want and that's it (no stuff in On Act).

Edited by Muzzleflash

Share this post


Link to post
Share on other sites

Not BLUFOR present, surely? The side whichever the zombies are....

Share this post


Link to post
Share on other sites

My idea is that the alarm would be sounded whenever BLUFOR detects the zombies in the trigger area.

Yes, I was using playSound to play the alarm noise.

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×