how to play sound throughout whole level when door is opened


(Susquianna) #1

I am making a map. Ok there is a button someone needs to push. This button is a func_door though because I could never get the “angles” of func_button right. but the “angle” of a func_door is easy to do.

anyway, when this “button” (func_door) is pushed it will play a wav file that says “Boat Destroyed”. now how can I make it play throughout the whole level? Global doesn’t work in target_speaker. and I cannot place 100 target speakers around the whole level or I will get a “g_spawn max entities” error.

so the only way I can do it is through scripting right? ok so I put a key of scriptname in the func_door and a value of boat_destroyed.

I have this in MyMap.sounds file:

boat_destroyed
{
	sound sound/boat_go_boom.wav
	voice
	streaming
}

And this is in MyMap.script file:

boat_destroyed
{
    spawn
    {	

    }
    death
    {

    }
    activate
    {
	wm_teamvoiceannounce 0 "boat_destroyed"
	wm_teamvoiceannounce 1 "boat_destroyed"
    }
}

The .wav file is the right compression and everything.

Why won’t this wav sound play? What is wrong with my script? Is there an easier way to do it??


(The Wanderer) #2

check the console after you activate the sound. It ususally says if it could’t open the file or something


(Loffy) #3

And have you tried the sound in question before, e.g. with a speaker?
Jst a single speaker, that players the sound on a loop (to be sure it acutally works).
// Loffy


(Susquianna) #4

found the problem thx