YesNoOk
avatar

Cancel fall.defence_up temporarily (Read 2665 times)

Started by Skyro, July 09, 2020, 07:56:00 pm
Share this topic:
Cancel fall.defence_up temporarily
#1  July 09, 2020, 07:56:00 pm
  • avatar
  • *
    • Cameroon
Please, I would like to know how to decrease or cancel the fall.defence_up for a while for a hit. My problem is that when I chain combos and the combo hit number is quite high, by launching my hyper, the damage is reduced in accordance with fall.defence_up by default. If possible I would like to cancel the fall.defence_up for my hyper and leave it normal for the other shots. Because it is difficult to chain a hyper after a good combo (the power of my hyper is reduced because of fall.defence_up, I would like to be able to prevent that. I would like it not to affect my hyper).
Re: Cancel fall.defence_up temporarily
#2  July 10, 2020, 12:18:49 am
  • ****
  • CPU Purple Heart
    • USA
    • https://www.pixiv.net/en/users/8108265
 It's hardcoded in stateno 5100 and 5070 as well as (I think) with trip animtype. You will need to use a series of custom hitfall states to bypass fall.defence_up entirely complete with a custom liedown state. Copypaste all states starting from 5020 all the way to state 5110 and renumber them so that they fall outside the common state numbers. In statedef -2, you put a series of targetstates to force P2 into custom hitfall if it detects the target is in the common hitfall states.

 You could simply copypaste them from my characters since they all use this system.

 Edit: Alternatively, the super easy way is just set the character's fall.defence_up to 0, but you will have to do this for every single character in your roster and it won't work in public releases for obvious reasons.
Last Edit: July 10, 2020, 12:34:57 am by Nep Heart
Re: Cancel fall.defence_up temporarily
#3  July 11, 2020, 01:00:36 am
  • avatar
  • *
    • Cameroon
Very well. I am not very sure that I understood the principle. I tried the first idea with the copy paste of the hitfalls but without success. The best is to copy the code of your characters. Where can I access your characters?
Re: Cancel fall.defence_up temporarily
#4  July 11, 2020, 01:31:42 am
  • ****
  • CPU Purple Heart
    • USA
    • https://www.pixiv.net/en/users/8108265
Re: Cancel fall.defence_up temporarily
#5  July 11, 2020, 01:58:21 am
  • avatar
  • *
    • Cameroon
is that code ?

;---------------------------------------------------------------------------

; Custom Get Hit
[Statedef 5580]
type    = S
movetype= H
physics = N
velset = 0,0
anim = 5000

[State 5580, Matchover]
type = posset
trigger1 = !alive
y = 0

[State 5580, 1]
type = ChangeAnim
trigger1 = Time = 0
trigger1 = GetHitVar(animtype) != [3,5]
value = cond((GetHitVar(groundtype) = 1),5000,5010) + GetHitVar(animtype)

[State 5580, 2]
type = ChangeAnim
trigger1 = Time = 0
trigger1 = GetHitVar(animtype) = [3,5]
value = 5030

[State 5580, 3]
type = ChangeAnim
trigger1 = Time = 0
trigger1 = (GetHitVar(animtype) = [4,5]) && (SelfAnimExist(5047 + GetHitVar(animtype)))
value = 5047 + GetHitVar(animtype)

[State 5580, 4]
type = ChangeAnim
trigger1 = Time > 0
value = anim

[State 5580, 5]
type = StateTypeSet
trigger1 = Time = 0
trigger1 = GetHitVar(yvel) != 0 || GetHitVar(fall)
trigger2 = Pos Y != 0
statetype = a

[State 5580, 6]
type = SelfState
trigger1 = HitShakeOver
trigger1 = GetHitVar(yvel) = 0 && !GetHitVar(fall)
value = 5001

[State 5580, 7]
type = SelfState
trigger1 = HitShakeOver
value = 5030
Re: Cancel fall.defence_up temporarily
#6  July 11, 2020, 02:46:59 am
  • ****
  • CPU Purple Heart
    • USA
    • https://www.pixiv.net/en/users/8108265
No, states 5570 to 5576 are the custom hitfall states I use. You may also want to look for the corresponding statedef -2 coding since the targetstate needs to exist to send them to those custom hitfall states to begin with.

Spoiler, click to toggle visibilty
Re: Cancel fall.defence_up temporarily
#7  July 11, 2020, 04:29:26 am
  • avatar
  • *
    • Cameroon
