Dog Alert


(Uchronic) #1

Hello,

I’m trying to create in a map an alert when a player walks nearby an objective.
To be more specific, I’d like to hear a dog barking when a player is approaching it.

So I’ve created this :

// entity 5
{
“classname” “target_speaker”
“origin” “576 -192 64”
“noise” “sound/world/dog_01.wav”
“scriptname” “dog”
“targetname” “dog”
“spawnflags” “2” //looped_off
“wait” “5”
}
// entity 6
{
“wait” “-1”
“target” “dog”
“classname” “trigger_multiple”
// brush 0
(…)

The result is : no sound when the map starts, the dog starts barking when the player is entering the trigger brush, but the dog never stops barking.

I know I shouldn’t have played with that kind of dangerous dog, but I’d like to find to stop it when the player is not anymore in the trigger brush.

Any ideas?


(Loffy) #2

Uchronic, this is a neat idea, and we should be able to help you to get it to work.

target_speaker, remove:
“spawnflags” “2” and “wait” “5”

trigger_multiple, change “wait” to a higher number, e.g. “20”

Now, the dog will only bark once.
Then it will bark again, after 20th second, but only once.

I hope it works.

Have you ever played the map Navarone, by mapper Drakir?
If you play as Allied, move to the left of the map, towards the big Light House, and go into tunnel, you will meet a dog.
Check it out, it is really cool. The dog “attacks” and barks.

//Loffy


(Shaderman) #3

It should work if you only use targetname and noise in your target_speaker.


(Uchronic) #4

That is just PERFECT !!!
We had a wild animal, and thanks to you, we now have a good pet! :smiley: Good boy!

Nevertheless, I’ve reduced to 8 seconds, as the wav is 7 seconds long. Like this, there is just 1 sec as a loophole. And when a player is staying in the trigger (i.e. near the dog), it is almost a loop.

I’m using this to help the defence team when there are not much players. With this alert they can hear the attacking team coming from this way.

Thank you again.