Sub-animations?

For questions about using Classic.

Post » Fri Jan 23, 2009 1:11 am

Sorry for flooding Help/Tech Support with questions, but the wiki and other documentation really isn't enough quite yet...

Can someone explain Sub-Animations? It seems like it would be very helpful for what I want, but I'm missing a bit of syntax.

I want to have an event trigger if any one of a particular set of animations is playing. So, I figure that it would work by making all those animations a subanimation. So I create a new animation with nothing in it. I then move all the animations I want grouped as subs of that first one.

Suddenly, I can no longer get these animations to play. I assume there's a separate syntax for accessing subanimations, but I can't figure out what it might be...

While I'm at it, will testing for the root animation playing also trigger if a subanimation is playing?
B
2
G
3
Posts: 71
Reputation: 992

Post » Fri Jan 23, 2009 4:52 am

[quote:112lbqv4]Suddenly, I can no longer get these animations to play. I assume there's a separate syntax for accessing subanimations, but I can't figure out what it might be...[/quote:112lbqv4]
The auto-naming sequence is usually "Default", "Animation 1", "Animation 2", etc.
[code:112lbqv4]MouseKeyboard: 113 On Left Clicked on Sprite 0
> SpriteSet animation to "Animation 1"[/code:112lbqv4]

Just to clarify YourspriteSet might look better, there's no inheritance.
Image Image
B
161
S
48
G
90
Posts: 7,347
Reputation: 66,749

Post » Fri Jan 23, 2009 4:45 pm

But I haven't changed the names of any of the animations, I just took formerly main animations and moved them to a sub-animation position. If you could access a subanimation with just the name of the subanimation, doing this should not have changed the behavior of the game whatsoever. So why did it break?

Also of note, once I moved an animation to a sub animation, I can't seem to be able to move them back to normal main animation status. At least not by dragging it.
B
2
G
3
Posts: 71
Reputation: 992

Post » Fri Jan 23, 2009 4:56 pm

Yeah, it looks like a bug that you can't drag a subanimation back out. Submit it to the tracker.

I'm still debating if sub-animations were a good idea to implement. It's tempting just to turn them off. There's a vague case for having them for two reasons:

- Organising animations
- Having more complex animation structures, like "Stopped" and "Walking" animations, then subanimations for carrying different weapons/wearing different clothes/whatever. So you'd have subanimations under "Walking" like "Walking with nothing", "Walking with sword", "Walking with shield", "Walking with sword and shield". But I think this could be better done with separate sprites for the different things, and just have one generic walking animation.

What do you think? Should we have sub-animations? People often ask what they are for (and the above two things are the only thing), so I guess it isn't intuitively obvious.
Scirra Founder
B
359
S
214
G
72
Posts: 22,946
Reputation: 178,518

Post » Fri Jan 23, 2009 5:03 pm

Perhaps subanimations could in fact act like families for animations, like I initially thought?

And again, why did my game break when I moved the animations to be subs?

Also: Reported.
B
2
G
3
Posts: 71
Reputation: 992

Post » Fri Jan 23, 2009 10:40 pm

Please leave them in!
It sooo much easier to manage sprites as animations.
Example in my game Im changing buttons with it, and then I have an upgrade feature for my tanks.
Its much easier to change the animation than to destroy a sprite, then create another, and transfer all its variables.
Image Image
B
161
S
48
G
90
Posts: 7,347
Reputation: 66,749


Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 5 guests