Making sure this is a bug...

For questions about using Classic.

Post » Sun Jul 19, 2009 9:35 am

Hi everyone,

heres a tiny example .cap of the bug in question:
[url:rqugwdqx]http://www.holymonkeystudio.com/projects/animbug.zip[/url:rqugwdqx]

I'm working on a platformer game and have a rectangular object with platform behavior, and then the sprite for the character's animations always set to the same position and angle etc...

For animations like falling and jumping, its ideal to create and set the animation so it plays the first few frames once, then loops the last few extreem frames.. in construct this is done by setting "loop to" to the number of the frist frame you want it to begin looping at once it reaches the end.

This works great for jump,... IE: when platform behavior is jumping=set sprites animation to jump.
HOWEVER, the same set-up and code for fall is broken! It NEVER displays the first few frames.

I'm also seeing in more complex situations which include "on animation finished: set to another animation... the sprite in my game frequently SKIPS the fists animation entirely and goes right to the second animation as though its falsley detecting that the first animation has finished when it actually has only just been innitiated... has anyone else seen this as well?

thanks,

Mike
B
2
S
2
G
4
Posts: 124
Reputation: 1,698

Post » Mon Jul 20, 2009 3:09 am

hey monkey
I haven't worked much with platform behavior
or animations, so there may be a better answer or a simpler solution
but what I came up with is that the jumping animation is told to stop after it gets to 3
when you change the animation to falling, it is still stopped
so you need to instruct the animation to play
also, set this event to "trigger once while true" (under system)
this will keep it from looping the "play animation" command which would start your animation over and over, and make it look like it was stuck on the first frame:


edit :
the screenshot method I showed here works, but
I messed around some more
and maybe I just don't get it, but having loop on doesn't seem to cancel out the repeat to number
Spriter Dev
B
87
S
21
G
12
Posts: 3,240
Reputation: 16,461

Post » Mon Jul 20, 2009 4:12 pm

unfortunately, it JUMPS immediately to the last frame, it does not stick on the first. And what I'm trying to do works perfectly with JUMP, yet seems to be clearly broken with FALL. (even though its the same exact animation set up and "code"

Also, If you run the cap after the change you suggested, you will see that it is still broken... notice that when the player falls, the fall animation playes ONLY the 3rd frame. (presumibly because the animation is set to "loop to" frame 3. HOWEVER, just as with the properly working jumping animation, it SHOULD play the first two frames of fall first, then loop on the third frame.

Why does it behave properly with jump, but not fall?
B
2
S
2
G
4
Posts: 124
Reputation: 1,698

Post » Mon Jul 20, 2009 4:29 pm

Lucid's method should work, but not exactly for the reason he stated.

Think of your frame number as "global" for your sprite. If you are on frame 8 of your Run animation, and you switch to the Walk animation, then you will still be on frame 8. If you want to change to a different frame, you need to specify.

The Play Animation action starts the animation over again from frame 1 (whereas the Resume Animation action continues a paused animation from it's current frame).

So this should work:



And in fact, I have your .cap open right now and I've changed the event to look exactly like this and it does indeed work for me.


[quote="Holymonkey":2yljg3rz]Why does it behave properly with jump, but not fall?[/quote:2yljg3rz]

Because you have only one frame for your Default animation. So when you switch to Jump, you're on frame one. :)

Just keep in mind that the animation frame number carries over when you switch and you'll be fine.
Moderator
B
5
S
2
G
6
Posts: 4,348
Reputation: 10,971

Post » Mon Jul 20, 2009 6:57 pm

Terribly sorry for not reading your suggestion more carefully Lucid and thanks both of you for taking the time to help me out. I've made the changes and it now seems to be working perfectly.

:)
B
2
S
2
G
4
Posts: 124
Reputation: 1,698

Post » Mon Jul 20, 2009 10:03 pm

no problem, buddy
glad it's working :)
Spriter Dev
B
87
S
21
G
12
Posts: 3,240
Reputation: 16,461


Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 3 guests