Animation bug?

Non-platform specific questions.

Animation bug?

Postby yttermayn » Sun Jul 27, 2008 4:42 am

When you use the ChangeAnimation function in a script, it seems like the initial value of animpos will be either zero or whatever the last frame is. If animpos was a non-zero number prior to using the ChangeAnimation function, then whenever an animation is selected, animpos will be reset to zero. But if animpos is already a zero, it will be set to whatever the last frame of the new sequence is. This happens whether you ChangeAnimation to the same sequence or a different one. See the included .ged file to see this in action. Note that this does not occur when changing to an animation (as opposed to a sequence)
I guess my question is: is this behavior supposed to be happening? Am I doing something wrong?
Last edited by yttermayn on Sun Jul 27, 2008 5:08 am, edited 1 time in total.
yttermayn
 
Posts: 48
Joined: Sun Nov 25, 2007 4:10 pm
Score: 2 Give a positive score

Re: Animation bug?

Postby DST » Sun Jul 27, 2008 4:53 am

A couple things:

To continue on the current animpos use 'no change'
ChangeAnimation("Event Actor", "newanimationname", NO_CHANGE);

using Forward Should reset it to the first frame.

You can also use 'wait for frame action' when you click ok to enter the action; then you can specify which animpos.

You can also set the animpos immediately after using the animchange; all actions in one script window will be executed in the same frame. (draw frame that is, 30/fps etc).

Also, if you want to upload a ged file to the forum, you HAVE to include the data folder, or no one can open it.
It's easier to be clever than it is to be kind.
http://www.lostsynapse.com
http://www.dstgames.com
User avatar
DST
 
Posts: 1117
Joined: Sun Apr 15, 2007 5:36 pm
Location: 20 minutes into the future
Score: 151 Give a positive score

Re: Animation bug?

Postby yttermayn » Sun Jul 27, 2008 5:08 am

Doh! My apollogies. Here's everything... And thanks for the info so far. I will try your suggestions.
Attachments
animpos demo.zip
(196.21 KiB) Downloaded 113 times
yttermayn
 
Posts: 48
Joined: Sun Nov 25, 2007 4:10 pm
Score: 2 Give a positive score

Re: Animation bug?

Postby yttermayn » Sun Jul 27, 2008 5:24 am

Update: I'm finding that despite setting animpos to zero in the next line following the ChangeAnimation function, it still somehow jumps to the end of the sequence. But if I set animpos to a non-zero value in the line just before, the new sequence will start off at zero. Thoughts?
yttermayn
 
Posts: 48
Joined: Sun Nov 25, 2007 4:10 pm
Score: 2 Give a positive score

Re: Animation bug?

Postby DST » Sun Jul 27, 2008 5:49 am

it has something to do with your animation position being stopped.

If you were changing images by animpos with a stopped animation, you'd just chuck them all into one animation and command animpos out of that;

otherwise,
when i changed creatactor to animationdirection: Forward
and then used 'no change' on the keydowns, it worked perfectly.

And when i used 'forward' on the keydowns, it reset to 0 every time.

I can see what you're saying about the 0 and 4 thing, but i don't think its important.

How are you planning to use this?
It's easier to be clever than it is to be kind.
http://www.lostsynapse.com
http://www.dstgames.com
User avatar
DST
 
Posts: 1117
Joined: Sun Apr 15, 2007 5:36 pm
Location: 20 minutes into the future
Score: 151 Give a positive score

Re: Animation bug?

Postby yttermayn » Sun Jul 27, 2008 3:42 pm

I was using both animpos = x statements and sequence animations. I kept running into these problems with animation until I figured out what exactly was happening. Now I am trying to use only animation sequences, but inserting an animpos = 1; statement just before any ChangeAnimation's so I always know the new sequence will start at zero. I did have a workaround involving something similar to your suggestion about using only animpos with a stopped animation, but it makes for a lot more scripting that could be handled much easier using sequences. My philosophy is to make the already written functions and stuff in GE do as much of the work as possible. :wink:
I got my game animations working again this morning, now that I have a much more precise knowledge of the animation functions and variables. Now, on to collision detection!

...sigh...
yttermayn
 
Posts: 48
Joined: Sun Nov 25, 2007 4:10 pm
Score: 2 Give a positive score


Return to General

Who is online

Users browsing this forum: No registered users and 1 guest

cron