Problem identifying frame for loops that run-on (SOLVED)

Started by Ali, Mon 04/12/2006 14:05:56

Previous topic - Next topic

Ali

This could be a beginners problem I'm not sure. I've found a work-around bit I thought I'd mention the problem all the same.

I have a character animation that was made up of two loops, with the "play the next loop to make one long animation" option checked.

The character is singing in the background, so every-so often I create a textual overlay and cause him to animate. (I know I could have used Idle Animations and SayBackground, but they would cause problems with other parts of my game). I want him to stop animating smoothly so I used this line:

while (cT.frame!=0) Wait(1);

before I unlocked his view.

This works when the animation is only one loop long, but not when it's two. The animation terminates on the wrong frame when the animation is made up of two loops. I tried changing the line to this:

while (cT.loop=0&&cT.frame!=0) Wait(1);

Which I thought would solve the problem, but it stayed the same.

As I say, I solved the problem by making the animation shorter, but I'd like to know what I was doing wrong.

EDIT: Thank you sir!

Pumaman

while ((cT.loop == 1) || (cT.frame > 0)) Wait(1);

is probably what you want -- otherwise as soon as it moves onto the second loop it will break out.

SMF spam blocked by CleanTalk