Ambient Sound

Post your scripting questions / solutions here

Moderator: Moderators

Post Reply
Devil_Dog
Warrant Officer
Posts: 140
Joined: Fri Feb 17, 2006 2:59 pm

Ambient Sound

Post 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.
Computers hate me!!!!!
Green Beret
Major General
Posts: 746
Joined: Mon Apr 19, 2004 12:21 pm
Contact:

Post 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
Image
Devil_Dog
Warrant Officer
Posts: 140
Joined: Fri Feb 17, 2006 2:59 pm

Post 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?
Computers hate me!!!!!
User avatar
tltrude
Chuck Norris
Posts: 4774
Joined: Sun Jul 07, 2002 4:03 am
Location: Oklahoma, USA
Contact:

1

Post 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.
Tom Trude,

Image
Devil_Dog
Warrant Officer
Posts: 140
Joined: Fri Feb 17, 2006 2:59 pm

Post by Devil_Dog »

I see, thanks.
Computers hate me!!!!!
Post Reply