i have paste this :
;----------------------------------------------------------------------
; Air get-hit (shaking)
[Statedef 5570]
type    = A
movetype= H
physics = N
velset = 0,0

[State 5570, Post Juggle]
type = HitBy
triggerall = numenemy
trigger1 = enemy,var(10) > 240
time = 600
value = SCA,HA,HP,HT
ignorehitpause = 1

[State 5570, 1] ;Anim for HIT_LIGHT to HIT_HARD
type = ChangeAnim
trigger1 = Time = 0
trigger1 = GetHitVar(animtype) != [3,5]
value = cond((GetHitVar(airtype) = 1),5000,5010) + GetHitVar(animtype)

[State 5570, 2] ;Anim for HIT_BACK
type = ChangeAnim
trigger1 = Time = 0
trigger1 = GetHitVar(animtype) = [3,5]
value = 5030

[State 5570, 3] ;Anim for HIT_UP/HIT_DIAGUP (only if it exists)
type = ChangeAnim
trigger1 = Time = 0
trigger1 = (GetHitVar(animtype) = [4,5]) && (SelfAnimExist(5047 + GetHitVar(animtype)))
value = 5047 + GetHitVar(animtype) ;5051 - 4 + type

[State 5570, 4] ;Freeze anim
type = ChangeAnim
trigger1 = Time > 0
value = anim

[State 5570, 5]
type = ChangeState
trigger1 = HitShakeOver
value = 5571

;---------------------------------------------------------------------------
; Air get-hit (knocked away)
[Statedef 5571]
type    = A
movetype= H
physics = N
ctrl = 0

[State 5571, 1]
type = ChangeAnim
trigger1 = Anim != [5000, 5199]
trigger1 = SelfAnimExist(5030)
value = 5030

[State 5571, 2]
type = VelAdd
trigger1 = 1
y = 0.48

[State 5571, 3]
type = VelSet
trigger1 = Time = 0
x = gethitvar(xvel)*facing
y = gethitvar(yvel)

[State 5571, 5]
type = ChangeState
trigger1 = HitOver
trigger2 = Vel Y > 0    ;Hit ground
trigger2 = Pos Y >= Const(movement.air.gethit.groundlevel)
value = 5573 ;HITA_FALL

[State 5571, 6]
type = ChangeState
trigger1 = AnimTime = 0
value = 5572 ;Air get-hit (transition)

;---------------------------------------------------------------------------
; Air get-hit (transition)
[Statedef 5572]
type    = A
movetype= H
physics = N

[State 5572, 1]
type = ChangeAnim
trigger1 = Time = 0
trigger1 = SelfAnimExist(5035)
trigger1 = Anim != [5051,5059] ;Not if in hit up anim
trigger1 = Anim != 5090 ;Not if hit off ground anim
value = 5035

[State 5572, 2]
type = VelAdd
trigger1 = 1
y = 0.48

[State 5572, 4]
type = ChangeState
trigger1 = AnimTime = 0 ;Anim is over
trigger2 = Vel Y > 0    ;Hit ground
trigger2 = Pos Y >= Const(movement.air.gethit.groundlevel)
trigger3 = Time = 0     ;No transition anim
trigger3 = Anim != 5035 ;.
value = 5573 ;Air get-hit (falling)

;---------------------------------------------------------------------------
; Air get-hit (falling)
[Statedef 5573]
type    = A
movetype= H
physics = N

[State 5573, 1] ;Change anim when done with transition
type = ChangeAnim
trigger1 = AnimTime = 0
trigger1 = Anim = 5035
trigger2 = Time = 0     ;If no transition anim
trigger2 = Anim != 5035
trigger2 = (Anim != [5051, 5059]) && (Anim != [5061, 5069])
trigger2 = Anim != 5090 ;Not if hit off ground anim
value = 5050

[State 5573, 2] ;Coming down anim
type = ChangeAnim
trigger1 = anim = [5050,5059]
trigger1 = Vel Y >= cond(anim = 5050, Const720p(4), Const720p(-8))
trigger1 = SelfAnimExist(anim+10)
value = anim+10
persistent = 0

[State 5573, 3] ;Gravity
type = VelAdd
trigger1 = 1
y = 0.48

