YesNoOk
avatar

Limiting the guard hits problem (Read 1479 times)

Started by Synck, December 04, 2015, 07:55:16 am
Share this topic:
Limiting the guard hits problem
#1  December 04, 2015, 07:55:16 am
  • ****
  • a.k.a DuckSS
    • https://synckmugencentral667.000webhostapp.com/
Well, when I always need to limit the the normal hits I use hitcount and timemod,but I have a problem to make a limit to guard hits.
Which code I should use for that?

The move I coded has 10 hits limit so I need to make 10 guardhits limit.
Last Edit: December 09, 2015, 09:32:42 am by DuckSS
Re: Limiting the guard hits problem
#2  December 04, 2015, 09:07:18 am
  • ******
  • Legendary XIII
  • I am the eye of the storm to come!
    • New Zealand
    • network.mugenguild.com/cyanide/
Probably easiest to use a variable to count them here.

varadd
trigger1 = moveguarded = 1
v = blah
value = 1

May require some dicking about as moveguarded will continue to return 1 while the hitpause is "active" you could swap to 2 happily enough if the second hit isn't instant. When it hits 9, you've been guarded 10 times. If it's possible to guard then get hit you will also need an out in your state that

trigger1 = (var(blah) + hitcount) >= 9

you leave the state.


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.
Re: Limiting the guard hits problem
#3  December 05, 2015, 11:11:25 pm
  • ****
  • a.k.a DuckSS
    • https://synckmugencentral667.000webhostapp.com/
I tried the code but it seems that code sets the limit to attack. Like in the begining everything works well but when I need to do that attack again the character passes through p2.

I coded like this:

Code:
[state 1000]
type = varadd
trigger1 = moveguarded = 1
v = 14
value = 1

[State 200, 1]
type = HitDef
trigger1 = anim = 3009 && (var(14) + hitcount) <= 9 ; it doesn't work with >=
;triggerall = Anim = 3009 && HitCount < 10
;trigger1 = TimeMod = 2,0
attr = A, HA
damage = 45,8
animtype = heavy
guardflag =
hitflag = MAF
getpower = 0
priority = 4, Hit
pausetime = 5, 0
sparkno = 3
sparkxy = -8, -35
hitsound = 5, 4
guardsound = 6, 0
guard.sparkno = 40
ground.type = High
guard.velocity = -5
airguard.velocity = 0,-1
ground.slidetime = 20
ground.hittime  = 25
ground.velocity = -2.5,-1.5
air.type = high
air.velocity = -2.5,-1.5
air.cornerpush.veloff = 0
ground.cornerpush.veloff = 0
air.hittime = 25
Air.fall = 1
fall.recover = 0
fall = 1
ID = 1021
envshake.time = 16
envshake.freq = 60
envshake.ampl = 8

What I'm mistaking?
Also the attack is like m.bison's psycho crusher.
Re: Limiting the guard hits problem
#4  December 06, 2015, 01:02:33 am
  • ******
  • Legendary XIII
  • I am the eye of the storm to come!
    • New Zealand
    • network.mugenguild.com/cyanide/
You need to reset the variable at the beginning of the state so it's back to 0.

Also, the >= was for a changestate out, not for the hitdef but what you have will work OK for hit limitation as well.


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.
Re: Limiting the guard hits problem
#5  December 09, 2015, 09:32:28 am
  • ****
  • a.k.a DuckSS
    • https://synckmugencentral667.000webhostapp.com/
Well I figured out at last.
Thanks for help.