Problem with Animations.

For questions about using Classic.

Post » Wed Dec 30, 2009 2:17 am

Hi, well I'll say the problem.

I'm making this enemy, based on animations. I made it with different animations with conditions, so the conditions are true based on what animation is played. I had 2 problems:

1) I made the events like that:

If 'action' = 1 and
When Animation 01 finished -> Set value 'action' to 2

If 'action' = 2 and
When Animation 02 finished -> Set value 'action' to 3

If 'action' = 3 and
When Animation 03 finished -> Set value 'action' to 1

If 'action' = 1 -> Set animation '01'

If 'action' = 1 -> Set animation '02'

If 'action' = 1 -> Set animation '03'

Animation 01 is 13 frames long, Animation 02 is 12, and Animation 03 was 16 frames long too, but the animation didn't played well, so I had to delete some frames and make it 11 frames long, if there was more frames, the animation didn't player well (it got stucked on some part of the animation).

So, after fixed that, I had another problem:

2) For bullets from enemy I did:

If action = 1,
Action frame = 6,
'shoot' = 0 -> Create object Bullet, Set 'shoot' = 1

If action = 1,
Action frame = 12,
'shoot' = 1 -> Create object Bullet, Set 'shoot' = 2

If action = 3,
Action frame = 6,
'shoot' = 2 -> Create object Bullet, Set 'shoot' = 3

If action = 3,
Action frame = 11,
'shoot' = 4 -> Create object Bullet, Set 'shoot' = 0

That way would work like a loop, and I'm telling Construct to create object on each animation frame I want.
The problem is the last condition, Construct doesn't read it, so the value 'action' is never set to 0 and the loop is broken. (And the last bullet doesn't come).

Please help with that, I don't know if there is a limit in animation frame or something, thanks,

Carlos.
?When everyone feels hope at the same time, wonderful things can happen.
B
5
G
3
Posts: 67
Reputation: 1,059

Post » Wed Dec 30, 2009 3:05 am

I'm not sure but.... maybe animation frames start from 0?

there's been some mixups with stuff starting from 0 in some places and from 1 in others.
B
3
S
2
G
4
Posts: 1,445
Reputation: 4,665

Post » Wed Dec 30, 2009 3:35 am

No, I'm sure is not that, animation always start on 1.
?When everyone feels hope at the same time, wonderful things can happen.
B
5
G
3
Posts: 67
Reputation: 1,059

Post » Wed Dec 30, 2009 7:20 am

you could try On Animation Finished instead of comparing to the last frame
:s

still weird, last frame should work
B
3
S
2
G
4
Posts: 1,445
Reputation: 4,665


Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 8 guests