[State 5573, 4] ;Recover near ground
type = SelfState
triggerall = Vel Y > 0
triggerall = Pos Y >= Const()
triggerall = alive
triggerall = CanRecover
trigger1 = Command = "recovery"
value = 5200 ;Air get-hit (fall recovery on ground)

[State 5573, 5]; Recover in mid air
type = SelfState
triggerall = Vel Y > Const(movement.air.gethit.airrecover.threshold)
triggerall = alive
triggerall = CanRecover
trigger1 = Command = "recovery"
value = 5210 ;Air get-hit (fall recovery in air)

[State 5573, 6]
type = ChangeState
trigger1 = Vel Y > 0
trigger1 = Pos Y >= cond((anim = [5051,5059]) || (anim = [5061,5069]), 0, Const(movement.air.gethit.groundlevel))
value = 5574 ;Downed get-hit (hit ground from fall)

;---------------------------------------------------------------------------
; Downed get-hit (hit ground from fall)
[Statedef 5574]
type    = L
movetype= H
physics = N

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

[State 5574, Var] ;Save fall velocity
type = VarSet
trigger1 = Time = 0
sysvar(1) = floor(vel y)

[State 5574, 2] ;Hit ground anim (normal)
type = ChangeAnim
triggerall = time = 0
trigger1 = (anim != [5051,5059]) && (anim != [5061,5069])
trigger2 = !SelfAnimExist(5100 + (anim % 10))
value = 5100

[State 5574, 3] ;Hit ground anim (for hit up)
type = ChangeAnim
trigger1 = time = 0
trigger1 = (anim = [5051,5059]) || (anim = [5061,5069])
trigger1 = SelfAnimExist(5100 + (anim % 10))
value = 5100 + (anim % 10)

[State 5574, 4]
type = PosSet
trigger1 = Time = 0
y = 0

[State 5574, 5]
type = VelSet
trigger1 = Time = 0
y = 0

[State 5574, 6] ;Reduce speed
type = VelMul
trigger1 = Time = 0
x = 0.75

[State 5574, 7]
type = ChangeState
trigger1 = Time = 0
trigger1 = GetHitVar(fall.yvel) = 0
value = 5575 ;Downed get-hit (lying down)

[State 5574, 9]
type = HitFallDamage
trigger1 = Time = 3

[State 5574, EnvShake]
type = EnvShake
triggerall = cond (sysvar(1) <= Const720p(56),0,1)
trigger1 = time = 1
time = 5
ampl = 8
freq = 180

[State 5574, 11]
type = PosFreeze
trigger1 = 1

[State 5574, 12]
type = changestate
trigger1 = AnimTime = 0
value = 5575

;---------------------------------------------------------------------------
; Downed get-hit (bounce off ground)
[Statedef 5575]
type    = L
movetype= H
physics = N

[State 5575, 1] ;Coming hit ground anim (normal)
type = ChangeAnim
triggerall = time = 0
trigger1 = anim != [5101,5109]
trigger2 = !SelfAnimExist(5160 + (anim % 10))
value = 5160

[State 5575, 2] ;Coming hit ground anim (for hit up)
type = ChangeAnim
triggerall = time = 0
trigger1 = anim = [5101,5109]
trigger1 = SelfAnimExist(5160 + (anim % 10))
value = 5160 + (anim % 10)

[State 5575, 3]
type = HitFallVel
trigger1 = Time = 0

[State 5575, VelMul]
type = VelMul
trigger1 = time = 0
x = 0.5
y = 0.5
ignorehitpause = 1

[State 5575, 4]
type = PosSet
trigger1 = Time = 0
y = Const(movement.down.bounce.offset.y)

[State 5575, 5]
type = PosAdd
trigger1 = Time = 0
x = Const(movement.down.bounce.offset.x)

[State 5575, 6] ;Acceleration
type = VelAdd
trigger1 = 1
y = 0.8

[State 5575, 12]
type = selfstate
trigger1 = canrecover
value = 5110 ;Downed get-hit (bounce off ground)

[State 5575, 12]
type = changestate
trigger1 = !canrecover
value = 5576 ;Downed get-hit (bounce off ground)

;---------------------------------------------------------------------------
; Downed get-hit (lying down)
[Statedef 5576]
type    = L
movetype= H
physics = N

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

[State 5576, 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 5576, 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 5576, 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 5576, 4]
type = HitFallDamage
trigger1 = Time = 0

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

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

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

