Figured out something interesting today for the hit states, and animation changes.
I set it up, so all my hit actions use the same number of frames, but how long the animations should last depends on the hit time. How long a hit stun is set for in the attack properties.
I've set this up to play the animations at certain frames, depending on what the hit stun is set to. It helps minimise the look of animations getting cut off, if the hit stun ends before the animation is done playing. The character would cancel the stun and go to the fight stance.
With this, it will only play part of the hit stun start up, and cancel to part of the hit stun recovery, so the animation plays smoothly, skipping just the frames needed to have the animation not cancel mid way.
It'll play normally like this.
1 to 12, then 1 to 12.
If the hit stun is shorter, it'll play something like
1 to 6, then 7 to 12
A simple example is if the hit stun is 0 to 24 and back to 0.
If the hit stun is shorter, it would play 0 to 12 then, 11 to 0. Instead of going all the way up 0 to 24 then 23 to 0.
If this makes any sense...
Anyway, here's the code and I know there are better ways to set this up. I'm just looking at the idea.
[State 0, 0]
type = ChangeAnim
trigger1 = time > Gethitvar(hittime)/2
value = 5005 + GetHitVar(animtype) + (GetHitVar(groundtype)=2)*10
elem = Gethitvar(hittime)-time
persistent = 0
I'm setting up some frame data, and figure this out just now. Thought it was pretty neat.
Otherwise, if there aren't too many differences in hit stun timing. I would make a different animation for every possible setting. Skipping that set up, and having it work for real instead with full animations.
My characters have close to 100 Hit def's and I'm always messing with the settings, so I'm not even going to bother, but for this project it may work.