YesNoOk
avatar

Targetstate not working on hit trade (Read 1139 times)

Started by SaltAddict, July 22, 2022, 01:57:38 pm
Share this topic:
Targetstate not working on hit trade
#1  July 22, 2022, 01:57:38 pm
  • avatar
  • ***
    • Portugal
I'm not really sure how to solve this problem since it seems more like a limitation of the state controller than an outright glitch, but I've noticed when using targetstate there is a 1 frame delay before the state controller actually takes effect. This becomes a problem when you trade hits at the exact same time, as it means p1 will be out of the attack state by the time the controller is supposed to take effect. This delay happens even when pausetime = 0,0 in the hitdef.

I got some other targetstates in -2 but I've noticed this happens even there. Although in that case it's more weird as it seems like p2's targetstate still takes effect while p1's doesn't.

Using p2stateno solves both these problem entirely but then the moves won't hit against enemies using hitoverride.

Code:
[State 240, high kick reaction]
type = targetstate
triggerall = var(51) = 0 || var(51) = 1 ;gameplay mode flags
triggerall = numtarget
Trigger1 = movehit = 1 && target, statetype !=A
value = 123457
persistent = 0
ignorehitpause = 1

And the one in -2:
Code:
[State -2, change to our own hit states]
type = targetstate
triggerall = numtarget
triggerall = movecontact && target, gethitvar(hitshaketime) = 0
triggerall = target, gethitvar(yvel) = 0 ;hit has no air velocity
triggerall = !target, GetHitVar(fall)
trigger1 = target, stateno = 5000 || target, stateno = 5010 ;hit states
trigger2 = target, stateno = 150 || target, stateno = 152 ;guard states
value = target, stateno + 1
ignorehitpause = 1

Taking out either of those codes still makes this happen btw, so it's not like they're interfering with each other.
Re: Targetstate not working on hit trade
#2  July 22, 2022, 04:43:17 pm
  • **
Mugen won't allow both players to be a target at the same time. Although, it seems like the hits will trade at the same time, the one who gets their hitdef parsed first will trigger the targetstate.  So either player can be targets, but just not at the same time.  It's probably something that's hardcoded in so nothing you can do about it.
And yes, there are also problems with p2stateNo.  Just use the lesser of the two evil. 
Re: Targetstate not working on hit trade
New #3  July 22, 2022, 10:29:12 pm
  • avatar
  • ***
    • Portugal
Mugen won't allow both players to be a target at the same time. Although, it seems like the hits will trade at the same time, the one who gets their hitdef parsed first will trigger the targetstate.  So either player can be targets, but just not at the same time.  It's probably something that's hardcoded in so nothing you can do about it.
And yes, there are also problems with p2stateNo.  Just use the lesser of the two evil. 


I see. Thanks!
Last Edit: July 22, 2022, 11:40:19 pm by SaltAddict