News:

MFG's Character of the Month: October 2026 Nominations

Main Menu

BindToParent Problem

Started by THE WORLD, November 26, 2012, 12:28:56 AM

Previous topic - Next topic

THE WORLD

My character has a projectile attack where he picks up something, then if you press either A or B, he will throw it in a different direction. The sprite of the projectile is NOT connected to my character, it is a helper that I used BindToParent so it can be connected. However, there is a problem. The helper moves away if P2 pushes my character.

By using this code, the helper will stay binded to my character. However, if I press a button, the helper will stay in place and move a few seconds later.

[State 1050, BindToParent]
type = BindToParent
trigger1 = parent, stateno=1005
time = 180
facing = 1
pos = 17,-49


If I put the code like this, then the character can throw the helper, but the helper will move if my character is pushed.

[State 1050, BindToParent]
type = BindToParent
trigger1 = parent, stateno=1005 && !parent, stateno=[1010.1020]
time = 180
facing = 1
pos = 17,-49


How can I fix this?

Btw, State 1005 is where you choose what button you want, and States 1010 and 1020 are the throwing states.


Cyanide

trigger1 = parent, stateno=10054
time = 180

Trigger for 3 seconds every tick. While you are in state 1005, even if it's the LAST FRAME, the binding will still be active. Remove the time parameter. You only need it bound while the player is in a variable length state.

Oh and your second piece of code isn't good. [1010,1020] not period, comma. And you should get the same pushing results with either piece of code. If you don't want the helper to move with the parent you need to turn binding off, obviously.


In M.U.G.E.N there is no magic button

They say a little knowledge is a dangerous thing, but it's not one half so bad as a lot of ignorance.

THE WORLD

Quote from: Cyanide on November 26, 2012, 12:55:19 AM
Oh and your second piece of code isn't good. [1010,1020] not period, comma.

I know, I just accidentally put a period instead of a comma when I was typing (didn't copy and paste)