Page 1 of 1

waittill sounddone

Posted: Mon Dec 15, 2008 1:24 pm
by $oldier Of Ra
Does anyone have any idea why this doesn't work properly? The game seems to recognize it, even though it's nowhere to be found in the game module classes; but after the sound is played it seems to wait forever...and ever...
I've placed a println command after the waittill sounddone but it never gets printed so I assume it's still waiting for "the sound to be done"

I've seen this used in stockscripts, I even tested a stockscript which used this and it doesn't work either.

Can anyone shed more light on the subject?

Posted: Mon Dec 15, 2008 3:32 pm
by Rookie One.pl
I think you need to put the "wait" keyword after a corresponding playsound:

Code: Select all

local.ent playsound somesound wait
local.ent waittill sounddone

Posted: Mon Dec 15, 2008 4:59 pm
by $oldier Of Ra
Not working either, it gives me an error like this:
^~^~^ Callback for Sound <mysound> was ignored.

I think waittill sounddone only works in SP...

Posted: Tue Dec 16, 2008 12:47 pm
by Salombo
Why not " loopsound" ....

Posted: Tue Dec 16, 2008 2:37 pm
by jv_map
The construct Rookie wrote ought to work both in sp and mp. If you get a callback error, then presumably something is wrong with the sound file or alias. Did you try a different sound (just to check)?

Posted: Tue Dec 16, 2008 4:15 pm
by $oldier Of Ra
I tried med_kit, med_canteen, snd_landing_foliage1 and hedge_impact1 (--> the latter one is cached with scriptmaster) all give the callback error and waittill sounddone is waiting forever in every case.

Here's my setup:

Code: Select all

wait 3 //wait till I'm in the map to open the console at the right time
local.o = spawn script_model
local.o.origin = ( 240 -300 50)
local.o notsolid
local.o playsound med_canteen wait
local.o waittill sounddone
println " "
println "hello"
println " "
The hello never gets printed :?

Why not " loopsound" ....
That's the same thing even if this would work waittill sounddone would be waiting forever because the sound is continuously looping :P

Posted: Tue Dec 16, 2008 4:53 pm
by Salombo
Just a wild guess

try it with an fx/dummy.tik

Posted: Tue Dec 16, 2008 6:59 pm
by $oldier Of Ra
No go either, while I was at it I tried a script_origin and a trigger_multiple :(

Posted: Tue Dec 16, 2008 7:38 pm
by Salombo
I'm sure you did look at it, but just in case :wink:

global/entsound.scr seems to be executed from m1l1 only ... looks like your script. You might find a lead there .

Posted: Tue Jan 20, 2009 7:27 pm
by Tazz

Code: Select all

wait 3 //wait till I'm in the map to open the console at the right time 
local.o = spawn script_model 

?????WHAT MODEL??????

local.o.origin = ( 240 -300 50) 
local.o notsolid 
local.o playsound med_canteen wait 
local.o waittill sounddone 
println " " 
println "hello" 
println " "

maybe its just me and i dont know what im talking about but how come u spawn script model but have no model definition...u didnt say which model u spawning.......how bout like

local.o. model " ur model here "

then maybe it work?...or try a dummy.tik like someone else said?

just wondering



EDIT: oops just noticed i bumped a month old thread...sry guys

Posted: Tue Jan 20, 2009 8:34 pm
by $oldier Of Ra
Actually, it is unnecessary to specify a model for the script_model to use. You can use a script_model, script_object and script_origin perfectly without a model.

I use them for some special cases and as a bypass etc... Playing sounds from a script_model without a model works perfectly and I use it all the time. Waittill sounddone does not, I have tried any applicable class in the book. But it's obvious that it only works in SP. I could turn the g_gametype to 0 every time I use waittill sounddone to make it work but that would be just silly, not to mention I would be screwing up my objective matches.
(However this g_gametype trick is handy for SP-only commands you only need to use once such as bsptransition and leveltransition)

So without any unnecessary definition, all three are just invisible, notsolid entities with a size of 1 x 1 capable of doing anything of the Entity Class and the other classes they enherite commands from.
Only if you want to display a model, then you should specify it. It is merely a visual factor with no technical importance whatsoever.