VERY weird "Play Animation" bug.

For questions about using Classic.

Post » Sun Feb 17, 2008 9:51 am

I have an event that triggers "play animation" whenever a sprite changes direction. each time "Play animation" is triggered in the game, the sprite warps more and more, until it's almost invisibly thin. while on the subject, is there any reason an animation will just stop playing although it's supposed to loop? is it a known bug?
I set a sprite to change to a running animation when holding the right key for example (I made sure "trigger once" is on), and it works fine for a while, but eventually when it switches to the running animation, it will be stuck on the first frame. :(

Anyone come across something similiar?

I love the program, but it seems way too unstable to develop something ambitious on..
B
2
G
4
Posts: 44
Reputation: 1,138

Post » Sun Feb 17, 2008 12:49 pm

You might want to check the order of your events. If you have an event that switches your sprite to a different, single-frame animation that is being run before checking for left/right input and switching to "running" then when your "running" animation comes up it will always default to frame 1. For instance, putting your "change animation to default" action into an always event at the start of your animation routines will do this, but there are other ways as well. Just double-check that there isn't anything triggering an animation change prior to your running action that might be overriding it, and condition it accordingly.

As for the sprite changing size... I don't know what could be causing it. I've never encountered it, and I've never heard of it happening. Maybe you could upload an example of what's happening so someone could take a look at it?
Moderator
B
5
S
2
G
6
Posts: 4,348
Reputation: 10,971

Post » Sun Feb 17, 2008 5:00 pm

I posted the animation bug already. Here're the steps: New game, insert sprite, import an animation. Make event: Always set frame to random(number of frames). The sprite crunches. This happens sometimes with the 'set animation' action as well.

A workaround is to set its size each frame to its original width and height.

http://sourceforge.net/tracker/index.ph ... id=1003219
Moderator
B
88
S
32
G
33
Posts: 3,005
Reputation: 27,432

Post » Sun Feb 17, 2008 8:36 pm

[quote="deadeye":17s8mcf7]You might want to check the order of your events. If you have an event that switches your sprite to a different, single-frame animation that is being run before checking for left/right input and switching to "running" then when your "running" animation comes up it will always default to frame 1. For instance, putting your "change animation to default" action into an always event at the start of your animation routines will do this, but there are other ways as well. Just double-check that there isn't anything triggering an animation change prior to your running action that might be overriding it, and condition it accordingly.

As for the sprite changing size... I don't know what could be causing it. I've never encountered it, and I've never heard of it happening. Maybe you could upload an example of what's happening so someone could take a look at it?[/quote:17s8mcf7]
I double-checked, and nothing should be changing it - the animation is the right one, it's just stuck on frame 1 like it doesn't play.
Like I said, it works fine 90% of the time, but after playing for a while it randomly happens. I don't really want to show the game yet - could I email you or something?

Everything is going smoothly for me in the controls department, but i'm having alot of trouble getting animations to play correctly. it'll always end up NOT playing any animations, while still switching to the correct ones.

by the way, your kick-it demo is perfect for my game - except for the little bounce the character makes when it lands. did you find a way to work around it?

Thanks for all the help!
B
2
G
4
Posts: 44
Reputation: 1,138

Post » Mon Feb 18, 2008 12:37 am

I was working on a bounceless physics-platform movement, but met with some mixed success. I set up some events to briefly add force downward when the sprite lands to overcome the bounce. It took a lot of tweaking to get it looking right, and even then occasionally it would stick to the ground momentarily on landing. Then there were other problems that had nothing to do with the ground bounce, like the sprite sometimes sticking to walls in midair when you push against them, even with the world solver and friction set to fastest. Eventually I scrapped it. I might give it another shot sometime, but I think I'm done trying to mix platforming with the physics movement. The only really good thing to come out of it was learning that you can get the detector to stick properly (no lag-behind) by using Create Hinge instead of updating it's x,y and turning rotations off.

And yeah, I can take a look at your cap if you want. I'll pm you with my email.
Moderator
B
5
S
2
G
6
Posts: 4,348
Reputation: 10,971

Post » Mon Feb 18, 2008 3:19 am

Hey electrii, got your file. I don't have time right now to do any hardcore bug-searching but I can get to it later tonight. I was able to replicate the problem with the run animation stopping, though. I also noticed though that there were some code streamlining fixes you could make to smooth things out. For instance, you have "On Key Down" conditions in both your control events and your animation events, so it's a little redundant. I could make some commented suggestions and send you back the cap if you like.

But yeah, like I said I'll dig further into why the animation is crapping out later on. I'll keep you posted.

PS - I like your character design and the dust effect. Pretty slick ;)
Moderator
B
5
S
2
G
6
Posts: 4,348
Reputation: 10,971

Post » Mon Feb 18, 2008 3:45 am

That will be great, thanks :)

I'm a graphics designer, not a coder, that's why my events are a little sloppy :?

I've used MMF before, so this is a little more complex for me - it looks like the order of events is much more important here.

Also, do you think I would be better off using a different method to control the guy? the only reason i'm using the physics movement over platform is because it allows me to easily play with velocity.
B
2
G
4
Posts: 44
Reputation: 1,138

Post » Mon Feb 18, 2008 7:40 am

[quote="Arima":1de5zplb]
A workaround is to set its size each frame to its original width and height.
[/quote:1de5zplb]

Oh yeah, this is a nice temporary fix :)

I guess that with this fix you don't really need to look into it, deadeye! now I can set "Play animation" along with any animation-changing events, which seems to solve the problem.

Now I just need to lessen the bouncing, I'll try playing around with force settings..
B
2
G
4
Posts: 44
Reputation: 1,138

Post » Mon Feb 18, 2008 7:32 pm

Could you send the .cap which is doing this to ashley@scirra.com so I can take a look? Thanks.
Scirra Founder
B
359
S
214
G
72
Posts: 22,952
Reputation: 178,580

Post » Mon Feb 18, 2008 9:28 pm

Mail sent.
B
2
G
4
Posts: 44
Reputation: 1,138

Next

Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 1 guest