YesNoOk
avatar

Problems with Reset code (Read 2998 times)

Started by Ricepigeon, May 12, 2018, 10:54:57 pm
Share this topic:
Problems with Reset code
#1  May 12, 2018, 10:54:57 pm
  • *****
  • Thanks and God bless
    • USA
    • ricepigeon.neocities.org
Alright so I've noticed an issue thats been popping up and, to be frank, I have no idea whats causing it.

https://streamable.com/u61oa

The issue, as seen in the video, is that sometimes during a reset, P2 will be able to regain control in midair when they shouldnt. All normals are set to reset the player to a custom state if the move were to juggle, yet we can see that around 0:34 that this doesnt happen.

Another side issue I've noticed is that certain specials can hit during these states when theyre not supposed to, but then immediately afterward the opponent simply becomes invincible to any other attacks.

The character(s) in question:
http://www.mediafire.com/file/81qfbbb8od0dasv/Meiling_RP-2018-04-13.zip
http://www.mediafire.com/file/56nm255wectmvub/Lie_RP-2018-04-13.zip
http://www.mediafire.com/file/z75py7k8bg32a6j/Komachi_RP-2018-03-24.zip

And the relevant code:

Code:
;--------RESET--------
[State -2, P2 Recovery]
type= targetstate
trigger1= numtarget(555)
trigger1= (target(555), stateno=5020) && (target(555), alive) && (target(555), hitfall); Hit out of the air while alive and already falling
ID= 555
value= 5085
ignorehitpause= 1
Code:
;--------------
; FEET LANDING
[Statedef 5085]
type= A
physics= N
movetype= H
velset= 0, 0
facep2= 1

[State 5085, P]
type = null;pause
trigger1 = time = 0
time = 120

[State 5025, HFS]; Resets the fall parameter, so that the opponent will not fall on his back
type= hitfallset
trigger1= 1
value= 0

[State 5085, CS]
type = changestate
trigger1 = pos y
value = 5086

[State 5025, End]; Sends opponent back to his own states
type= selfstate
trigger1= pos y = 0
value= 5000;ifelse(pos y, 5020, 5000)

;---------------------------------------------------------------------------
; CUSTOM AIR-HIT (shaking) (Modified)
[Statedef 5086] ;Modified 5020
type    = A
movetype= H
physics = N
velset = 0,0

[State 5020, 1] ;Anim for HIT_LIGHT to HIT_HARD
type = ChangeAnim
trigger1 = Time = 0
trigger1 = GetHitVar(animtype) != [3,5]
value = ifelse((GetHitVar(airtype) = 1),5000,5010) + GetHitVar(animtype)

[State 5020, 2] ;Anim for HIT_BACK
type = ChangeAnim
trigger1 = Time = 0
trigger1 = GetHitVar(animtype) = [3,5]
value = 5030

[State 5020, 3] ;Anim for HIT_UP/HIT_DIAGUP (only if it exists)
type = ChangeAnim
trigger1 = Time = 0
trigger1 = (GetHitVar(animtype) = [4,5]) && (SelfAnimExist(5047 + GetHitVar(animtype)))
value = 5047 + GetHitVar(animtype) ;5051 - 4 + type

[State 5020, 4] ;Freeze anim
type = ChangeAnim
trigger1 = Time > 0
value = anim

[State 5020, 5]
type = ChangeState
trigger1 = HitShakeOver
value = 5087;5030

[State 5020, FFB Light]
type = ForceFeedback
trigger1 = anim = 5000
trigger2 = anim = 5010
persistent = 0
time = 6
waveform = square

[State 5020, FFB Medium]
type = ForceFeedback
trigger1 = anim = 5001
trigger2 = anim = 5011
persistent = 0
time = 8
waveform = sinesquare
ampl = 110,-1,-.3

[State 5020, FFB Hard]
type = ForceFeedback
trigger1 = anim = 5012
trigger2 = anim = 5002
trigger3 = anim = 5030
trigger4 = anim = [5051,5059]
persistent = 0
time = 15
waveform = sinesquare
ampl = 140

;---------------------------------------------------------------------------
; Air get-hit (knocked away)
[Statedef 5087];5030
type    = A
movetype= H
physics = N
ctrl = 0

[State 5030, 1]
type = ChangeAnim
trigger1 = Anim != [5000, 5199]
trigger1 = SelfAnimExist(5030)
value = 5030

[State 5030, 2]
type = VelAdd
trigger1 = 1
y = GetHitVar(yaccel)

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

[State 5030, 4]
type = ChangeState
triggerall = !HitFall
trigger1 = HitOver
trigger2 = Vel Y > 0    ;Hit ground
trigger2 = Pos Y >= Const(movement.air.gethit.groundlevel)
value = 5089;40 ;HITA_RECOV

[State 5030, 5]
type = selfState
triggerall = HitFall
trigger1 = HitOver
trigger2 = Vel Y > 0    ;Hit ground
trigger2 = Pos Y >= Const(movement.air.gethit.groundlevel)
value = 5050 ;HITA_FALL

[State 5030, 6]
type = ChangeState
trigger1 = AnimTime = 0
value = 5088;5035 ;Air get-hit (transition)

;---------------------------------------------------------------------------
; Air get-hit (transition)
[Statedef 5088]
type    = A
movetype= H
physics = N

