YesNoOk
avatar

unable to block cross ups. (Read 1575 times)

Started by rednavi, September 15, 2014, 03:01:15 am
Share this topic:
unable to block cross ups.
#1  September 15, 2014, 03:01:15 am
  • avatar
  • ******
    • USA
I have an issue with aerial moves that can hit both sides. My characters can't block those attacks at all, even though they're getting attacked long after they're done turning and all.



Basically, once the enemy is past your axis you can't block his attack unless he's facing towards you. I assume this happens because of the way inguarddist works like. This is the changestate from state 0 to the guard start state (It's a fullgame so I needed to code these otherwise hardcoded changestates):

Code:
; SYSTEM: GUARD START - DUMMY SET
[State 0]
type = ChangeState
value = 120
triggerall = roundstate=2&&numhelper(9502)&&numenemy&& Movetype!=H
triggerall = numhelper(9555)=0&&sysfvar(4)=[0,4] ; DUMMY ON ANY ACTION
triggerall = (floor(enemy,fvar(32))%10)=1&&sysvar(4)>0||(floor(enemy,fvar(32))%10)>1 ; DUMMY ON GUARD
trigger1 = !var(45)&&(var(6)=[2,3])&&!fvar(0)&&inguarddist

; SYSTEM: GROUND GUARD
[State 0]
type = ChangeState
value = 120
triggerall = roundstate=2&&inguarddist&&numenemy&&Movetype!=H
triggerall = numhelper(9555)||numhelper(9555)=0&&sysfvar(4)=[50,59] ; HUMAN TEAM
trigger1 = !fvar(0)&&!var(45)&&(var(6)=[2,3])&&(var(37)=4||var(37)=1) ; CMD

Basically, the first changestate is for the dummy (You can see how the dummy blocks any attack that's not a crossup) and the second for humans. Humans have the same issue with attacks. Pretty sure "inguarddist" is the one to blame for as it's the only trigger that reads when to actually block (The rest are just flags to know if you're alive and if the dummy is set to guarding or if you're a human and you're holding backwards).

Is there some sort of parameter in the hitdefs or any sctrl to fix this so your attack distance is spread to both sides of your axis while you're attacking?

I actually had an idea while I was writing this (LOL) which involves having a helper face the other side and put it into an attack state with an "attackdist" sctrl while you're executing a cross up attack. That will definitely fix this issue but I'll leave this open in the meantime just to see if I'm missing some stupid parameter that could easily fix this.
Last Edit: September 15, 2014, 03:27:34 am by -Red-
Re: unable to block cross ups.
#2  September 15, 2014, 07:05:20 am
  • *****
  • Shame on you!
    • USA
It seems like you may have blocked out a proper Turn code some where. Im just thinking this because you put it was a full game.

What makes me really think this, the dummy instantly turns when he's hit. Then after the hit reaction he turns to face the player.
Set up a debug clipboard to see which way the players are facing. Then you'll know if they're actually facing the right way.
vVv N00bSaibot & Muramasa RoofTop vVv
Re: unable to block cross ups.
#3  September 15, 2014, 02:28:33 pm
  • avatar
  • ******
    • USA
I already ruled that out. See, once you change to the turning state you're already facing the other side (The animation is tricking you into thinking that you're still turning).

The video also shows several instances where the turning state was already left several frames ago so that's not really the issue (The very first cross up, the one with a punch, is an example). The punch cross up actually turns the enemy to the other side when it hits in that specific attack frame as an intended behavior.
Last Edit: September 15, 2014, 02:34:46 pm by -Red-
Re: unable to block cross ups.
#4  September 15, 2014, 07:13:01 pm
  • ***
  • ^First attempt ain't so bad......
    • buckus.mugen-infantry.net/
I'm literally experiencing the same thing with my full game. Everything is hard coded (thanks to your guide), and cross up are unblockable. I tried a hitoverride that triggers when you're holding back and enemy is in an attack state within range (-200,200 to test). Didn't go so well, as it turned into an autoguard that doesn't turn off all the time. Maybe it could work if I messed with it more, but using a helper seems like the best solution.
Re: unable to block cross ups.
#5  September 16, 2014, 04:49:41 am
  • *****
  • Shame on you!
    • USA
Well with cross-ups, I know a Sakura who's hurricane kick is GOD at crossing up. I knowingly have to press the "wrong" direction to block it at a specific point. My friend was amazed when I learned this skill.
Try to walk towards the attack and see if it blocks the cross-up. I've learned to do this in other actual arcade games too.
 
vVv N00bSaibot & Muramasa RoofTop vVv
Re: unable to block cross ups.
#6  September 16, 2014, 06:23:36 am
  • avatar
  • ******
    • USA
Do you really think I haven't tried to block an incoming attack by pressing the opposite direction after all the research I've done before creating the thread? Give me more credit than that :| . I mean even the dummy set to auto guard can't guard it.

The issue here is that "inguarddist" only takes the attack distance of the enemy in mind if he's facing towards you. Once the opponent jumped over you and is not facing towards you the attack no longer has a guard distance attribute to you. It is like this so for example Ralf's charged Galactica Phantom will not trigger a guarding state if you jump behind him and then hold backwards.

What I'm looking for is a way to flag certain attacks so they trigger the opponent's guard even if they're past their axis.
Re: unable to block cross ups.
#7  September 16, 2014, 06:57:58 am
  • *****
  • Shame on you!
    • USA
One way I think you could solve this problem, but create a ton of work is to add a statedef -2 turn state to all attacks. You'd have to create mirrored animations. I mean since it's a full game you'd be able to use this method. Probably not worth the effort though. Plus you might get other side-effects.

You could do a helper method. Spawn the helper in -2 when ever the player isnt facing you. put it say 100 pixels behind you and have it switch states if it's in guard distance. Then have your character monitor what state the helper's in and switch to guard when it enters the second state. have it destroy itself if P2 is facing the proper direction.

You could create a general hitoverride in -2. Make it so that if the character's in the air, not facing you, you're holding "back", it sends you to highblock. Not sure if you'd want to include a velocity X check in there. That would only help with self cross ups. P2 jumps straight up, you walk under and get hit.
vVv N00bSaibot & Muramasa RoofTop vVv
Re: unable to block cross ups.
#8  September 16, 2014, 07:22:06 am
  • avatar
  • ******
    • USA
The second option is the only one one should actually use, the rest can and will break stuff. I already fixed this with ease by spawning a helper that mimics my animation but reverses its facing and uses an empty hitdef with a generic guarding distance, then it just copies the movetype of the parent to know when to trigger the opponent's inguarddist.

All these are just hack jobs to get over the issue, what I was looking for was for a parameter I may've been missing that could fix all of this with just a sctrl or a parameter for hitdefs, guess it doesn't exist.
Last Edit: September 16, 2014, 07:43:10 pm by -Red-
Re: unable to block cross ups.
#9  September 16, 2014, 07:43:45 pm
  • avatar
  • ******
    • USA
@A$AP Buckus: Here is the whole piece of coding in case you want to fix your own issues with cross ups:

This goes inside statedef -2. Feel free to use any state number for the helper. Its ID is also never referenced anywhere else so you can change that here and will not need to change it anywhere else. Stateno range is the usual aerial basic attacks' range. Tweak it to add any other moves like character specific stuff for example.

Code:
[State -2]
type = helper
trigger1 = !numhelper(9392)&&movetype=A&&stateno=[600,699]
stateno = 9392
id = 9392
pos = 0,0
name = "CROSS UP FIX"
pausemovetime = 999999999
ownpal = 1
ignorehitpause = 1

And this is the helper's state itself. It's a copy-paste and forget block. You only need to change the statedef number in case you changed it in the helper sctrl from step 1, and tweak the destroyself if you added any extra states in the sctrl trigger. I used angledraw instead of an assertspecial to make the helper invisible just to avoid any rare circumstance where the assertspecial may have a 1 frame delay to get activated (Unlikely if you only use one flag but hey! Mugen!).

Of course, you may need to increase the attackdist value depending of how's your game like.

Code:
;-------------------------------------------------------------------------
; CROSS UP GLITCH FIX
;-------------------------------------------------------------------------

[Statedef 9392]
type = A
movetype = A
physics = N
sprpriority = 0
ctrl = 0

; FACE TO THE OTHER SIDE TO FIX UNBLOCKABLE CROSS UP GLITCH
[State 9502]
type = Turn
trigger1 = facing=parent,facing
[State 0, NotHitBy]
type = NotHitBy
trigger1 = 1
value = SCA
time = 99999999
ignorehitpause = 1
[State 9390]
type = Width
trigger1 = 1
value = 0,0
[State 9390]
type = PosSet
trigger1 = 1
x = ceil(parent,pos x)
y = ceil(parent,pos y)
[State 9390]
type = ScreenBound
trigger1 = 1
value = 0
movecamera = 0,0
[State 0, AngleDraw]
type = AngleDraw
trigger1 = 1
value = 1
scale = 0,0
ignorehitpause = 1
[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = 1
value = parent,anim
elem = parent,animelemno(0)
ignorehitpause = 1

[State 3000000]
type = HitDef
trigger1 = 1
getpower = 0
givepower = 0
hitflag =
hitonce = 1
[State 0, AttackDist]
type = AttackDist
trigger1 = 1
value = 160
ignorehitpause = 1
[State 3000000]
type = STATETYPESET
trigger1 = parent,statetype=S
statetype = s
ignorehitpause = 1
[State 3000000]
type = STATETYPESET
trigger1 = parent,statetype=c
statetype = c
ignorehitpause = 1
[State 3000000]
type = STATETYPESET
trigger1 = parent,statetype=a
statetype = a
ignorehitpause = 1

[State 3000000]
type = destroyself
trigger1 = parent,movetype!=A||parent,stateno!=[600,699]
ignorehitpause = 1
Last Edit: September 17, 2014, 12:49:33 am by -Red-
Re: unable to block cross ups.
#10  September 17, 2014, 07:50:47 pm
  • ***
  • ^First attempt ain't so bad......
    • buckus.mugen-infantry.net/
Thanks a lot. I appreciate it.