I am getting a weird issue in mugen related to the usage of TargetBind and gethitvar(isbound) in a throw based movement.
If P1 initiates the grab, P2 reacts accordingly to the custom state and during the throw P2 detects the gethitvar(isbound) as 1.
However, if P2 initiates the grab, then P1 reports gethitvar(isbound) as 0, and then gets out of the custom state even if P2 Targetbind is still placing it in specific X,Y positions throughout the whole throw.
Code for the active player:
[Statedef 1452]
type = S
movetype = I
physics = S
juggle = 0
velset = 0,0
ctrl = 0
anim = 1452
sprpriority = 10
[State 0, Width]
type = Width
trigger1 = 1
value = 75,30
ignorehitpause = 1
;persistent =
[State 0, TargetState]
type = TargetState
trigger1 = !time
value = 1460
ID = -1
ignorehitpause = 1
;persistent =
[State 801, arm]
type = Explod
triggerall = !NumExplod(1454)
trigger1 = !time
anim = 1454
id = 1454
pos = 0,0
postype = p1
sprpriority = 5
bindtime = -1
removetime = -1
supermovetime = 9999
pausemovetime = 9999
ignorehitpause = 1
;persistent = 0
[State 801, bind]
type=targetbind
trigger1= AnimElemTime(2)<0
pos = 34,-96
[State 801, bind]
type=targetbind
trigger1= AnimElemTime(2)>=0 && AnimElemTime(3)<0
pos = 50,-104
[State 801, bind]
type=targetbind
trigger1= AnimElemTime(3)>=0 && AnimElemTime(4)<0
pos = 50,-110
[State 801, bind]
type=targetbind
trigger1= AnimElemTime(4)>=0
pos = 62,-117
[State 801, charge]
type = Explod
triggerall = !NumExplod(1480)
trigger1 = AnimElemTime(4)>=0
anim = 1480
id = 1480
pos = 66,-88
postype = p1
sprpriority = 7
bindtime = -1
removetime = -1
supermovetime = 9999
pausemovetime = 9999
ignorehitpause = 1
;persistent = 0
[State 0, PlaySnd] ;charge
type = PlaySnd
trigger1 = AnimElemTime(4)=0
value = 1450,0
channel = 5
ignorehitpause = 1
;persistent =
[State 1400, EndState]
type = ChangeState
trigger1 = time=56
value = 1453
And code for the receiving player (custom state):
[Statedef 1460]
type = A
movetype = H
physics = N
velset = 0,0
sprpriority = 0
[State 0, PlayerPush]
type = PlayerPush
trigger1 = 1
value = 0
ignorehitpause = 1
;persistent =
[State 0, AssertSpecial]
type = AssertSpecial
trigger1 = 1
flag = noautoturn
ignorehitpause = 1
;persistent =
[State 182, 1]
type = screenbound
trigger1 = 1
value = 1
movecamera = 1,0
[State 802, anim]
type = changeanim2
trigger1 = !time
value = 1460
[State 0, PosSet]
type = PosSet
trigger1 = !gethitvar(isbound)
y = 0
ignorehitpause = 1
persistent = 0
[State 820, 2]
type = SelfState
trigger1 = !gethitvar(isbound)
value = 5020
I have added a gethitvar(isbound) in the displaytoclipboard to indicate the status of the bound.
As I said, if P1 initiates the grab, P2 stays as gethitvar(isbound)=1 all the time.
However, if P2 initiates the grab, P1 remains as gethitvar(isbound)=0 even if the Targetbind is positioning the player in different places.
Any idea why it could fail??
Just for your information, I have fixed the issue by adding a enemy,stateno check in the SelfState, so that it doesn't activate while the active player is performing the whole throw. It's a dirty hack, but I want to understand why the gethitvar(isbound) has a total different behavior on P2, and why it fails on that particular state/move.