Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: HandsFree on Thu 05/03/2015 22:25:09

Title: animation keeps repeating [solved]
Post by: HandsFree on Thu 05/03/2015 22:25:09
I have set an idle view to play continiously.
cUnicorn.SetIdleView(160, 0);

At one point the unicorn is supposed to perform an animation once and then NOT return to idle view anymore.

Code (ags) Select

cUnicorn.SetIdleView(160, -1);
player.Transparency = 100;
cUnicorn.ManualScaling = true;
cUnicorn.Scaling = 50;
cUnicorn.ChangeView(162);
cUnicorn.Animate(8, 5, eOnce, eBlock);

From that point on the last animation loop keeps repeating, as if it's considered an new idle loop.
Or could there be another reason why the loop keeps repeating?

Any ideas what's happening here?

BTW if I use lockview(162) I get the error that the animation uses an invalid loop number, while with changeview loop 8 gives no error. :confused:

edit: for a test I deleted the cUnicorn.SetIdleView(160, 0); But the animation still keeps repeating. So maybe not connected with idle view. But I'm still clueless.
NB the first 4 loops of view 162 are for walking. So if, after the above code, I let the unicorn walk, that works. But when the walking stops it then keeps repeating the walking animation (loop 2). :shocked:

edit2: ahum, this cUnicorn.SetIdleView(160, -1); was supposed to be cUnicorn.SetIdleView(-1,0);
The -1 is for the view number, not the delay. Fixed now. sorry.:angry:
Title: Re: animation keeps repeating [solved]
Post by: Slasher on Fri 06/03/2015 06:23:13
Code (ags) Select
cUnicorn.SetIdleView(160, -1);
AFAIK this (-1) will start walking animation view.
Title: Re: animation keeps repeating [solved]
Post by: HandsFree on Fri 06/03/2015 22:14:47
Really? I didn't know that. Don't think the manual mentions that.
thanks