waittill sounddone

Post your scripting questions / solutions here

Moderator: Moderators

Post Reply
$oldier Of Ra
Lieutenant Colonel
Posts: 404
Joined: Sun Oct 16, 2005 7:16 pm
Location: Belgium
Contact:

waittill sounddone

Post 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?
Our official website: http://www.mohaairborne.co.cc
(Still accessible through http://mohaaclantb.tk and http://users.skynet.be/mohaaclantb/)

For all your bot needs!!!!

$oldier Of Ra.
Rookie One.pl
Site Admin
Posts: 2752
Joined: Fri Jan 31, 2003 7:49 pm
Location: Nowa Wies Tworoska, Poland
Contact:

Post 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
Admin
Image
Image
Honour guide me.

here's my stuff - inequation.org | here's where I work - thefarm51.com
$oldier Of Ra
Lieutenant Colonel
Posts: 404
Joined: Sun Oct 16, 2005 7:16 pm
Location: Belgium
Contact:

Post 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...
Our official website: http://www.mohaairborne.co.cc
(Still accessible through http://mohaaclantb.tk and http://users.skynet.be/mohaaclantb/)

For all your bot needs!!!!

$oldier Of Ra.
Salombo
Sergeant
Posts: 61
Joined: Mon Jun 05, 2006 1:30 pm
Location: New York

Post by Salombo »

Why not " loopsound" ....
Image
jv_map
Site Admin
Posts: 6521
Joined: Tue Sep 03, 2002 2:53 pm
Location: The Netherlands
Contact:

Post 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)?
Image
$oldier Of Ra
Lieutenant Colonel
Posts: 404
Joined: Sun Oct 16, 2005 7:16 pm
Location: Belgium
Contact:

Post 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
Our official website: http://www.mohaairborne.co.cc
(Still accessible through http://mohaaclantb.tk and http://users.skynet.be/mohaaclantb/)

For all your bot needs!!!!

$oldier Of Ra.
Salombo
Sergeant
Posts: 61
Joined: Mon Jun 05, 2006 1:30 pm
Location: New York

Post by Salombo »

Just a wild guess

try it with an fx/dummy.tik
Image
$oldier Of Ra
Lieutenant Colonel
Posts: 404
Joined: Sun Oct 16, 2005 7:16 pm
Location: Belgium
Contact:

Post by $oldier Of Ra »

No go either, while I was at it I tried a script_origin and a trigger_multiple :(
Our official website: http://www.mohaairborne.co.cc
(Still accessible through http://mohaaclantb.tk and http://users.skynet.be/mohaaclantb/)

For all your bot needs!!!!

$oldier Of Ra.
Salombo
Sergeant
Posts: 61
Joined: Mon Jun 05, 2006 1:30 pm
Location: New York

Post 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 .
Image
Tazz
Second Lieutenant
Posts: 155
Joined: Fri Feb 16, 2007 1:29 pm
Contact:

Post 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
$oldier Of Ra
Lieutenant Colonel
Posts: 404
Joined: Sun Oct 16, 2005 7:16 pm
Location: Belgium
Contact:

Post 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.
Our official website: http://www.mohaairborne.co.cc
(Still accessible through http://mohaaclantb.tk and http://users.skynet.be/mohaaclantb/)

For all your bot needs!!!!

$oldier Of Ra.
Post Reply