Page 1 of 1

Ambient Sound

Posted: Thu Dec 14, 2006 9:52 pm
by Devil_Dog
I've been trying to figure this out useing Waco's Dog Bark Tut.
I want to play 1 sound, of a plane flying over. I understand most of it but I understand how to place the scrit_model"speacker", and how to list the sound in the script. I am getting stuck on the last part.

After level waittill spawn. I am looking at where he has the dog barks random. Trying to figure out how to play just 1 sound every 30 seconds to 2 minuets.

I also read the 'ambient sound' tut, but I don't want to use a trigger.

Posted: Mon Dec 18, 2006 3:39 am
by Green Beret
spawn a script_origin, or _object
then give a targetname of speaker
then call a thread

Code: Select all

level waittill spawn

thread speaker
end

speaker:
$speaker playsound $flyby (<---Not sure if its even a sound)
wait 30
thread speaker
end
Sound right?

Or maybe put it in a while loop

Code: Select all

speaker:
while(1)
{
$speaker playsound $flyby
wait 30
}
end

Posted: Mon Dec 18, 2006 3:02 pm
by Devil_Dog
Thanks, I will try them.
I just found the tut for custom sounds and read it, don't know why I passed it up before.
In the while(1) ... what does the 1 represent?

1

Posted: Tue Dec 19, 2006 5:52 am
by tltrude
The one is just a place holder. There are things you can put in there.

While (isalive $speaker)

Doing that would stop the looping if the speaker was killed. But there is no chance of that, so the one is used.

Posted: Tue Dec 19, 2006 6:21 pm
by Devil_Dog
I see, thanks.