Triggering an mp3?
Moderator: Moderators
Triggering an mp3?
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!
Please help me fast, this is the last thing I need before I compile my map!
.mus file
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.
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.
first
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.
Then study the .mus files in the music folder. I'm sure you'll figure it out from there.
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".
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".
Live to map, not map to live.
-mohaa_rox, .map
moderator
-mohaa_rox, .map
moderator
-
panTera
- Brigadier General
- Posts: 573
- Joined: Wed Jan 29, 2003 11:46 pm
- Location: The Netherlands
- Contact:
Okay, step by step, as far as I know it
.
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)
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
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.


