YesNoOk
avatar

Safe Fall/Recovery (Mechanics) (Read 1212 times)

Started by Niitris, November 25, 2016, 03:43:50 pm
Share this topic:
Safe Fall/Recovery (Mechanics)
New #1  November 25, 2016, 03:43:50 pm
  • ******
Safe fall is to recover from a falling state and land on your feet. This is done to keep your momentum, as well as avoiding your opponent's wake-up pressure. However, your ability to recover is dependent on P2's HitDef. If P2 has FallRecovery=0, or if FallRecoveryTime is higher than the time it takes for you to hit the ground, you will be unable to recover.

Using KFM's command file, the input for recovery is x+y. There are two ways to do this.

Air Recovery
This allows you to recover in mid-air.
Code:
;Found in common1.cns

; Air get-hit (fall recovery in air)
[Statedef 5210]
type    = A
movetype= I
physics = N
anim = 5210
ctrl = 0

[State 5210, 1]
type = PosFreeze
trigger1 = Time < 4

[State 5210, 2] ;Turn if not facing opponent
type = Turn
trigger1 = Time = 0
trigger1 = p2dist X < Const720p(-80)

[State 5210, 1.0 behavior 1]
type = VelMul
trigger1 = Time = 4
x = Const(velocity.air.gethit.airrecover.mul.x)
y = Const(velocity.air.gethit.airrecover.mul.y)

[State 5210, 1.0 behavior 2]
type = VelAdd
trigger1 = Time = 4
x = Const(velocity.air.gethit.airrecover.add.x)
y = Const(velocity.air.gethit.airrecover.add.y)

[State 5210, 2] ;Go up
type = VelAdd
trigger1 = Time = 4
trigger1 = Command = "holdup"
y = Const(velocity.air.gethit.airrecover.up)

[State 5210, 2] ;Go down
type = VelAdd
trigger1 = Time = 4
trigger1 = Command = "holddown"
y = Const(velocity.air.gethit.airrecover.down)

[State 5210, 2] ;Go fwd
type = VelAdd
trigger1 = Time = 4
trigger1 = Command = "holdfwd"
x = Const(velocity.air.gethit.airrecover.fwd)

[State 5210, 2] ;Go back
type = VelAdd
trigger1 = Time = 4
trigger1 = Command = "holdback"
x = Const(velocity.air.gethit.airrecover.back)

[State 5210, 3] ;invincible
type = NotHitBy
trigger1 = Time = 0
value = SCA
time = 15

[State 5210, 4] ;can attack
type = CtrlSet
trigger1 = Time = 20
value = 1

[State 5210, 5]
type = VelAdd
trigger1 = Time >= 4
y = Const(movement.air.gethit.airrecover.yaccel)

[State 5210, 5] ;Land on ground
type = ChangeState
trigger1 = Vel Y > 0
trigger1 = Pos Y >= 0
value = 52 ;Jump land
ctrl = 1

Safe Fall
This is when you recover just before hitting the ground, safely landing on your feet instead.
Code:
; Found in common1.cns

; Air get-hit (fall recovery on ground)
[Statedef 5201]
type    = A
movetype= H
physics = A
anim = 5200

[State 5201, 1] ;Turn if not facing opponent
type = Turn
trigger1 = Time = 0
trigger1 = p2dist X < Const720p(-20)

[State 5201, 2]
type = VelSet
trigger1 = Time = 0
x = Const(velocity.air.gethit.groundrecover.x)
y = Const(velocity.air.gethit.groundrecover.y)

[State 5201, 3]
type = PosSet
trigger1 = Time = 0
y = 0

[State 5201, 4] ;invincible
type = NotHitBy
trigger1 = 1
value = SCA
time = 1
Last Edit: November 25, 2016, 07:20:36 pm by Niitris
Re: Safe Fall/Recovery
#2  November 25, 2016, 04:24:33 pm
  • **
    • France
I just wanted to add clarification to the "safe" attribute.

Statedef 5210 - "Air get-hit (fall recovery in air)" in KFM's common1.cns −> 2 state controllers to focus on :
Spoiler: NotHitBy & CtrlSet controllers (click to see content)

Statedef 5201 - "Air get-hit (fall recovery on ground)" in KFM's common1.cns −> a similar state controller to pay attention to :
Spoiler: NotHitBy controller (click to see content)

Out of the ticks when invincibility is granted, your character can still be vulnerable if opponent attacks.
- samurais, swords & stuff ? → Another Blade
Last Edit: November 25, 2016, 04:30:00 pm by mr_bourrepalestick