Hello Guest

Author Topic: Chaining Animations  (Read 4406 times)

Copywright

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 33
    • View Profile
Chaining Animations
« on: April 19, 2013, 10:47:52 pm »
Hey,

I'm preparing sprites for a fighting game, and I have a quick question about how to best handle animating combos in tk2D. I imagine that I'd have the whole combo in one animation and have triggers to check if what's needed to go onto the next chain in the combo is fulfilled (ex, pressing attack once plays only the first chain defined by the trigger in the animation editor, pressing attack twice gets you to the second chains, etc.).

However, I just wanted to ask if there'd be a better way to handle this. Thanks.

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: Chaining Animations
« Reply #1 on: April 19, 2013, 11:17:40 pm »
I don't think triggers will be suitable for this, unless you're willing to go in and put a lot of markers, or your triggers naturally only last for 1-2 frames. The idea is you want to know if input on a particular frame corresponds to the correct frame to continue a combo.

Also, if you think about potential combo trees - things get a bit more complicated there, as the data would have to identify more than just one bit of data.

You can extend the data system to store more complex information - perhaps use the int value to index into a combo tree table or something like that.

Just my 2c :)

Copywright

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 33
    • View Profile
Re: Chaining Animations
« Reply #2 on: April 20, 2013, 03:16:26 am »
Hm, can you explain how exactly I'd implement this? What I gather is having an FSM for combos, and switch the the animation playing based on the previous and current states. Instead of just one animation for the complete combo, I'd chop the chains into different clips? Would I be able to have a trigger at the end of the animation, that'd be used to check the state in the combo FSM, and transition to the next chain?

Is this what you mean, or am I missing this entirely? If you could explain a bit more, or reference with psuedocode, I'd be grateful!

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: Chaining Animations
« Reply #3 on: April 20, 2013, 10:36:52 am »
Thats pretty much it - you can have triggers at the end of the animations / middle of animations to trigger states in your FSM.

Copywright

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 33
    • View Profile
Re: Chaining Animations
« Reply #4 on: April 21, 2013, 02:07:27 am »
Thanks for the help! Also, it'd be possible to set triggers on animations for when game objects containing compound colliders should be set active/inactive?