YesNoOk
avatar

P1 not bound if P2 initiates the hold. Possible bug with gethitvar(isbound)??? (Read 2689 times)

Started by XGargoyle, November 24, 2018, 08:40:44 pm
Share this topic:
P1 not bound if P2 initiates the hold. Possible bug with gethitvar(isbound)???
#1  November 24, 2018, 08:40:44 pm
  • ******
  • Hedgehog Whisperer
  • Red Bull addict
    • Spain
    • xgargoyle.mgbr.net
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:
Code:
[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):
Code:
[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.
XGargoyle: Battle posing since 1979
http://xgargoyle.mgbr.net
http://www.pandorabots.com/pandora/talk?botid=e71c0d43fe35093a  <-- Please click that link
http://paypal.me/XGargoyle  <-- Donations welcome!
Last Edit: November 25, 2018, 06:10:24 pm by XGargoyle
Re: P1 not bound if P2 initiates the hold. Possible bug with gethitvar(isbound)???
#2  November 24, 2018, 10:16:27 pm
  • ****
    • USA
    • twitter.com/inktrebuchet
That is strange! I wonder if it just needs an extra tick to ensure the gethitvar is read before triggering the selfstate.
Last Edit: November 24, 2018, 10:21:17 pm by ink
Re: P1 not bound if P2 initiates the hold. Possible bug with gethitvar(isbound)???
#3  November 24, 2018, 10:34:38 pm
  • ******
  • Hedgehog Whisperer
  • Red Bull addict
    • Spain
    • xgargoyle.mgbr.net
No, I also thought it could the famous 1 tick delay from P2, but if you add something like time>10 on the selfstate, it will activate at the 11th tick.

Gethitvar(isbound) is always 0 if P2 initiates that particular move, which is something I don't understand why it fails
XGargoyle: Battle posing since 1979
http://xgargoyle.mgbr.net
http://www.pandorabots.com/pandora/talk?botid=e71c0d43fe35093a  <-- Please click that link
http://paypal.me/XGargoyle  <-- Donations welcome!
Re: P1 not bound if P2 initiates the hold. Possible bug with gethitvar(isbound)???
#4  November 25, 2018, 08:28:56 am
  • *****
  • Shame on you!
    • USA
I'm not sure if this will help one bit, but you may want to add,

hitdefpersist =   ; drop all attacks
moveHitPersist =  ; Needed for MoveContact to remain true
hitcountpersist = ; Start a new combo

To your StateDef and see if the target sticks.
vVv Ryuko718 Updated 10/31/22 vVv
Re: P1 not bound if P2 initiates the hold. Possible bug with gethitvar(isbound)???
#5  November 25, 2018, 06:09:56 pm
  • ******
  • Hedgehog Whisperer
  • Red Bull addict
    • Spain
    • xgargoyle.mgbr.net
Found the root cause of the problem, but it confirms there' a bug on the engine, as the solution makes no sense why it works on one side and not on the other one.

[Statedef 1452]
type = S
movetype = A ;I
physics = S
juggle = 0
velset = 0,0
ctrl = 0
anim = 1452
sprpriority = 10

Movetype has to be set as A for the active player, in order to not drop the gethitvar(isbound) for P2. P1 is unaffected by it and works with both A and I
Why Movetype=I works if P1 initiates the move and fails if P2 initiates it is beyond my reasoning, so I will consider it as a mugen internal bug.

XGargoyle: Battle posing since 1979
http://xgargoyle.mgbr.net
http://www.pandorabots.com/pandora/talk?botid=e71c0d43fe35093a  <-- Please click that link
http://paypal.me/XGargoyle  <-- Donations welcome!
Re: P1 not bound if P2 initiates the hold. Possible bug with gethitvar(isbound)???
#6  November 26, 2018, 12:04:52 am
  • ****
  • Cute Bounty Hunter
Why would movetype = I be used anyway if the character is clearly attacking, even if it's just a throw?
Re: P1 not bound if P2 initiates the hold. Possible bug with gethitvar(isbound)???
#7  November 26, 2018, 09:48:04 am
  • ******
  • Hedgehog Whisperer
  • Red Bull addict
    • Spain
    • xgargoyle.mgbr.net
Yes, the movetype=I was an oversight from my side, but why it still works fine for P1 and be different for P2?
Clearly a bug in the engine.
XGargoyle: Battle posing since 1979
http://xgargoyle.mgbr.net
http://www.pandorabots.com/pandora/talk?botid=e71c0d43fe35093a  <-- Please click that link
http://paypal.me/XGargoyle  <-- Donations welcome!