Block all attacks?

Started by Mr. I, September 14, 2008, 09:44:56 PM

Previous topic - Next topic

Mr. I

I made a floating free movement character who is always in statetype = A who's blocking/guarding mechanism is triggered by a button press.

Since they are constantly in the statetype = A, he can block all attacks that are type H and M, but gets hit by all attacks that are  of type C (crouching).

Is it possible to modify the guard stance so that he can also defend against low attacks?

Here is some code for reference.

Spoiler (click to show)


; AIR GUARD (guarding)
[Statedef 132]
type    = A
physics = N

[State 132, anim]
type = ChangeAnim
trigger1 = Anim != 132
value = 132

[State 132, freeze pos]
type = velset
trigger1 = command = "hold b"
x = 0
y = 0

[State 132, 3]
type = VarSet
trigger1 = 1
sysvar(0) = command = "hold b"

[State 132, Stop Guarding]
type = ChangeState
trigger1 = command != "hold b"
value = 0

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

; AGUARDHIT (shaking)
[Statedef 154]
type    = A
movetype= H
physics = N
velset = 0,0

[State 154, 1]
type = ChangeAnim
trigger1 = 1
value = 152

[State 154, 2]
type = ChangeState
trigger1 = HitShakeOver
value = 155 ;AGUARDHIT2

[State 154, 3]
type = ForceFeedback
trigger1 = time = 0
waveform = square
time = 4

;---------------------------------------------------------------------------
; AGUARDHIT2 (knocked away)
[Statedef 155]
type    = A
movetype= H
physics = N
anim = 152

[State 155, 1]
type = HitVelSet
trigger1 = Time = 0
x = 1
y = 1

[State 155, 2]
type = VelAdd
trigger1 = 1
y = Const(movement.yaccel)

[State 155, 3]
type = ctrlset
trigger1 = Time = GetHitVar(ctrltime)
value = 1

[State 155, 4]
type = VarSet
trigger1 = 1
sysvar(0) = command = "hold b"

[State 155, 6]
type = ChangeState
trigger1 = sysvar(0)
trigger1 = command = "hold b"
value = 130

[State 155, 7]
type = ChangeState
trigger1 = sysvar(0)
trigger2 = ctrl
value = 0


I also tried nothitby sctrl but this just means he doesn't get hit by low attacks at all, which is not what I want. I also tried hitoverride and redirect it to the airguard movement and transition state, but it just redirected me into a get hit state.

Edit: I also realized that this spawns another problem basically for most SF3 characters whose hitflags do not allow for air blocking, making pretty much all their attacks unblockable since this is an airguard state. Is there a way around this?
The double-curse of Blue Beard Baboon lies in these words you see. Read them once, then read them twice and your island is history.

PotS

#1
Since adapting the guard states would make you still need to guess which way you should block (low/high/air), and I think you just want to block everything regardless of attack level, you should perhaps make special guard states where he uses HitOverride (not into the common states) or some helper that absorbs the hits.

Like:
- Press a button to change to state 1
- State 1 is the guard pose and has a HitOverride that sends char to State 2
- State 2 changes to State 3 when HitShakeOver (not frozen by the hitpause)
- State 3 has the vels applied and stuff and changes back to the idle state after x ticks

Edit: Those states shouldn't be movetype=H, so that the char doesn't still receive full damage.
You can help with Ikemen GO's development by trying out the latest development build and reporting any bugs on GitHub.
My Mugen and Ikemen content can also be found here.

Mr. I

#2
Ok, I got the custom blocking state working but there are 2 problems.

Player doesn't take chip damage.
The sound that plays is the opponents hit sound and not the guard sound

Is there any way around this? I read the docs and found that Gethitvar has a damage parameter but it returns the same amount of damage, and not every hit should account for chip. Also moveguarded only works for p2's attack state. Essentially in the end i want to TargetAddLife -whatever the chip damage should be.
The double-curse of Blue Beard Baboon lies in these words you see. Read them once, then read them twice and your island is history.

Cyanide

120-155 are special engine managed states, nothing seems to return chip damage. You may be stuck with overriding those states if you want this to work correctly. You can disable guarding yet still access those states via button press.

Why does he have to be statetype = A? There is no real benefit here aside from what hit sprites he uses when hit, obviously as he has no stand, you could just use the same hitsprites for everything.

If you need to replicate the A behaviour, state -2 and hitfallset when movetype = H. Other than that, no difference between the 2 really.

Physics manages friction so that can't be involved.


In M.U.G.E.N there is no magic button

They say a little knowledge is a dangerous thing, but it's not one half so bad as a lot of ignorance.