YesNoOk
avatar

Limit move Hits during specific times (Read 754 times)

Started by DingusMB, February 05, 2018, 10:30:12 am
Share this topic:
Limit move Hits during specific times
#1  February 05, 2018, 10:30:12 am
  • **
  • Déjà vu, mayhap—have you been here as well?
I want to be able to limit how many times an attack is able to hit during a specific state, its an old bug that came back to haunt me, I made a thread about it sometime ago but some guys helping me misunderstood my last post so it just died eventually (probably sounded like i was spamming the move input for it to spawn infinite helpers or something). It happened again, but on a move that resembles a divekick,sometimes if Im above the enemys head before I use it, the same frame keeps hitting him nonstop until hes dead (my animation just freezes) and for some reason it happens more frequently if both players are in the air.

Im thinking something like changing the movetype from A to I after an attack frame lands, and changing it back when the other one starts and just keep repeating it (for multiple hit states), I think its the only way to fix this, is there an efficient way to do this? Also would it fuck up the guard timing for the enemy if the statetype keeps changing during the same move?

Code:
;---------------------------------------------------------------------------
;SpinAir
[Statedef 2000]
type    = A
movetype= A
physics = N
poweradd= 50
velset = 0,0
anim = 2000
ctrl = 0
sprpriority = 2

[State 0, VelSet]
type = VelSet
trigger1 = Time = 0
x = 10
y = 4
ignorehitpause = 1

[State 0, VelAdd]
type = VelAdd
trigger1 = Time > 0
y = 0.4
ignorehitpause = 1


[State 0, HitDef]
type = HitDef
trigger1 = AnimElem = 1
trigger2 = AnimElem = 2
trigger3 = AnimElem = 3
trigger4 = AnimElem = 4
attr = S,SA        ;SCA,NA,SA,HA,NP,SP,HP,NT,ST,HT
hitflag = MAF        ;HLAFD+-
guardflag = MA         ;HLA
animtype = light          ;light,medium,hard,back,up,diagup
air.animtype = light
damage = 10,0
pausetime = 8 ,10
hitsound = 5,4
guardsound = 6,0
ground.type = High      ;Low,Trip,None
air.type = High
ground.slidetime = 0
ground.hittime = 30
air.hittime = 30
ground.velocity = -10,0
air.velocity = -10,10
ground.cornerpush.veloff = 0
air.cornerpush.veloff = 0
down.cornerpush.veloff = 0
guard.cornerpush.veloff = 0
airguard.cornerpush.veloff = 0
sprpriority = 3
fall = 0
fall.recover = 1
fall.recovertime = 30
air.fall = 1
ignorehitpause = 1

[State 0, ChangeState]
type = ChangeState
trigger1 = Pos Y >= 0
value = 2001
ignorehitpause = 1

here is the code if anyones curious, I dont think anythings out of the ordinary tho

Re: Limit move Hits during specific times
#2  February 05, 2018, 08:26:48 pm
  • *****
  • Estoy siempre listo para un desafío.
    • Puerto Rico
    • im41784@yahoo.com

  • Online
Is the final frame of the attack -1?
Because if its not it just continues
to loop back to those same frames
and will continue to hit.



Edit*   

try this, add this var to your statedef

Code:
[State 2000, VarAdd]
type = VarAdd
trigger1 = !Time
var(2) = 1

an add this trigger to your hitdef

Code:
trigger1 = var(2) < 4
Last Edit: February 05, 2018, 08:33:15 pm by Memo
Re: Limit move Hits during specific times
#3  February 06, 2018, 12:46:10 am
  • **
  • Déjà vu, mayhap—have you been here as well?
the animation does loop until he reaches the floor, but its intentional (kinda like Kairi from EX2), but when I limit my HitDef with something like a UniqHitCount or a var like you said (a <5 for example), and the move glitches, the same frame will hit the enemy 5 times really quickly and the rest will miss. what i want is something like a hit count limit for each specific frame so that doesnt happen

thanks for replying btw
Re: Limit move Hits during specific times
#4  February 07, 2018, 03:48:44 pm
  • ****
  • Robotics Engineer
    • USA
    • altoiddealer@gmail.com
Try removing ignorehitpause from the HitDef

Re: Limit move Hits during specific times
#5  February 07, 2018, 07:54:45 pm
  • *****
  • Estoy siempre listo para un desafío.
    • Puerto Rico
    • im41784@yahoo.com

  • Online
Batsu has a dive kick that hits multiple times, definitely check him out too.
Re: Limit move Hits during specific times
#6  February 08, 2018, 10:34:05 am
  • **
  • Déjà vu, mayhap—have you been here as well?
I will, thank you both!
By the way, whats the state for the "diagup" animation?
I dont think its specified in the CNS format thingy, my SelfStates look really bad rn
Re: Limit move Hits during specific times
#7  February 08, 2018, 12:31:12 pm
  • *****
  • Estoy siempre listo para un desafío.
    • Puerto Rico
    • im41784@yahoo.com

  • Online
Pots style chars have it, I suggest using one and press CTRL d 2 times
too see what state it sends the p2 char into and it will give you the animation number also