[State 5576, 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 5576, 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 5576, 11] ;If just died
type = SelfState
triggerall = !alive
trigger1 = AnimTime = 0
trigger2 = SysVar(0) ;SysVar(0) = 1 avoids hit ground frame
trigger3 = Anim = [5110,5119]
value = 5150

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

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

[State 5576, 14] ;Friction
type = VelSet
trigger1 = abs(Vel x) < Const(movement.down.friction.threshold)
persistent = 0
x = 0

[State 5576, Changestate]
type = selfstate
triggerall = anim = [5110,5111]
trigger1 = prevstateno != 5967
trigger1 = time >= 10
trigger2 = prevstateno = 5967
trigger2 = (p2stateno != 5960 || time > 120)
value = 5120
ctrl = 0
Re: Cancel fall.defence_up temporarily
#8  July 11, 2020, 04:30:55 am
  • avatar
  • *
    • Cameroon
thend i pasted this :
[State -2, Custom Fall]
type = TargetState
triggerall = NumTarget
trigger1 = target,stateno != [5570,5573]
trigger1 = target,stateno = 5020
value = 5570
ignorehitpause = 1

[State -2, Custom Fall]
type = TargetState
triggerall = NumTarget
trigger1 = target,stateno != [5570,5573]
trigger1 = target,stateno = 5030
value = 5571
ignorehitpause = 1

[State -2, Custom Fall]
type = TargetState
triggerall = NumTarget
trigger1 = target,stateno != [5570,5573]
trigger1 = target,stateno = 5035
value = 5572
ignorehitpause = 1

[State -2, Custom Fall]
type = TargetState
triggerall = NumTarget
trigger1 = target,stateno != [5570,5573]
trigger1 = target,stateno = 5050
value = 5573
ignorehitpause = 1
Re: Cancel fall.defence_up temporarily
#9  July 11, 2020, 04:35:42 am
  • avatar
  • *
    • Cameroon
But it does not work. :'(
I just wanted to get around the fall.defence_up for one attack (my special), for my stateno 1499 that here:

[Statedef 1499]
type    = S            ;State-type: S-stand, C-crouch, A-air, L-liedown
movetype= A            ;Move-type: A-attack, I-idle, H-gethit
physics = S            ;Physics: S-stand, C-crouch, A-air
juggle  = 1            ;Number of air juggle points move takes
;Commonly-used controllers:
velset = 0,0         ;Set velocity (x,y) (Def: no change)
ctrl = 0            ;Set ctrl (Def: no change)
anim = 1499            ;Change animation (Def: no change)
poweradd = 20
sprpriority = 5         ;Set layering priority to 2 (in front)

[State 1499, AssertSpecial]
type = AssertSpecial
trigger1 = numexplod(1500) || stateno = 1500 || stateno = 1499
flag = timerfreeze

[State 1499, 1]
type = HitDef
trigger1 = Time = 0
trigger2 = AnimElem = 2
attr = S, NA         ;Attribute: Standing, Normal Attack
damage = 600, 0         ;Damage that move inflicts, guard damage
animtype = light         ;Animation type: Light, Medium, Heavy, Back (def: Light)
guardflag = MA         ;Flags on how move is to be guarded against
hitflag = MAF         ;Flags of conditions that move can hit
priority = 3, Hit         ;Attack priority: 0 (least) to 7 (most), 4 default
               ;Hit/Miss/Dodge type (Def: Hit)
pausetime = 7, 17         ;Time attacker pauses, time opponent shakes
sparkno = 0            ;Spark anim no (Def: set above)
sparkxy = -1000, -5000      ;X-offset for the "hit spark" rel. to p2,
               ;Y-offset for the spark rel. to p1
hitsound = 0, 0         ;Sound to play on hit
guardsound = 6, 0         ;Sound to play on guard
ground.type = high      ;Type: High, Low, Trip (def: Normal)
ground.slidetime = 10      ;Time that the opponent slides back
ground.hittime  = 10      ;Time opponent is in hit state
ground.velocity = -5      ;Velocity at which opponent is pushed
airguard.velocity = -1.9,-.8   ;Guard velocity in air (def: (air.xvel*1.5, air.yvel/2))
air.type = high         ;Type: High, Low, Trip (def: same as ground.type)
air.velocity = -1.4,-3      ;X-velocity at which opponent is pushed,
               ;Y-velocity at which opponent is pushed
