wait for playsound

Post your scripting questions / solutions here

Moderator: Moderators

Post Reply
Killerdude
Sergeant Major
Posts: 110
Joined: Fri May 11, 2007 12:16 am

wait for playsound

Post by Killerdude »

Is there a way to wait until playsound is done before loopsound is called?

Code: Select all

fan_start_sound:
    $fancone playsound snd_fan_start
    $fancone loopsound snd_fan_loop
end
I figure I can always put playsound in another thread and do this ......

Code: Select all

fan_start_sound:
    waitthread fan_start  // thread that plays the snd_fan_start
    $fancone loopsound snd_fan_loop
end
Just curious if there is a better way ;)
User avatar
tltrude
Chuck Norris
Posts: 4774
Joined: Sun Jul 07, 2002 4:03 am
Location: Oklahoma, USA
Contact:

Post by tltrude »

The simple way would be to just put in a wait that is as long as the sound plays -- trial and error.

Code: Select all

fan_start_sound: 
    $fancone playsound snd_fan_start
    wait 1.5
    $fancone loopsound snd_fan_loop 
end
Tom Trude,

Image
Post Reply