Page 1 of 1
Triggering custom sounds
Posted: Mon Mar 22, 2004 11:14 pm
by Twig Masters *MBC*
I am trying to set up a trigger that each time a player touches it a sound is played only once.
I have seen a few other posts on this subject but non of them were exactly what I needed.
I tried the ambient sound tutorial with the model and speaker stuff but that just plays the sound over and over.
Oh one other thing, is it possible to set it so the sound will have a delay?
I need specifics on scripting too if needed.
Posted: Mon Mar 22, 2004 11:27 pm
by M&M
well,this should have been in the scripting forum imho ,but i guess it will be answered here 2 (same ppl here and there

)
check out
this and
this then sign here and here and we will get ur sounds working

Re: Triggering custom sounds
Posted: Mon Mar 22, 2004 11:39 pm
by Bjarne BZR
Twig Masters *MBC* wrote:I am trying to set up a trigger that each time a player touches it a sound is played only once.
Can you define more exacly the behaviour you want?
I'm just guessing here: But do you want the sound to be played the first time a player touches the trigger, then stop until the player exits the trigger and enters it again, then the sound is played again?
I take it we are talking about a trigger_multiple, and not a trigger_use.
Posted: Tue Mar 23, 2004 12:16 am
by blue60007
Bjarne, I think what is happening is that the sound is being looped. So say your trigger_multiple's targetname is "your_trigger" and your speaker is "your_speaker" and the sound is "your_sound". You should have this in your script:
your_trigger:
wait 5//for the delay
$your_speaker playsound // <--playsound instead of loopsound
Posted: Tue Mar 23, 2004 9:12 am
by Bjarne BZR
Well Twig... did you get an answer that helped?
Posted: Tue Mar 23, 2004 9:30 pm
by Twig Masters *MBC*
Uhh I think im even more confused now
Heres what I know so far.
I have a sound "mysound.wav"
I want it to play once when a player passes through a trigger. Then when it finishes playing it can be triggered again if another player passes through it.
Adding a delay shouldnt be a problem if I use a "trigger_multiple" because I can set a delay in the entity key settings.
Keep in mind I have no idea how scripting works....this is my first map for mohaa.
Posted: Wed Mar 24, 2004 2:47 am
by blue60007
OK first set a key/value of wait/5 (so you can't trigger while the first trigger is still executing) and then your script should be:
your_trigger:
wait 5//for the delay
$your_speaker playsound my_sound// <--playsound instead of loopsound
you'll need to ubersound it, but I can't explain that very well so could someone help me out here?