I thought yesterday that music would add some good ambience into my map.
Thanks in advance.
(Pardon me for my not-so-good thread making
![Smile :)](./images/smilies/icon_smile.gif)
Code: Select all
Add
{
// This plays the sound. DO NOT TRIGGER THIS ENTITY.
"ambient_generic"
{
"health" "10"
"message" "path/to/sound.file"
"pitch" "100"
"pitchstart" "100"
"radius" "1250"
"spawnflags" "49"
"targetname" "snd_1"
"origin" "-872 -1376 530"
}
// This is the trigger for the sequence. ONLY TRIGGER THIS ENTITY TO START, DO NOT TRIGGER THE OTHERS INDIVIDUALLY!
"logic_relay"
{
"spawnflags" "0"
"targetname" "rly_snd1"
"origin" "-848 -1376 530"
"OnTrigger" "snd_1,PlaySound,,0,-1"
"OnTrigger" "tim_snd1_looper,Enable,,0,-1"
"OnTrigger" "rly_snd1_fadetrigger,Enable,,0,-1"
}
// This is the timer to loop the sound. DO NOT TRIGGER THIS ENTITY.
"logic_timer"
{
// Change this vvv to match the time the sound ends (time is in seconds)
"RefireTime" "240"
"spawnflags" "0"
"StartDisabled" "1"
"targetname" "tim_snd1_looper"
"origin" "-824 -1376 530"
"OnTimer" "snd_1,PlaySound,,0,-1"
}
// This is the trigger to stop the sound (with a 1.5 second fade). ONLY TRIGGER THIS ENTITY TO STOP, DO NOT TRIGGER THE OTHERS INDIVIDUALLY!
"logic_relay"
{
"spawnflags" "0"
"StartDisabled" "1"
"targetname" "rly_snd1_fadetrigger"
"origin" "-800 -1376 530"
"OnTrigger" "snd_1,FadeOut,1.5,0,-1"
"OnTrigger" "tim_snd1_looper,Disable,,0,-1"
"OnTrigger" "!self,Disable,,0,-1"
}
}