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.
Triggering custom sounds
Moderator: Moderators
-
Twig Masters *MBC*
- Lance Corporal
- Posts: 22
- Joined: Tue Jun 03, 2003 6:41 pm
Triggering custom sounds
Twig Masters *MBC*
Twigs-mbc.com
[img]http://twigs_mbc.tripod.com/sigs/twig_sig.gif[/img]
Twigs-mbc.com
[img]http://twigs_mbc.tripod.com/sigs/twig_sig.gif[/img]
-
Bjarne BZR
- Site Admin
- Posts: 3298
- Joined: Wed Feb 05, 2003 2:04 pm
- Location: Sweden
- Contact:
Re: Triggering custom sounds
Can you define more exacly the behaviour you want?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.
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.
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
your_trigger:
wait 5//for the delay
$your_speaker playsound // <--playsound instead of loopsound
-
Bjarne BZR
- Site Admin
- Posts: 3298
- Joined: Wed Feb 05, 2003 2:04 pm
- Location: Sweden
- Contact:
-
Twig Masters *MBC*
- Lance Corporal
- Posts: 22
- Joined: Tue Jun 03, 2003 6:41 pm
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.
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.
Twig Masters *MBC*
Twigs-mbc.com
[img]http://twigs_mbc.tripod.com/sigs/twig_sig.gif[/img]
Twigs-mbc.com
[img]http://twigs_mbc.tripod.com/sigs/twig_sig.gif[/img]
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?
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?

