Infinite Hits

Started by DingusMB, April 30, 2017, 01:04:52 PM

Previous topic - Next topic

DingusMB

This sometimes happens when i have attacks with multiple hits, but its mostly with helpers where like the same hitdef keeps hitting the enemy forever until he dies, i made a tornado projectile some months ago that was supposed to throw the enemy up high, and when he hit the edge of the tornados hitbox this happened for some reason, i just thought it was something stupid i missed because i had made it a few days after starting messing with Mugen chars but it just happened again. Its a helper that is going to keep spawning invisible projs on top of the enemy to hit them

;---------------------------------------------------------------------------
;FadeHitProj
[Statedef 3101]
type    = S
movetype= A
physics = N
juggle  = 0
anim = 3101
ctrl = 0
sprpriority = 2

[State 0, Helper]
type = Helper
trigger1 = Time = 10
trigger2 = Time = 20
trigger3 = Time = 30
trigger4 = Time = 40
trigger5 = Time = 50
helpertype = normal ;player
name = FadeHitProj2
ID = 3102
stateno = 3102
pos = 0,0
postype = p2   
ignorehitpause = 1

[State 0, DestroySelf]
type = DestroySelf
trigger1 = Time = 60
ignorehitpause = 1

;---------------------------------------------------------------------------
;FadeHitProj2
[Statedef 3102]
type    = S
movetype= A
physics = N
juggle  = 0
anim = 3102
ctrl = 0
sprpriority = 2

[State 0, HitDef]
type = HitDef
trigger1 = AnimElem = 1
attr = S,HA       
hitflag = MAF       
guardflag = MA       
animtype = light       
air.animtype = light
damage = 30,0
pausetime = 4 ,4
hitsound = 5,4
guardsound = 6,0
ground.type = High   
ground.hittime = 20
air.hittime = 20
ground.velocity = 0,0
air.velocity = 0,0
ground.cornerpush.veloff = 0
air.cornerpush.veloff = 0
down.cornerpush.veloff = 0
guard.cornerpush.veloff = 0
airguard.cornerpush.veloff = 0
sprpriority = 3
ignorehitpause = 1

[State 0, DestroySelf]
type = DestroySelf
trigger1 = Time = 10
trigger2 = MoveHit
ignorehitpause = 1
;------------------------------------------------------------------------------------------

2Dee4ever

If you still need help with this, hit me up.

DingusMB

#2
I do actually, thanks for replying!
I fixed this one attack I posted earlier (turns out I forgot to use persistent, oops)
but it still happens with some other attacks, Ill post one as an example:

Spoiler (click to show)

;---------------------------------------------------------------------------
;Gust
[Statedef 1020]
type    = S
movetype= A
physics = S
juggle  = 0
poweradd= -500
velset = 0,0
anim = 1020
ctrl = 0
sprpriority = 2

[State 0, Helper]
type = Helper
trigger1 = AnimElem = 4
helpertype = normal
name = GustProj
ID = 1021
stateno = 1021
pos = 0,0+ceil(-enemy, pos Y)
postype = p2   
ignorehitpause = 1
persistent = 0


[State 1010, 8]
type = ChangeState
trigger1 = AnimTime = 0
value = 0
ctrl = 1

;---------------------------------------------------------------------------
;GustProj
[Statedef 1021]
type    = S
movetype= A
physics = S
juggle  = 4
poweradd= 0
velset = 0,0
anim = 1021
ctrl = 0
sprpriority = 2

[State 0, HitDef]
type = HitDef
trigger1 = AnimElem = 3
trigger2 = AnimElem = 4
trigger3 = AnimElem = 5
trigger4 = AnimElem = 6
trigger5 = AnimElem = 7
attr = S,SP       
hitflag = MAFD     
guardflag = MA   
animtype = Medium       
air.animtype = Medium
fall.animtype = Back
damage = 25,0
pausetime = 1 ,1
sparkno = S9999
guard.sparkno = S9999
sparkxy = 0,0
hitsound = S14,2
guardsound = 6,0
ground.type = High     
ground.velocity = -0.2 , -7
air.velocity = -0.2 , -6.5
ground.cornerpush.veloff = 0
air.cornerpush.veloff = 0
down.cornerpush.veloff = 0
guard.cornerpush.veloff = 0
airguard.cornerpush.veloff = 0
sprpriority = 3
p2facing = 1
forcestand = 1
fall = 1
fall.recover = 1
fall.recovertime = 36
air.fall = 1
ignorehitpause = 1


[State 0, DestroySelf]
type = DestroySelf
trigger1 = Time = 34
ignorehitpause = 1

