YesNoOk
avatar

how to make 2 difference death anim by 2 condition? (Read 10220 times)

Started by alongcaca, October 11, 2024, 06:23:39 am
Share this topic:
how to make 2 difference death anim by 2 condition?
#1  October 11, 2024, 06:23:39 am
  • **
    • Vietnam
Hi everyone
i want make 2 difference death animation by 2 conditions
1/ Condition 1: if get hit by normal attack use death animation 1
2/ Condition 2: if get hit by hyper or super attack use death animation 2
how to code it.
i see the code below for hit life down, but I don't know where to change the condition in the code below to match the above condition.
Thanks for reading
Code:
; HIT_LIEDOWN
[Statedef 5110]
type    = L
movetype= H
physics = N

[State 5110, EnvShake]
type = FallEnvShake
trigger1 = Time = 0

[State 5110, 1] ;For hit up/up-diag type (from state 5081)
type = ChangeAnim
persistent = 0
trigger1 = SelfAnimExist(5110 + (anim % 10))
trigger1 = anim = [5081,5089]
value = 5110 + (anim % 10)

[State 5110, 2] ;Hit ground anim (normal)
type = ChangeAnim
triggerall = time = 0
triggerall = anim != [5110,5119] ;Not already changed anim
trigger1 = anim != [5161,5169]
trigger2 = !SelfAnimExist(5170 + (anim % 10))
value = 5170

[State 5110, 3] ;Hit ground anim (for hit up)
type = ChangeAnim
triggerall = time = 0
triggerall = anim != [5110,5119] ;Not already changed anim
trigger1 = anim = [5161,5169]
trigger1 = SelfAnimExist(5170 + (anim % 10))
value = 5170 + (anim % 10)

[State 5110, 4]
type = HitFallDamage
trigger1 = Time = 0

[State 5110, 5]
type = PosSet
trigger1 = Time = 0
y = 0

[State 5110, Var] ;Get fall velocity
type = VarSet
trigger1 = Time = 0
trigger1 = GetHitVar(fall.yvel) != 0
sysvar(1) = floor(vel y)

[State 5110, 6]
type = PlaySnd
trigger1 = Time = 1
value = S0,6

[State 5110, 7]
type = GameMakeAnim
trigger1 = Time = 0
trigger1 = !SysVar(0)
value = 60 + (sysvar(1) > 5) + (sysvar(1) > 14)
pos = 0, 0
under = sysvar(1) <= 14

[State 5110, 8]
type = VelSet
trigger1 = Time = 0
y = 0

[State 5110, 9] ;For hit up type
type = ChangeAnim
persistent = 0
triggerall = anim = [5171,5179]
triggerall = SelfAnimExist(5110 + (anim % 10))
trigger1 = AnimTime = 0
trigger2 = SysVar(0) ;SysVar(0) = 1 avoids hit ground anim
value = 5110 + (anim % 10)

[State 5110, 10] ;For normal
type = ChangeAnim
persistent = 0
triggerall = Anim != [5111,5119]
trigger1 = AnimTime = 0
trigger2 = SysVar(0) ;SysVar(0) = 1 avoids hit ground frame
value = 5110

[State 5110, 11] ;If just died
type = ChangeState
triggerall = !alive
trigger1 = AnimTime = 0
trigger2 = SysVar(0) ;SysVar(0) = 1 avoids hit ground frame
trigger3 = Anim = [5110,5119]
value = 5150

[State 5110, 12]
type = VarSet
trigger1 = SysVar(0)
trigger1 = Time = 0
sysvar(0) = 0

[State 5110, 13] ;Friction
type = VelMul
trigger1 = 1
x = 0.85

[State 5110, 14]
type = ForceFeedback
trigger1 = alive
trigger1 = Time = 0
time = 8
ampl = 240
waveform = sine

[State 5110, 15]
type = ForceFeedback
trigger1 = !alive
trigger1 = Time = 0
ampl = 200, 7, -.467
time = 30
waveform = sine
Re: how to make 2 difference death anim by 2 condition?
#2  October 16, 2024, 11:16:27 pm
  • *****
  • Shame on you!
    • USA
You might need to make a variable or a hitspark/helper that spawns when the last hit happens. I don't think I've done something like this, so I don't know an exact method.
But you'd use the helper/var/explod to be "1" or "2" so when the round state changes values aren't lost.

I think most chars are set up so that ultras are higher than Statedef 3000. So you could use a check to see what state P2 is in when life = 0 in statedef -2. Whatever you spawn, just set it up so that ifelse( Enemy, StateNo >= 3000, , ) <<< spawns the two values you want.

I could be totally off though.
vVv N00bSaibot & Muramasa RoofTop vVv
Re: how to make 2 difference death anim by 2 condition?
#3  October 17, 2024, 02:15:14 pm
  • **
    • Vietnam
You might need to make a variable or a hitspark/helper that spawns when the last hit happens. I don't think I've done something like this, so I don't know an exact method.
But you'd use the helper/var/explod to be "1" or "2" so when the round state changes values aren't lost.

I think most chars are set up so that ultras are higher than Statedef 3000. So you could use a check to see what state P2 is in when life = 0 in statedef -2. Whatever you spawn, just set it up so that ifelse( Enemy, StateNo >= 3000, , ) <<< spawns the two values you want.

I could be totally off though.

 Thanks for reply, i will try your idea