YesNoOk
avatar

Bindtotarget doesn't work (Read 304 times)

Started by Continuity, January 12, 2010, 10:51:12 pm
Share this topic:
Bindtotarget doesn't work
#1  January 12, 2010, 10:51:12 pm
  • ***
  • 我が名は 「ハクメン」、押して参る!
I think the title speaks for itself, I want to have a fire effect on the enemy, so I used a helper that will trigger at the right time and the helper will have a bindtotarget controller so it'll stick to the enemy, but right now the effect appears but its position is always 0,0 to p1, which means that bindtotarget itsn't working. Here's my code of my helper, thanks in advance

[mcode];fire1
[statedef 8014]
type=A
movetype=I
physics=N
sprpriority=999
anim=8014
velset=0,0
ignorehitpause=1

[state 1670]
type=bindtotarget
trigger1=1
pos=24,-55

[state 8000]
type=assertspecial
trigger1=1
flag=noshadow

[state 8000]
type=velset
trigger1=1
value=0,0

[state 8000]
type=destroyself
trigger1=animtime=0[/mcode]
Last Edit: January 13, 2010, 03:03:04 am by Juggervoid
Re: Bindtotarget doesn't work
#2  January 12, 2010, 11:04:14 pm
  • ******
  • Legendary XIII
  • I am the eye of the storm to come!
    • New Zealand
    • network.mugenguild.com/cyanide/
Quote
movetype=I
Would prevent it working because characters have to be in an attacking state to have a target. If p2 drops out of hitstate he will no longer be a target.

your main issue here is that the helper doesn't pick up the parent's target. As such the helper would have no target even if the above was true.

You either need to do the simple option of enemynear(0), pos X/y and use a posset. Or the more complex option that is something like

varset
value = enemynear(0), player ID

then reference that var in the helper states and have the helper set it's OWN variable to the same value as the parents.

Then use

x = playerID(var(0)), pos X

to do the posset. I'd go for the first option though. The second is a pain in the ass and uses up 2 variables to account for teammode.


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.
Re: Bindtotarget doesn't work
#3  January 13, 2010, 02:35:45 am
  • ***
  • 我が名は 「ハクメン」、押して参る!
hmm..I've never used enemynear before, would you mind quickly explaining how it works? i.e the format for it and where to put it. Thank you
Re: Bindtotarget doesn't work
#4  January 13, 2010, 02:37:39 am
  • ******
Or you could look at the docs. It's a trigger redirection, it looks at the nearest enemy.
When you write "pos X", it checks for your own pos X ; if you write "enemynear,pos X", then it checks the position of the nearest enemy. This is trigger redirection, put the redirection followed by a comma before the actual trigger you want to use. There's nothing magic about it. It just looks at what you tell it to look. You should be able to tell by just reading.
If I struggled to the end of my determination, to the end of my way of life with my followers, if the result is ruin, then this ruin is inevitable. Grieve. Shed tears. But you cannot regret.
Re: Bindtotarget doesn't work
#5  January 13, 2010, 03:02:55 am
  • ***
  • 我が名は 「ハクメン」、押して参る!
Alright, I tried it out a little and it worked, thank you