This is similar to the tornadoes Goenitz summons, it lifts the enemy up high while he takes damage, but for some reason while hes airborne (and near the top of the tornados hitbox) the helper kinda gets stuck in a frame (?) and the hitdef keeps hitting him until he dies, and this only happens sometimes, it almost seems random.

I dont know if it has anything to do with the hitboxes but all of the frames where the hitdef activates have the same one copied and pasted

DarkWolf13

You're using animelem as a trigger for the helper's hitdef while using Time = XX as the destroyself trigger. Instead of using the animelem, check the gust's animation in Fighter Factory and see how many ticks the attacking frames last and use time = xxx as the hitdef's triggers instead.
Beware the Dark Wolf once more!

DingusMB

#4
Thanks for the reply but the result is the same, it hits him 5 times like it normally would but sometimes gets stuck when the enemy is near the top.
I think i know why you asked but the frames that activate on hitdef are not the last ones in the animation, there are still 2 frames where the tornado is "fading away", and those end in Time = 34 (in the DestroySelf SCtrl), kinda forgot to mention that, my bad

Odb718

This is probably the problem.
Spoiler (click to show)

[State 0, Helper]
type = Helper
trigger1 = AnimElem = 4
helpertype = normal
name = GustProj
ID = 1021
stateno = 1021
pos = 0,0+ceil(-enemy, pos Y)
postype = p2   
ignorehitpause = 1
persistent = 0
You probably have 5 or 6 helpers spawned. Add the check to limit the # of helper(s) to 1 of id 1021.

If you spawn helpers and explods and whatever, if you want only 1, you have to tell mugen that.
vVv Gouken718 vVv SabreTooth718 vVv


DingusMB

I added a "triggerall = NumHelper(1021) < 1" to it but same thing, I think persistent = 0 already wasnt letting it spawn more than once

Odb718

Are your spawning states disabled when

[State 0, DestroySelf]
type = DestroySelf
trigger1 = Time = 10
trigger2 = MoveHit
ignorehitpause = 1

activates??

Try it with just one trigger in the hitdef and switch the statetype off attack once it hits. See if you get more hits than you're supposed to like that.
vVv Gouken718 vVv SabreTooth718 vVv


DingusMB

#8
Oh that DestroySelf you just posted is for the first attack, that one is already fixed. I tried the statetypeset for the Gust and with a single trigger it didnt happen (maybe i got lucky but I tried for a few minutes, it usually happened on the third or fourth one), but tried again with multiple hitdef triggers and the statetypeset, and the glitch happened again.

Ill try a method Rei mentioned that is setting a juggle limit for the helper, I suppose Ill need to make a system for juggling since the one Mugen has is kinda bad. It might take a while to do since Im pretty busy with college tho

Still if anyone finds something out ill be checking here eventually.  Is it a bug? Ive never heard anyone talk about this

Cyanide

I don't see any issues with your code although if you name helpers the names ought to be inside quotes (surprised mugen didn't crash)

All your spawned helpers are designed to die at specific points. Either time triggers or on hit.

You may have something in the negative states spawning an extra hitting helper for you that you have forgotten about, or a projectile or something. All of that code is OK. It shows a helper creating a few more helpers. That helper destroys itself at a specific time rather than relying on anything else. You have the helpers it spawns dying at either a specific time OR if they hit. That means they die.

The other option to negative states is your first helper is being spawned more than once through bad triggering, that would be worth checking.

I am assuming here that both 3101 and 3102 are helpers.


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.

DingusMB

#10
They are but, that one attack is already fixed, I forgot to turn on persistent and I spawned a bunch of "3101"s
I still have this Infinite Hit problem with a different attack tho, I posted the code for it as a reply.

I forgot quotes for the name of that one as well (its for an old char, I barely knew how helpers worked) but it still "gets stuck"
This char doesnt have any -2 or -3 states, I had no idea what these did at the time

Odb718

Soooo.... Just an idea and idk why I haven't suggested it.
HitOnce=1
Throw that in the hitdef. If it helps, awesome. But in 2v2 you'll only hit 1 character with the move.

Post the state that's still having problems.
Look over the HitDef to see if you're missing something we dont know you dont know too.
vVv Gouken718 vVv SabreTooth718 vVv


DingusMB

Just tried it, only one of them gets hit but the one that does keeps getting hit by the helper once it glitches..
Its not just something that happens with 1.1 right? If not, I have no idea what it could be

Odb718

and you've checked with debug to make sure only 1 helper is spawning?
I'd say get rid of the destroy self on get hit, and increase the animation's time with a blank sprite and -1 time
The only thing I could think of is the ground.velocity and the pausetime messing it up.

Post the state how you have it now and I'll see what's wrong.
vVv Gouken718 vVv SabreTooth718 vVv


DingusMB

#14
This is the code I have right now

Spoiler (click to show)
;---------------------------------------------------------------------------
;GustProj
[Statedef 1021]
type    = S
movetype= A
physics = S
juggle  = 4
poweradd= 0
velset = 0,0
anim = 1021
ctrl = 0
sprpriority = 2

[State 0, HitDef]
type = HitDef
trigger1 = AnimElem = 3
trigger2 = AnimElem = 4
trigger3 = AnimElem = 5
trigger4 = AnimElem = 6
trigger5 = AnimElem = 7
attr = S,SP        ;SCA,NA,SA,HA,NP,SP,HP,NT,ST,HT
hitflag = MAFD       ;HLAFD+-
guardflag = MA         ;HLA
animtype = Medium          ;light,medium,hard,back,up,diagup
air.animtype = Medium
fall.animtype = Back
damage = 25,0
pausetime = 1 ,1
sparkno = S9999
guard.sparkno = S9999
sparkxy = 0,0
hitsound = S11,0
guardsound = 6,0
ground.type = High 
ground.velocity = -0.2 , -7
air.velocity = -0.2 , -6.5
ground.cornerpush.veloff = 0
air.cornerpush.veloff = 0
down.cornerpush.veloff = 0
guard.cornerpush.veloff = 0
airguard.cornerpush.veloff = 0
hitonce = 1
sprpriority = 3
p2facing = 1
forcestand = 1
fall = 1
fall.recover = 1
fall.recovertime = 36
air.fall = 1
ignorehitpause = 1

[State 0, StateTypeSet]
type = StateTypeSet
trigger1 = Time = 42
statetype = S   
movetype = I       
physics = S     
ignorehitpause = 1



[State 0, DestroySelf]
type = DestroySelf
trigger1 = Time = 49
ignorehitpause = 1


;---------------------------------------------------------------------------
;Gust
[Statedef 1020]
type    = S
movetype= A
physics = S
juggle  = 0
poweradd= -500
velset = 0,0
anim = 1020
ctrl = 0
sprpriority = 2

[State 0, Helper]
type = Helper
triggerall = NumHelper(1021) < 1
trigger1 = AnimElem = 4
helpertype = normal
name = "GustProj"
ID = 1021
stateno = 1021
pos = 0,0+ceil(-enemy, pos Y)
postype = p2 
ignorehitpause = 1
persistent = 0


[State 1010, 8]
type = ChangeState
trigger1 = AnimTime = 0
value = 0
ctrl = 1


I changed the animation a bit but no results, I also tried using Time instead of AnimElems for the HitDef but nothing changed, and Im more used to it anyway. Also I modified StatetypeSets and everything according to the animation of course.

This is the code on the CMD, pretty simple coz I had no idea how to do chains at the time. Im sure theres nothing wrong with this but in case someone asks here it is

Spoiler (click to show)

;---------------------------------------------------------------------------
;Gust
[State -1, Gust]
type = ChangeState
value = 1020
triggerall = command = "Gust"
triggerall = power >= 500
trigger1 = statetype != A
trigger1 = ctrl

Cyanide

Nope, nothing there that will cause additional helpers. You have persistent = 0, so it'll run that code once and stop.

The only options are something else creates the helper, or you have something in the negative states that does so. Within the code you have you cannot achieve what you say is happening, it has to be something else.


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.

DingusMB

I posted a video showing what happens https://www.youtube.com/watch?v=rX63yo7ktHM&feature=youtu.be
I can try to post the character somewhere if anyone wants but its pretty incomplete (and I did some of the attacks in a really unnecessary and bad way)

I think only having a single CNS is what bothers me the most, it was my second character ever

Odb718

This whole time...
So YOU spawn the helper over and over. The helper itself only hit 5 times man. 0:35 of the video it works perfect.
Then you glitch it out by repeatedly making the helper over and over.
Add a check to your cmd file to not allow the move to be performed unless there are 0 helpers on the screen.

The helper isn't glitched at all. Either make it so you cant hit falling enemies, or you'll be able to bounce them like you've been doing.
vVv Gouken718 vVv SabreTooth718 vVv


Cyanide

But you've removed a prevention for the glitch and forced it yourself. That proves nothing at all. It's just you doing the move over and over.

Get it to happen without that. If you can't its fixed. The numhelper trigger should be in the cmd 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.

DingusMB

#19
Guess that was bad phrasing..
When I said pressing it a bunch, its not the part where it does 300+ hits, i meant at the beggining when there are 2 or 3 "gusts" on the screen, the one that hits forever is a single helper
When the one that gets stuck shows up Im not pressing anything.

If I can only spawn one at a time it very rarely happens if the enemy is on the ground (it happened twice), but its still there, thats what I want to fix
And if I combo the enemy into the air (with any attack) and spawn the helper a single time it still happens