Page 1 of 2

Triggering an mp3?

Posted: Mon May 12, 2003 1:04 am
by Gally
How do you use a trigger_multiple to trigger an mp3 or wav?

Please help me fast, this is the last thing I need before I compile my map!

.mus file

Posted: Mon May 12, 2003 8:51 am
by tltrude
You are going to have to make a music file for your map. Those files are in the main/music folder and end with a .mus extention. The mp3's are in main/sound/music.

The way it works is you would make your background sound "normal" and the music would be aux1, aux2, or whatever--in the mus file. Then your trigger would trip a thread in the script that says, "forcemusic aux1 aux1" or whatever aux you made it. You will also have to change the line that tells the ambient script which mus file to use.

exec global/ambient.scr mymapname

Hope that helps.

Posted: Mon May 12, 2003 9:30 am
by Gally
I kind of get what you mean, and the outcome, its just I got confused while doing it...



Could you do it step by step for my stupid ass?

Thanks for responding.

first

Posted: Mon May 12, 2003 11:09 am
by tltrude
The first thing you should do it "unzip" a copy of pak0.pk3--where all the files I talked about are. You will have to turn off "automattic install screensavers" in Winzip options, and rename pak0.pk3 to pak0.zip to do it.

Then study the .mus files in the music folder. I'm sure you'll figure it out from there.

Posted: Mon May 12, 2003 11:13 am
by mohaa_rox
OR:

make a setthread in ur trigger, let's say "sound". In ur script:

sound:
$triggername playsound alias // use it as a trigger or any object
end

OR

sound:
$triggername playsound "sound/xxx/xxx/xx.mp3"
end

If u wanna loop the sound, replace "loopsound" with "playsound".

Posted: Mon May 12, 2003 7:55 pm
by Gally
Im trying the second thing you said rox...I did what you said but it doesnt play the sound...in the console it says the alias needs and ubersound or uberdialog thing...


What do I do now?

Posted: Mon May 12, 2003 10:56 pm
by Gally
bump ^^^^^^

Posted: Tue May 13, 2003 8:28 am
by mohaa_rox
Use the second method, or read the ubersound workaround. Very useful. I suggest u make a tiki, don't edit ubersound.scr.

Or as i said, use the second method, something like playing the background music.

Posted: Tue May 13, 2003 9:25 am
by Gally
I believe I forgot to let you in on something...this is a wav sound on my computer...meaning a custom sound that doesnt have a cache in the uber/sound/dialog.scr's...

Is it possible to do this with custom sounds on your computer?

Posted: Tue May 13, 2003 9:31 am
by mohaa_rox
Step 1:
Put ur mp3 into a folder pk3, let's say, "main\sound\music\mysound".

Step 2:
Make an alias cache WITH A TIKI! Don't use ubersound.scr.

OR:

Do something like:

$thingy playsound "sound\music\mysound\xxx.mp3"

Posted: Tue May 13, 2003 10:09 am
by Gally
Ill try that...im not sure im linking everything right though.

Posted: Tue May 13, 2003 8:37 pm
by Gally
Its still not working man...could you do it step by step...this is the last thing I need to do before I compile and release...

:(

Posted: Tue May 13, 2003 11:19 pm
by panTera
Okay, step by step, as far as I know it :wink: .

1) Place a "script_model" anywhere in your map where you want to hear the sound from and give it:
key: model
value: fx/dummy.tik
&
key: targetname
value: speaker1 (example)

2) Set up your trigger_multiple or _use:
key: targetname
value: soundtrigger (example)
&
key: setthread
value: sound (example)
(& optional
key/value: wait/ number of seconds between triggerings)

3) In the script put this:
sound:
$soundtrigger waittill trigger
$speaker1 playsound gallywantssound (this would be an alias)

4) If you want to use custom sounds then try to create a tiki file useing notepad or any other text editor save it as mysounds.tik or whatever and put it in 'main/models/sound/yourdir/..'

The tiki should look something like this:
//////////////////////////////////////////////////////////

TIKI

setup
{
path models/fx/dummy
skelmodel dummy3.skd
}
init
{
server
{
classname ScriptModel
rendereffects +dontdraw
notsolid
}
client
{
settiki none
aliascache gallywantssound sound/music/yoursound.wav soundparms 1.5 0.0 1.0 0.0 300 3000 auto loaded maps "t m dm moh obj train yourbspname"
aliascache morealiases? ... put them here
}
}
animations
{
idle dummy3.skc
}

//////////////////////////////////////////////////////////


As an example replace gallywantssound with your alias, the sound/music/.. is the location of the sound in this case the music directory but you can also use your own.

5) In the _precache script for your map add the lines..:
'cache models/fx/dummy.tik'
'cache models/sound/yourdir/mysounds.tik'

.. to load your aliases and don't forget to add your sounds to your .pk3 if you send your map to friends. (note: mp3's cannot be loaded from within a .pk3 and must be included seperately in the .zip)

Explain better

Posted: Wed May 14, 2003 12:06 am
by tltrude
Gally - You need to explain better what you are trying to do. If you are vague, you're going to get every sound scheme in the book--as you can see from all the examples above.

Posted: Wed May 14, 2003 9:32 am
by Gally
Halleujah!

*bows down to pantera*

Thanks all for helping. Panteras tut works great.