YesNoOk
avatar

Slow down during hit animation (Read 370 times)

Started by bzior, November 21, 2020, 08:55:44 PM
Share this topic:
Slow down during hit animation
#1  November 21, 2020, 08:55:44 PM
  • avatar
    • France
Hello everyone.

I was wondering if any of you could help me achieve what I want. Basically I would like to change the frame during which the slow down occurs when a character is getting hit. I figure this could be set in the Common1.cns but I cant manage to make it work.

Would you kindly point me towards the solution?

Thanks
Last Edit: November 22, 2020, 05:02:02 PM by bzior
Re: Slow down during hit animation
#2  November 21, 2020, 11:53:33 PM
  • ***
  • Non est hoc propter hoc sed propter est hoc
    • USA
    • doubletrend-zeta.neocities.org/
Apologies, I first was unsure if I misread it so I had to change my answer a bit. I think I get what you're looking for but if I'm wrong feel free to correct me.

If you have a slow down code already, such as this one, and you want only a certain frame or time to slow down, then you can make the trigger for your slow down something like

Code:
Trigger1=movehit && time=[10,20] 
Or
Code:
trigger1=movehit && animelemtime(x) >=0
The first would make it only slowdown if the move hits and the current state time is 10 to 20 ticks, and the second is a more specific type where you put the frame you want the slow down to occur if the move hits.
In the second you can add another "&& animelemtime(x) >=0" for the next frame and so on if you want it to be more than one frame.
Re: Slow down during hit animation
#3  November 22, 2020, 12:09:43 AM
  • avatar
    • France
First of all thanks for the reply and your help.

Basically, this is what i want to achieve. When a character hits, the other gets into the "being hit" animation, State 5000, and the first frame of that animation is slowed down a bit to show the hit. What i would want is for that slow down, which isnt one really coded by anything i think, to  happen on the second frame of the "being hit" animation.

Hope I'm being clear enough. Let me know if that's at least possible and if so, if you could help me.

Or if the tip you gave me would work for exactly that, then I'll get it to work based on that tip.

Thanks
Last Edit: November 22, 2020, 12:18:25 AM by bzior
Re: Slow down during hit animation
#4  November 22, 2020, 06:04:39 AM
  • ***
  • Non est hoc propter hoc sed propter est hoc
    • USA
    • doubletrend-zeta.neocities.org/
If you want the slowdown to affect both player 1 and player 2, then your solution can be just placing a sctrl like the one in the posted I linked to in your state:
Code:
[State ****: Pause]
type = Pause
triggerall = (GameTime%3) = 0
trigger1 = enemy,movetype=H && enemy,anim=5000 && enemy,animelemtime(2)>=0
time = 1
movetime = 1
ignorehitpause = 1
And editing the time and movetime as you wish.

If you want the slowdown to affect only p2, the best way is to make a custom animation where the frames of the normal animation (such as 5000) are doubled, and custom state, and send your enemy to that state when you hit them by adding it to your hitdef
Code:
[State 0, HitDef]
type = HitDef
trigger1 = animelem=2
attr = S,NA        ;SCA,NA,SA,HA,NP,SP,HP,NT,ST,HT
hitflag = MAF        ;HLAFD+-
guardflag = MA         ;HLA
;affectteam = E          ;B,E,F
animtype = Light          ;Light, Medium, Hard, Back, Up, DiagUp
;...
p2stateno=XXXX        ;change "XXXX" to your stateno

and the state could look like this
Code:
; your state
[Statedef XXXX]
type    = S
movetype= H
physics = N
velset = 0,0

[State XXXX]
type = ChangeAnim2
trigger1 = Time = 0
value = XXXX        ;change "XXXX" to the number of your slowed down animation

;...........other stuff you might want to add will go between...................

[State XXXX] ;self state to return them to their own states
type = SelfState
trigger1 = HitShakeOver
value = 5030

Again, if I'm missing something else you're looking for be sure to tell me.
Last Edit: November 22, 2020, 06:20:08 AM by Bannana
Re: Slow down during hit animation
#5  November 22, 2020, 02:32:31 PM
  • avatar
    • France
Thank you so much!
I will try that and let you know how it went.
Re: Slow down during hit animation
#6  November 22, 2020, 05:02:38 PM
  • avatar
    • France
It worked! Thanks again!