[State 5035, 1]
type = ChangeAnim
trigger1 = Time = 0
trigger1 = SelfAnimExist(5035)
trigger1 = Anim != [5051,5059] ;Not if in hit up anim
trigger1 = Anim != 5090 ;Not if hit off ground anim
value = 5035

[State 5035, 2]
type = VelAdd
trigger1 = 1
y = GetHitVar(yaccel)

[State 5035, CA]
type = changeanim
triggerall = anim!=5040
triggerall = !hitfall
trigger1 = anim=5035 && animtime=0
trigger2 = time=0 && anim!=5035
value = 5040

[State 5035, 3]
type = ChangeState
triggerall = !HitFall
trigger1 = HitOver  ;Hit is over
trigger2 = Vel Y > 0    ;Hit ground
trigger2 = Pos Y >= Const(movement.air.gethit.groundlevel)
value = 5089 ;Air get-hit (recovering in air, not falling)

[State 5035, 4]
type = SelfState
triggerall = HitFall
trigger1 = HitOver  ;Hit is over
trigger2 = AnimTime = 0 ;Anim is over
trigger3 = Vel Y > 0    ;Hit ground
trigger3 = Pos Y >= Const(movement.air.gethit.groundlevel)
trigger4 = Time = 0     ;No transition anim
trigger4 = Anim != 5035 ;.
value = 5050 ;Air get-hit (falling)

;---------------------------------------------------------------------------
; Air get-hit (recovering in air, not falling)
[Statedef 5089] ;Modified 5040
type    = A
movetype= H
physics = N

[State 5040, 1]
type = selfState
trigger1 = !Alive
value = 5050
ctrl = 0

[State 5070, 1]
type = NotHitBy
trigger1 = 1
value = SCA
time = 1

[State 5040, 2]
type = ChangeAnim
triggerall = anim!=5040
trigger1 = AnimTime = 0
trigger1 = Anim != 5040
trigger2 = Time = 0
trigger2 = Anim != 5035
value = 5040

[State 5040, 4]
type = StateTypeSet
trigger1 = HitOver
movetype = I

[State 5040, 5]
type = VelAdd
trigger1 = 1
y = GetHitVar(yaccel)

[State 5040, 6]
type = SelfState
trigger1 = Vel Y > 0
trigger1 = Pos Y >= 0
value = 52 ;Jump land
ctrl = 1
Last Edit: May 22, 2018, 06:55:41 pm by Ricepigeon
Re: Problems with Reset code
#2  May 13, 2018, 12:42:59 pm
  • *****
  • Shame on you!
    • USA
I dont have time to really dig through everything, but P2's get up may have invincibility activating. Use ctrl+c to see the clsn boxes and see if they turn light blue every time they get up.
Check/increase your air hit times. Use debug to see what number of juggle you're at too.
If specials are hitting when they shouldn't double check their hitdef.

When your ultra and specials hit your timing seems a little tighter.
vVv Ryuko718 Updated 10/31/22 vVv
Re: Problems with Reset code
#3  May 14, 2018, 06:13:57 pm
  • *****
  • Thanks and God bless
    • USA
    • ricepigeon.neocities.org
So made a tiny bit of progress on the issue, as demonstrated here:

https://streamable.com/i1srg

Lie's S.LP, for whatever reason, is sending Sanae to her own state 5040, instead of the custom state intended for resets, which would be 5089. In laymans terms, S.LP is still using the old reset system, whereas everything else isnt, but complicating this issue is the second combo at 0:06, S.LP is using the correct system.
Re: Problems with Reset code
#4  May 14, 2018, 07:41:41 pm
  • *****
  • Shame on you!
    • USA
HHHmmmm, it could be the target number is messed up. You might want to try Altoid's method to pass the id using the hitdef's
envshake.ampl =
or whatever.
But watching the video I see some SLP send P2 to 5000 and some send it to custom states. Unless I'm seeing things weird. It seems like SLP is the only one doing it. All the others send P2 to 6000s. One or two SLP combo and stay using that 6000s custom states. It may just be a problem with state 200?

Cut and paste a hitdef you know works into state 200 for tests.
vVv Ryuko718 Updated 10/31/22 vVv
Re: Problems with Reset code
#5  May 16, 2018, 04:06:22 pm
  • *****
  • Thanks and God bless
    • USA
    • ricepigeon.neocities.org
Recycling a hitdef from another state doesn't seem to do anything. However, I did make another observation that I didn't notice;

Watching the video again, Im noticing it seems to only occur if s.LP hasnt been used in a combo yet, yet trying to reproduce it with any other normal does not result in the bug occuring, leading me to believe that its a problem with state 200 specifically.
Re: Problems with Reset code
#6  May 18, 2018, 07:22:08 am
  • ***
  • The Illusionary Wanderer
  • I have a dream
    • Vietnam
Recycling a hitdef from another state doesn't seem to do anything. However, I did make another observation that I didn't notice;

Watching the video again, Im noticing it seems to only occur if s.LP hasnt been used in a combo yet, yet trying to reproduce it with any other normal does not result in the bug occuring, leading me to believe that its a problem with state 200 specifically.

Just notice that you have updated your Meiling, Komachi and other with this bug being fixed. May I know how you fixed this problem?
Re: Problems with Reset code
#7  May 22, 2018, 06:56:44 pm
  • *****
  • Thanks and God bless
    • USA
    • ricepigeon.neocities.org
a bit late, but turns out the bug was occuring when P2 was exactly at pos y = 0, due to a carryover code in the custom states copied from the default states that was putting them back into their own states, hence the default behavior.