Triggering custom sounds

If you're looking for mapping help or you reckon you're a mapping guru, post your questions / solutions here

Moderator: Moderators

Post Reply
Twig Masters *MBC*
Lance Corporal
Posts: 22
Joined: Tue Jun 03, 2003 6:41 pm

Triggering custom sounds

Post 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.
Twig Masters *MBC*
Twigs-mbc.com

[img]http://twigs_mbc.tripod.com/sigs/twig_sig.gif[/img]
M&M
General
Posts: 1427
Joined: Sun Sep 14, 2003 1:03 am
Location: egypt
Contact:

Post 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 :D )

check out this and this then sign here and here and we will get ur sounds working :wink: :P
Image
Bjarne BZR
Site Admin
Posts: 3298
Joined: Wed Feb 05, 2003 2:04 pm
Location: Sweden
Contact:

Re: Triggering custom sounds

Post 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.
Admin .MAP Forums
Image
Head above heels.
blue60007
General
Posts: 1247
Joined: Sun Mar 07, 2004 11:44 pm

Post 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
Image
Bjarne BZR
Site Admin
Posts: 3298
Joined: Wed Feb 05, 2003 2:04 pm
Location: Sweden
Contact:

Post by Bjarne BZR »

Well Twig... did you get an answer that helped?
Admin .MAP Forums
Image
Head above heels.
Twig Masters *MBC*
Lance Corporal
Posts: 22
Joined: Tue Jun 03, 2003 6:41 pm

Post 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.
Twig Masters *MBC*
Twigs-mbc.com

[img]http://twigs_mbc.tripod.com/sigs/twig_sig.gif[/img]
blue60007
General
Posts: 1247
Joined: Sun Mar 07, 2004 11:44 pm

Post 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?
Image
Post Reply