YesNoOk
avatar

p2stateno in hitdef ignores hitpause? (Read 1266 times)

Started by Minakata Moriya, October 22, 2020, 11:21:48 pm
Share this topic:
p2stateno in hitdef ignores hitpause?
#1  October 22, 2020, 11:21:48 pm
  • *
    • USA
I'm attempting to set up a special gethit state, where P2 is knocked straight back for a bit, then trips and falls on their back. I have the state working just as intended, but the issue is that any hitdef that uses p2stateno seems to ignore hitpause and sends P2 immediately into the target state. I thought maybe I could use an intermediary state to simulate the hitpause, but I was hoping to be able to use GetHitVar(hitshaketime) to tell when to properly begin the slide backward. But this isn't working:
Code:
;=== Knockback Stumble Fall ===
[Statedef 7010]
type    = S
movetype= H
physics = N
velset = 0,0
anim = 7010

[State 7010, Debug]
type = DisplayToClipboard
trigger1 = 1
text = "GetHitVar(hitshaketime): %d"
params = GetHitVar(hitshaketime)

[State 7010, EndHitPause]
type = ChangeState
trigger1 = HitPauseTime = 0
;trigger1 =  time = GetHitVar(hitshaketime)
value = 7011

[Statedef 7011]
type    = S
movetype= H
physics = N
velset = -7,0
anim = 7011

[State 7010, Trip]
type = ChangeState
trigger1 = time = 14
value = 7015


[Statedef 7015]
type    = A
movetype= H
physics = N
velset = -3.5,-4
anim = 7015

[State 7015, Gravity]
type = Gravity
trigger1 = 1

[State 7015, End]
type = SelfState
trigger1 = Vel Y > 0 && Pos Y >= 0
value = 5100

Is it possible to use GetHitVar to get the precise hitpause time? None of the parameters seem to work like I need it to. Any assistance is greatly appreciated. :)
Last Edit: October 23, 2020, 12:34:44 am by Minakata Moriya
Re: p2stateno in hitdef ignores hitpause?
#2  October 22, 2020, 11:40:21 pm
  • ****
  • CPU Purple Heart
    • USA
    • https://www.pixiv.net/en/users/8108265
 AFAIK, p2stateno sends the target immediately into a custom state regardless of hitpause, but you shouldn't even be using it because it's quite bugged (and said bugs aren't even documented for some reason).

 You're better off using two different targetstates that each meet certain conditions instead.
Re: p2stateno in hitdef ignores hitpause?
#3  October 22, 2020, 11:43:42 pm
  • *
    • USA
So... drop the p2stateno and instead use TargetState with a trigger of movehit?
Re: p2stateno in hitdef ignores hitpause?
#4  October 22, 2020, 11:49:01 pm
  • ****
  • CPU Purple Heart
    • USA
    • https://www.pixiv.net/en/users/8108265
 ... And any other triggers so that the two targetstates work on specific conditions really. It gives you a lot more control than p2stateno does.
Re: p2stateno in hitdef ignores hitpause?
#5  October 23, 2020, 12:34:29 am
  • *
    • USA
Good to know. Thank you!