air.hittime = 12         ;Time before opponent regains control in air
fall = 1

[State 1499, SLP 1 MISS]
type = ChangeState
trigger1 = AnimTime = 0
value = 0
ctrl = 1
Re: Cancel fall.defence_up temporarily
#10  July 11, 2020, 09:23:23 am
  • ****
  • CPU Purple Heart
    • USA
    • https://www.pixiv.net/en/users/8108265
 I'm not seeing how that wouldn't work unless you misplaced the statedef -2 targetstates outside of statedef -2 itself.

 If that still isn't working, only compromise I can think of detect if P2 has entered and passed state 5100 or 5070 and increase damage on that hitdef in accordance to P2's fall.defence_up constant.
Re: Cancel fall.defence_up temporarily
#11  July 11, 2020, 11:31:45 am
  • avatar
  • *
    • Cameroon
ok with your compromise, could you modify my statedef 1499 hitdef to make it work? Because this is why I wanted to get around the fall.defence_up

[Statedef 1499]
type    = S            ;State-type: S-stand, C-crouch, A-air, L-liedown
movetype= A            ;Move-type: A-attack, I-idle, H-gethit
physics = S            ;Physics: S-stand, C-crouch, A-air
juggle  = 1            ;Number of air juggle points move takes
;Commonly-used controllers:
velset = 0,0         ;Set velocity (x,y) (Def: no change)
ctrl = 0            ;Set ctrl (Def: no change)
anim = 1499            ;Change animation (Def: no change)
poweradd = 20
sprpriority = 5         ;Set layering priority to 2 (in front)

[State 1499, AssertSpecial]
type = AssertSpecial
trigger1 = numexplod(1500) || stateno = 1500 || stateno = 1499
flag = timerfreeze

[State 1499, 1]
type = HitDef
trigger1 = Time = 0
trigger2 = AnimElem = 2
attr = S, NA         ;Attribute: Standing, Normal Attack
damage = 600, 0         ;Damage that move inflicts, guard damage
animtype = light         ;Animation type: Light, Medium, Heavy, Back (def: Light)
guardflag = MA         ;Flags on how move is to be guarded against
hitflag = MAF         ;Flags of conditions that move can hit
priority = 3, Hit         ;Attack priority: 0 (least) to 7 (most), 4 default
               ;Hit/Miss/Dodge type (Def: Hit)
pausetime = 7, 17         ;Time attacker pauses, time opponent shakes
sparkno = 0            ;Spark anim no (Def: set above)
sparkxy = -1000, -5000      ;X-offset for the "hit spark" rel. to p2,
               ;Y-offset for the spark rel. to p1
hitsound = 0, 0         ;Sound to play on hit
guardsound = 6, 0         ;Sound to play on guard
ground.type = high      ;Type: High, Low, Trip (def: Normal)
ground.slidetime = 10      ;Time that the opponent slides back
ground.hittime  = 10      ;Time opponent is in hit state
ground.velocity = -5      ;Velocity at which opponent is pushed
airguard.velocity = -1.9,-.8   ;Guard velocity in air (def: (air.xvel*1.5, air.yvel/2))
air.type = high         ;Type: High, Low, Trip (def: same as ground.type)
air.velocity = -1.4,-3      ;X-velocity at which opponent is pushed,
               ;Y-velocity at which opponent is pushed
air.hittime = 12         ;Time before opponent regains control in air
fall = 1

[State 1499, SLP 1 MISS]
type = ChangeState
trigger1 = AnimTime = 0
value = 0
ctrl = 1
Re: Cancel fall.defence_up temporarily
#12  July 12, 2020, 02:55:46 am
  • ****
  • CPU Purple Heart
    • USA
    • https://www.pixiv.net/en/users/8108265
 If you just want to multiply the attack's damage temporarily to compensate for fall.defence_up, this post might be something that you may be looking for.

https://mugenguild.com/forum/msg.1251399

 I would definitely read carefully and modify it accordingly since the Rice was using this for a helper based attack for one.
Last Edit: July 12, 2020, 03:03:47 am by Nep Heart
Re: Cancel fall.defence_up temporarily
#13  July 15, 2020, 05:58:11 am
  • avatar
  • **
    • USA
this might interest you, if it detects that hit var, maybe you can add a -2 state trigger when you are in a certain state (like falling) and add a defencemulset

Re: GetHitVar(*) (Triggers)