Hi! I try to play different background-sounds via an own action. If someone stays in a scene the sound should be repeated after a short break with random volumes. My code:
Code
<action name="sound_loop">
stopallsound();
createsound(bgsound, %1);
mul(val, random, 7);
add(val, 3);
roundval(val);
mul(rnd_val, random, 0.6);
add(rnd_val, 0.4);
trace('Name = ', %1);
trace('Volume = ', rnd_val);
trace('Wait = ', val);
playsound(bgsound, %1, false, rnd_val, delayedcall(val, sound_loop(%1);));
</action>
Alles anzeigen
The System plays the sound I pass in the beginning but it does not wait the seconds I want it to wait before continuing the sound.
I tested: the oncomplete-event is triggered and if I do not call the action again I hear nothing - which is correct.
So I wonder what's wrong here? Any ideas?