target_speaker: wait and random cause problems


(]UBC[ McNite) #1

Hey everbody,

trying to add a bit of atmosphere into my map by ambient sounds I want a sound in the map that gets played in intervals. There s wind in the trees, and now i want a bird singing once in a while.
What I did is this: make a target_speaker, use these keys-values:
classname - target_speaker
noise - sound/world/parrot.wav
volume - 255
wait - 5000
random - 1

according to the LDR the sound should be played now and then with 5 secs wait again (forget the 1 millisecond of random, I just put it in cuz u need to have wait AND random in the entity).
Problem is: the sound isn’t playing… never (a pity the bird s dead already (obviously) cuz I d like to shoot it for that)
Playing the sound with looped_on is no problem (without wait and random then of course), but who wants a parrot shouting all the time?

(btw I know about the ingame-thing… but this should work without it anyway so where s the problem I wonder)

Another thing that bothers me: in the ingame-sound-thingy you can set a “range”… but you can’t in the target_speaker entity in GTK… ideas anybody? A range-definition would be handy imo :smiley:


(MadMaximus) #2

you could use a target_delay and the random to also trigger a target speaker… and would probably work better.


(]UBC[ McNite) #3

Can u plz be a bit more precise about this idea?


(Ifurita) #4

Have you tried doing this thru the in-game speaker editor? It might be a good test just to see if it works there


(MadMaximus) #5

oops, made an error, i meant a func_timer that targets the target_speaker.

i have an animated crow in an upcoming map, where i use a target speaker for the crow’s voice with volume at 60, i then have a func_timer targeting that with the following settings of spawnflags 1 ( start_on set ), a wait at 30, and random at 15.

so every 30 to 45 seconds it plays the crow’s sound.


(Loffy) #6

Yes, try the func_timer (if you want to use the target_speaker entity).
The func_timer targets the speaker.


(]UBC[ McNite) #7

Mad, I think with a wait of 30 and a random of 15 your sound will play every 15 to 45 secs (minimum wait = wait - random)?

Just to make sure: I ll give the target_speaker a
key: target with a value: bird
and the func_timer a
key targetname with a value: bird

right? (I m at work, can’t try it out right now.)


(Loffy) #8

key/value

classname/func_timer
target/bird

classname/target_speaker
targetname/bird

// Loffy
Skynard Lynard “Free Bird”


(]UBC[ McNite) #9

YEA it works… lovely! Thx everybody!
No idea though y the fun_timer uses full seconds and the wait of a target_speaker uses milliseconds… lack of consistency there imo but anyway

:clap: :banana: :clap: