Upon hit the move continues for x amount of time

Started by JustNoPoint, November 11, 2015, 07:00:55 PM

Previous topic - Next topic

JustNoPoint

I'm having an issue figuring out how to code a certain move.

The move is a forward moving multi hitting attack.

You tap the button and it goes through the animation then ends. Got that

You Hold the button and it continues till you let go. Got that

Upon connecting it must still cycle through the amount of time the animation would last which is 20 ticks. I can get this to work by holding the button down. But I cannot get it to work if you connect and release the button early. I have tried several methods to no avail.

I have spoiled the parts that are probably irrelevant to the issue.


Spoiler (click to show)

[Statedef 211]
type = S
movetype = A
physics = S
anim = 211
ctrl = 0
velset = 0,0
poweradd = 20
sprpriority = 1
juggle = 7


[State 211, VelSet]
type = VelSet
trigger1 = Anim = 211
x = 5
y = 0
persistent = 1


[State 211, HitDef]
type = HitDef
trigger1 = AnimElem = 1
attr = S, NA
damage = 20
animtype = Medium
air.animtype = back
fall.animtype = back
guardflag = M
hitflag = MAF 
pausetime = 8, 10
sparkno = 7010 + (random % 8)
sparkxy = -10, -60
hitsound = F5,1
guardsound = F6,0
ground.type = High
ground.hittime  = 16
guard.slidetime = 15
guard.hittime = 15
guard.velocity = -9
airguard.velocity = -1.9,-.8
air.type = High
air.velocity = -3,-6
ground.cornerpush.veloff = 0
air.cornerpush.veloff = 0

[State 211, HitDef]
type = HitDef
trigger1 = AnimElem = 2
attr = S, NA
damage = 20
animtype = Medium
air.animtype = back
fall.animtype = back
guardflag = M
hitflag = MAF 
pausetime = 8, 10
sparkno = 7010 + (random % 8)
sparkxy = -0, -50
hitsound = F5,1
guardsound = F6,0
ground.type = High
ground.hittime  = 16
guard.slidetime = 15
guard.hittime = 15
guard.velocity = -9
airguard.velocity = -1.9,-.8
air.type = High
air.velocity = -3,-6
ground.cornerpush.veloff = 0
air.cornerpush.veloff = 0


[State 211, HitDef]
type = HitDef
trigger1 = AnimElem = 3
attr = S, NA
damage = 20
animtype = Medium
air.animtype = back
fall.animtype = back
guardflag = M
hitflag = MAF 
pausetime = 8, 10
sparkno = 7010 + (random % 8)
sparkxy = -10, -62
hitsound = F5,1
guardsound = F6,0
ground.type = High
ground.hittime  = 16
guard.slidetime = 15
guard.hittime = 15
guard.velocity = -9
airguard.velocity = -1.9,-.8
air.type = High
air.velocity = -3,-6
ground.cornerpush.veloff = 0
air.cornerpush.veloff = 0

[State 211, HitDef]
type = HitDef
trigger1 = AnimElem = 4
attr = S, NA
damage = 20
animtype = Medium
air.animtype = back
fall.animtype = back
guardflag = M
hitflag = MAF 
pausetime = 8, 10
sparkno = 7010 + (random % 8)
sparkxy = 0, -52
hitsound = F5,1
guardsound = F6,0
ground.type = High
ground.slidetime = 12
ground.hittime  = 16
ground.velocity = -9
guard.slidetime = 15
guard.hittime = 15
guard.velocity = -9
airguard.velocity = -1.9,-.8
air.type = High
air.velocity = -3,-6
ground.cornerpush.veloff = 0
air.cornerpush.veloff = 0

[State 211, 1]
type = ChangeState
trigger1 = !command = "hold_y"
trigger1 = Time >= 20
value = 212


Bastard Mami

you need to add a trigger that detects taht the mvoehaas nto made contact when time>=20, something like

trigger1 = movecontact = 0

should work

Bea

[State 211, 1]
type = ChangeState
trigger1 = animtime = 0
trigger1 = time >= 0
trigger1 = !command = "hold_y"
value = 212

Might do the trick. I haven't done this mugen thing in a bit.
That would assure that the changestage would only trigger when the animation has finished.
Princess Adora: "My friend saw She-Ra take her dress off in the shower. She said she has an 8 pack. She said She-Ra is shredded."

SF2NES is dead. Long live SF2NES.

JustNoPoint

E's method worked =D

I currently have this now. I believe this will work for airborn and grounded opponents well. I may have to test and see if air blocking the attack might pin them down though. It could potentially stick them in an infinite loop. Are there ways I could optimize this and or improve it?

[State 211, 1]
type = ChangeState
trigger1 = !command = "hold_y"
trigger1 = Time >= 20
trigger1 = MoveContact = 0
value = 212


[State 211, 2]
type = ChangeState
trigger1 = MoveContact
trigger1 = HitCount = 4
trigger1 = P2StateType != A
value = 212

[State 211, 3]
type = ChangeState
trigger1 = MoveContact
trigger1 = P2StateType = A
value = 211

Bea, your code gave me an issue I ran into a lot. It made it so that on contact I could continue to hold the button down and keep hitting. And if I let go he instantly stopped.

Thank you both for assisting :)

Odb718

#4
[State 211, 1]
type = ChangeState
trigger1 = !command = "hold_y"
trigger1 = Time >= 20
trigger1 = MoveContact = 0
value = 212

[State 211, 2]
type = ChangeState
trigger1 = MoveContact
trigger1 = HitCount = 4
trigger1 = P2StateType != A
value = 212

would become

[State 211, 1]
type = ChangeState
trigger1 = (!command = "hold_y") && (Time >= 20)  && (!MoveContact)
trigger2 = (MoveContact) && (HitCount = 4) && (P2StateType != A)
value = 212

[State 211, 3]
type = ChangeState
trigger1 = (MoveContact) && (P2StateType = A)
value = 211


----
As I'm looking at the changestates, I'm imagining a situation where the player is holding MP and hasnt hit anything and the time is over 20tics. There's no changestate that would activate if this is what's happening. Does the animation just flip? Because if it starts up and the player lets go halfway through the second play of the animation, the changestate will cut off the animation.
vVv Gouken718 vVv SabreTooth718 vVv


JustNoPoint

Quote from: Odb718 on November 12, 2015, 12:11:09 PM
As I'm looking at the changestates, I'm imagining a situation where the player is holding MP and hasnt hit anything and the time is over 20tics. There's no changestate that would activate if this is what's happening. Does the animation just flip? Because if it starts up and the player lets go halfway through the second play of the animation, the changestate will cut off the animation.

trigger1 = Time >= 20
It won't change if it's less than 20 ticks. But it changes if it's greater than and you release the button. If it's less than 20 and you release the button it still won't change till after 20 ticks.

Also thanks for the optimization tips. I'll deem this solved.

JustNoPoint

#6
Okay, so what I coded had tons of issues when blocking.

The move is a multi hitting move. So any number of frames could connect as it travels across the screen. When any of them connects the animation should play for x amount of time then go to the next changestate. This way if a scenario comes up where only the 1st hit connects the others can wiff without locking the character in a loop.

I could make 3 more states/versions/animations so that when each hit connects it goes to the next one.

But I have a feeling that's a lot more coding and air file resources than is needed.

I'm also sure I could use a variable to pull this off but I'm not exactly sure how.

-Whiplash-

I'm not sure I understand you question here?

You want it so when the move connects it goes to the next state even if only one part of the attack hits? what's the issue you are having when blocking?

JustNoPoint

#8
No when it hits it needs to wait x amount of time before it goes to the next state.

In an optimal setting it would hit 4 times before going to the next state. But there could be cases where the move would wiff after the 1st hit. That's why I need to figure out how to tell it to wait x amount of time after it connects before it goes to the next state.

So I can be sure the full animation plays like it should.

If someone air blocks it it could potentially hit, wiff, hit, wiff due to their bounce.

Spoiler (click to show)
;---------------------------------------------------------------------------
; STAND MEDIUM PUNCH
[Statedef 210]
type = S
movetype = A
physics = N
anim = 210
ctrl = 0
velset = 0,0
poweradd = 20
sprpriority = 1
juggle = 7

[State 210, 1]
type = ChangeState
trigger1 = !command = "hold_y"
trigger1 = Time >= 1
value = 211

[State 210, 2]
type = ChangeState
trigger1 = AnimTime = 0
value = 211

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




[Statedef 211]
type = S
movetype = A
physics = S
anim = 211
ctrl = 0
velset = 0,0
poweradd = 20
sprpriority = 1
juggle = 7


[State 211, VelSet]
type = VelSet
trigger1 = Anim = 211
x = 2
y = 0
persistent = 1

[State 211, 1];voice
type = PlaySnd
trigger1= (animelem=1 && random<350)||(animelem=2 && random<350)
trigger2= (animelem=3 && random<350)||(animelem=4 && random<350)
value=3,102+random%3
channel = 0

[State 211, 1]
type = PlaySnd
trigger1= (animelem=1 && random<350)||(animelem=2 && random<350)
trigger2= (animelem=3 && random<350)||(animelem=4 && random<350)
value = 0, 1
channel = 1

[State 211, HitDef]
type = HitDef
trigger1 = AnimElem = 1
attr = S, NA
damage = 6, 0
animtype = Medium
guardflag = MA
hitflag = MAF
pausetime = 6,6
guard.pausetime = 6,6
sparkno = s7010+10*(random%3)  ;s7030
guard.sparkno = s7000
sparkxy = -17,-60
hitsound = s5, 200
guardsound = S6,1
ground.type = Low
ground.slidetime = 10
ground.hittime  = 10
ground.velocity = 1
guard.velocity = -3
airguard.velocity = -2.5,-1.3
air.type = High
air.velocity = -2,-2
air.hittime = 12
air.animtype = back
getpower= ifelse(p2movetype=H,20,140), 5
givepower = 8,8
yaccel = 0.5

[State 211, HitDef]
type = HitDef
trigger1 = AnimElem = 2
attr = S, NA
damage = 6, 0
animtype = Medium
guardflag = MA
hitflag = MAF
pausetime = 6,6 ;8,8
guard.pausetime = 6,6 ;8,8
sparkno = s7010+10*(random%3)
guard.sparkno = s7000
sparkxy = -17,-73
hitsound = s5, 200
guardsound = S6,1
ground.type = High
ground.slidetime = 10
ground.hittime  = 10
ground.velocity = 1
guard.velocity = -3
airguard.velocity = -2.5,-1.3
air.type = High
air.velocity = -2,-2
air.hittime = 12
air.animtype = back
getpower= ifelse(p2movetype=H,10,140), 5
givepower = 8,8
yaccel = 0.5


[State 211, HitDef]
type = HitDef
trigger1 = AnimElem = 3
attr = S, NA
damage = 6, 0
animtype = Medium
guardflag = MA
hitflag = MAF
pausetime = 6,6 ;8,8
guard.pausetime = 6,6 ;8,8
sparkno = s7010+10*(random%3)
guard.sparkno = s7000
sparkxy = -10,-70
hitsound = s5, 200
guardsound = S6,1
ground.type = Low
ground.slidetime = 10
ground.hittime  = 10
ground.velocity = 1
guard.velocity = -3
airguard.velocity = -2.5,-1.3
air.type = High
air.velocity = -2,-2
air.hittime = 12
air.animtype = back
getpower= ifelse(p2movetype=H,10,140), 5
givepower = 8,8
yaccel = 0.5

[State 211, HitDef]
type = HitDef
trigger1 = AnimElem = 4
attr = S, NA
damage = 6, 0
animtype = Medium
guardflag = MA
hitflag = MAF
pausetime = 6,6 ;8,8
guard.pausetime = 6,6 ;8,8
sparkno = s7010+10*(random%3)
guard.sparkno = s7000
sparkxy = -23,-57
hitsound = s5, 200
guardsound = S6,1
ground.type = High
ground.slidetime = 10
ground.hittime  = 10
ground.velocity = 1
guard.velocity = -3
airguard.velocity = -2.5,-1.3
air.type = High
air.velocity = -2,-2
air.hittime = 12
air.animtype = back
getpower= ifelse(p2movetype=H,10,140), 5
givepower = 8,8
yaccel = 0.5

[State 211, 1]
type = ChangeState
trigger1 = (!command = "hold_y") && (Time >= 16) && (!MoveContact)
value = 212



[State 0, VelAdd]
type = Null; VelAdd
trigger1 = MoveContact
x = 5
y = 0

;---------------------------------------------------------------------------
[Statedef 212]
type = S
movetype = A
physics = S
anim = 212
ctrl = 0
velset = 0,0
poweradd = 20
sprpriority = 1
juggle = 7

[State 212, 1];voice
type = PlaySnd
trigger1 = animelem=1 && random<200
value=3,102+random%3
channel = 0

[State 212, 1]
type = PlaySnd
trigger1 = animelem = 2
value = 0, 1
channel = 1

    [State 212, Time Offset]
    type = VarSet
    trigger1 = moveContact = 1
    var(2) = Time
    ignorehitpause = 1
    persistent = 0

    [State 212, Play Anim]
    type = ChangeAnim
    triggerall = AnimElemTime(2) >= 0 && AnimElemTime(3) <= 0
    trigger1 = hitPauseTime = [1,6 - (10 - Var(2))]
    value = anim
    elem = 3
    ignorehitpause = 1

[State 212, HitDef]
type = HitDef
trigger1 = AnimElem = 2
attr = S, NA
damage = 26, 0
animtype = Medium
guardflag = MA
hitflag = MAF
priority = 3, Hit
pausetime = 11, 11
guard.pausetime = 11,11
sparkno = s7020
guard.sparkno = s7000
sparkxy = -10, -62
hitsound = s5, 1
guardsound = S6,0
ground.type = High
ground.slidetime = 12;8
ground.hittime  = 12;8
ground.velocity = -11 ;-3
guard.velocity = -6
airguard.velocity = -2,-1.1
air.type = High
air.velocity = -3,-3
air.hittime = 12
air.animtype = back
getpower= ifelse(p2movetype=H,40,140), 35
givepower = 35,35
yaccel = 0.5
ID = 1098

[State 212, Idle]
type= statetypeset
trigger1= animelemtime(4)>=0
movetype= I


[State 212, finish]
type = ChangeState
trigger1 = AnimTime = 0
value = 0
ctrl = 1

-Whiplash-

#9
EDIT: Nevermind, I'm not sure I quite get it yet.

Just to make sure:

after 20 ticks it goes into another state IF it hits or you hold down the attack.

If it hits 4 times it goes into the next state regardless of it's time?


JustNoPoint

The attack is an advancing flurry of punches.

The punches themselves are a looping anim of 4 frames. Each punch is 1 frame.

It lasts 20 ticks long in total.

The next state is a final larger punch.

So if you tap MP he does the typical animation for 20 ticks then goes into the ender. I have that correct. On hit, miss, or block this currently works right.

If you hold the MP he continues to advance.

Once any of the 4 frames connect (hit or blocked) he will continue the animation for 16 more ticks. Then do his ender.

I cannot rely on hitcount because there are situations where a frame will connect but the following wouldn't Which would create a loop or extend the amount of time he's stuck punching till he finally landed the rest of the hits.

In the simplest way I can think to describe it I simply need the move to continue animating for 16 ticks after any frame makes contact. Then he changes to his ender state.

I hope this makes sense. This is a tough move to describe it seems lol

I talked with JMorphMan and we may have a direction to go towards. I'm not in a position to test more currently though.

Here is the entire block of code with JMM's directions.
Spoiler (click to show)
;---------------------------------------------------------------------------
; STAND MEDIUM PUNCH
[Statedef 210]
type = S
movetype = A
physics = N
anim = 210
ctrl = 0
velset = 0,0
poweradd = 20
sprpriority = 1
juggle = 7

[State 0, VarSet]
type = VarSet
trigger1 = 1
v = 2   
value = -1
persistent = 1


[State 210, 1]
type = ChangeState
trigger1 = !command = "hold_y"
trigger1 = Time >= 1
value = 211

[State 210, 2]
type = ChangeState
trigger1 = AnimTime = 0
value = 211

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




[Statedef 211]
type = S
movetype = A
physics = S
anim = 211
ctrl = 0
velset = 0,0
poweradd = 20
sprpriority = 1
juggle = 7


[State 211, VelSet]
type = VelSet
trigger1 = Anim = 211
x = 2
y = 0
persistent = 1

[State 211, 1];voice
type = PlaySnd
trigger1= (animelem=1 && random<350)||(animelem=2 && random<350)
trigger2= (animelem=3 && random<350)||(animelem=4 && random<350)
value=3,102+random%3
channel = 0

[State 211, 1]
type = PlaySnd
trigger1= (animelem=1 && random<350)||(animelem=2 && random<350)
trigger2= (animelem=3 && random<350)||(animelem=4 && random<350)
value = 0, 1
channel = 1

[State 211, HitDef]
type = HitDef
trigger1 = AnimElem = 1
attr = S, NA
damage = 6, 0
animtype = Medium
guardflag = MA
hitflag = MAF
pausetime = 6,6
guard.pausetime = 6,6
sparkno = s7010+10*(random%3)  ;s7030
guard.sparkno = s7000
sparkxy = -17,-60
hitsound = s5, 200
guardsound = S6,1
ground.type = Low
ground.slidetime = 10
ground.hittime  = 10
ground.velocity = 1
guard.velocity = -3
airguard.velocity = -2.5,-1.3
air.type = High
air.velocity = -2,-2
air.hittime = 12
air.animtype = back
getpower= ifelse(p2movetype=H,20,140), 5
givepower = 8,8
yaccel = 0.5

[State 211, HitDef]
type = HitDef
trigger1 = AnimElem = 2
attr = S, NA
damage = 6, 0
animtype = Medium
guardflag = MA
hitflag = MAF
pausetime = 6,6 ;8,8
guard.pausetime = 6,6 ;8,8
sparkno = s7010+10*(random%3)
guard.sparkno = s7000
sparkxy = -17,-73
hitsound = s5, 200
guardsound = S6,1
ground.type = High
ground.slidetime = 10
ground.hittime  = 10
ground.velocity = 1
guard.velocity = -3
airguard.velocity = -2.5,-1.3
air.type = High
air.velocity = -2,-2
air.hittime = 12
air.animtype = back
getpower= ifelse(p2movetype=H,10,140), 5
givepower = 8,8
yaccel = 0.5


[State 211, HitDef]
type = HitDef
trigger1 = AnimElem = 3
attr = S, NA
damage = 6, 0
animtype = Medium
guardflag = MA
hitflag = MAF
pausetime = 6,6 ;8,8
guard.pausetime = 6,6 ;8,8
sparkno = s7010+10*(random%3)
guard.sparkno = s7000
sparkxy = -10,-70
hitsound = s5, 200
guardsound = S6,1
ground.type = Low
ground.slidetime = 10
ground.hittime  = 10
ground.velocity = 1
guard.velocity = -3
airguard.velocity = -2.5,-1.3
air.type = High
air.velocity = -2,-2
air.hittime = 12
air.animtype = back
getpower= ifelse(p2movetype=H,10,140), 5
givepower = 8,8
yaccel = 0.5

[State 211, HitDef]
type = HitDef
trigger1 = AnimElem = 4
attr = S, NA
damage = 6, 0
animtype = Medium
guardflag = MA
hitflag = MAF
pausetime = 6,6 ;8,8
guard.pausetime = 6,6 ;8,8
sparkno = s7010+10*(random%3)
guard.sparkno = s7000
sparkxy = -23,-57
hitsound = s5, 200
guardsound = S6,1
ground.type = High
ground.slidetime = 10
ground.hittime  = 10
ground.velocity = 1
guard.velocity = -3
airguard.velocity = -2.5,-1.3
air.type = High
air.velocity = -2,-2
air.hittime = 12
air.animtype = back
getpower= ifelse(p2movetype=H,10,140), 5
givepower = 8,8
yaccel = 0.5

[State 0, VarSet]
type = VarSet
trigger1 = MoveContact = 1
v = 2    ;fv = 10
value = Time
persistent = 1

[State 211, 1]
type =  ChangeState
trigger1 = (!command = "hold_y") && (Time >= 20) && (!MoveContact)
trigger2 = Var(2) + 16 = Time && var(2) >= 0
value = 212






;---------------------------------------------------------------------------
[Statedef 212]
type = S
movetype = A
physics = S
anim = 212
ctrl = 0
velset = 0,0
poweradd = 20
sprpriority = 1
juggle = 7

[State 212, 1];voice
type = PlaySnd
trigger1 = animelem=1 && random<200
value=3,102+random%3
channel = 0

[State 212, 1]
type = PlaySnd
trigger1 = animelem = 2
value = 0, 1
channel = 1

    [State 212, Time Offset]
    type = VarSet
    trigger1 = moveContact = 1
    var(2) = Time
    ignorehitpause = 1
    persistent = 0

    [State 212, Play Anim]
    type = ChangeAnim
    triggerall = AnimElemTime(2) >= 0 && AnimElemTime(3) <= 0
    trigger1 = hitPauseTime = [1,6 - (10 - Var(2))]
    value = anim
    elem = 3
    ignorehitpause = 1

[State 212, HitDef]
type = HitDef
trigger1 = AnimElem = 2
attr = S, NA
damage = 26, 0
animtype = Medium
guardflag = MA
hitflag = MAF
priority = 3, Hit
pausetime = 11, 11
guard.pausetime = 11,11
sparkno = s7020
guard.sparkno = s7000
sparkxy = -10, -62
hitsound = s5, 1
guardsound = S6,0
ground.type = High
ground.slidetime = 12;8
ground.hittime  = 12;8
ground.velocity = -11 ;-3
guard.velocity = -6
airguard.velocity = -2,-1.1
air.type = High
air.velocity = -3,-3
air.hittime = 12
air.animtype = back
getpower= ifelse(p2movetype=H,40,140), 35
givepower = 35,35
yaccel = 0.5
ID = 1098

[State 212, Idle]
type= statetypeset
trigger1= animelemtime(4)>=0
movetype= I


[State 212, finish]
type = ChangeState
trigger1 = AnimTime = 0
value = 0
ctrl = 1

The method we are trying now is to set the current time to a Var then add 16.

This still didn't work with the vars. So he told me to "display to clipboard the value of var (2) and do the move, pause it, and increment through it to see how it changes?"

So for now this will be my next when I get back to this. Unless I get a new idea before that.

Again. I know how I can do this if I made each punch in the flurry anim it's own animation. I just don't feel that's the best way I should do this.

Odb718

#11
You could spawn a helper when the move hits. Inside the helper you could spawn an explod at the right time.
Inside the main/problem state you can monitor if the explod has spawned to change the state.
Make the helper and the explod invisible. Kill both the helper and explod in the second state.

----

210 starts the move,
[State 210, 1]
type = ChangeState
trigger1 = !command = "hold_y"
trigger1 = Time >= 1
trigger2 = AnimTime = 0
value = 211

211 is the advancing flurry of punches. It sets the var(2) and changes to the ender state 212 after 16 tics.

in 212 you switch to anim 3, but your hitdef is anim 2. Does anim 212 loop?
If yes, how do you changestates? If no, how's the hitdef ever going to activate/connect?

---- ----
[State 0, VarSet]
type = VarSet
triggerall = var(2) = -1          ;Check to only set 1 time.
trigger1 = MoveContact = 1
v = 2    ;fv = 10
value = Time
persistent = 1

you're going to need another check besides movecontact. I just did a test where a multihit basic attack set it to 7 then 9. So if, like you say hit/wiff/hit/wiff can happen, it'll set it to the second hit.
vVv Gouken718 vVv SabreTooth718 vVv


JustNoPoint

Yes the animation loops for state/anim 211. But that doesn't prevent it from going to state 212. It works fine at close range. It also works fine if I use a hitcount to trigger 212. Though a hitcount is worthless in the event a punch whiffs.

Whiplash also sent me a potential fix via PM. I can't post it or try any right now. I just stopped to get gas and about to leave. So to note I may not be able to update this post till next week. Going away for Thanksgiving holiday. I'll have my laptop so I may be able to test sooner but no guarantees.

Odb718

vVv Gouken718 vVv SabreTooth718 vVv


Bastard Mami

iirc
movehit and movecontact actually work like you want, they start at 1 once they hit, then their value keeps on increasing and it resets back to 1 once they hit again. as a side note I don't rememebr a single move froma fighting game working exactly like that, if an attack is multihit and requires to hit before going to the ender, it will just set a var to true as it hits, then ignore any subsequent hits and change to teh finisher once it's animation is done (which might or nto lead to some interesting bugs, but that's how those mvoes behave in real games).

Cyanide

Well, that looks complicated...

Is the animation making use of loopstart to keep going? If so i believe you can do this for the changestate

trigger1 = animelemtime(4) = 5
trigger1 = command != "hold_y"
value = 212

I can't remember entirely if this will behave, chuck in a displaytoclipboard and have it display the value of the current frame of the animation if you want to check.

Make sure it's = and not >, i believe it won't reset and will still be classed as "greater" than that value.
If not using loopstart, just set it up so it can changestate any time you hit the end of the loop while Y isn't held so

triggerall = command != "hold_y"
trigger1 = animelemtime(4) = 5
trigger2 = animelemtime(8) = 5
and so on.

The only thing i'd point out with this as an addition is if releasing Y triggers it someone could potentially release and then tap again to keep it going, in that situation you use a variable to manage that Y has been released and simply trigger off the var and animelemtime instead.

It's not about waiting 20 ticks if the move hits. It's about pulling it out at the correct point in the animation. You know which frame that is. It doesn't matter about the timing of said frame, just that you know which one you want to transition from.


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.

-Whiplash-

I THINK I cracked it but I can't tell until Justnopoint confirms.

The easiest way I could think of was the move keeps looping  until you let go of y (or 20 ticks have passed) if it doesn't hit, but if it does, it transitions to another state (but keeps the same anim) and carries out the rest of the attack there for 15 more frames. (as it loops, regardless of what frame it was at)

I also tried two vars, one that trigged when the move made contact and another that counted every addition animelem when the first var was active, then transitioning to the ending frame when the second var was 4 but it wasn't counting correctly for some reason.

JustNoPoint

I just got to my destination. That was a long drive! JMorphMan sent me this.
Quote from: Jmorphman on November 25, 2015, 05:36:34 AM
now that I'm home I can do this all proper, with hands on testing! I modified my Joe to replicate the move, and it works! It turned out to be a minor thing; the varset in the attack state had "persistent = 1", meaning each hit would set the variable to equal the current time!
So as soon as I can I'll try to test this all out and see if it resolves my issue. Thanks for all the assistance thus far. I figured I was missing something obvious. It's nice to know this wasn't just complicated for me :p

Jmorphman

It's a demanding move! Wants to be showered with all this special treatment, like a spoiled brat!

-Whiplash-

yeah, so I Just checked that and it does the same thing as my last version... with far less text. (mine had an entire other state to accomplish the same thing... looking at this the answer was really obvious. >_<)

only issue is that you wanted 20 ticks if it wiffed right? so:

[State 0, VarSet]
type = VarSet
trigger1 = MoveContact = 1
var(10) = Time
ignoreHitPause = 1
persistent = 0

[State 1401, End]
type = ChangeState
trigger1 = time >= 20 && !MoveContact && !(command = "holdy")
trigger2 = var(10) >= 0 && var(10) + 16 <= Time
value = 212