The Mugen Fighters Guild

Help => M.U.G.E.N Development Help => Topic started by: Maistral on April 30, 2012, 08:14:41 pm

Title: TargetBind.
Post by: Maistral on April 30, 2012, 08:14:41 pm
Alright, it's been a while since I asked here, lol.

So yeah. I have this attack that would cause the enemy to bind to the player when he is hit:

Code:
[State 0, TargetBind]
type = TargetBind
triggerall = time < 36
trigger1 = movehit && p2dist x <= 20 && p2dist y >= -20
time = 1
pos = 20,-20

The problem now is, if it hits the enemy's helper, the enemy ends up being bound to the player. Wanted it such that if the player hits the enemy's helper, the enemy (would of course) not be suddenly bound to the player's attack.

Title: Re: TargetBind.
Post by: Cyanide on April 30, 2012, 10:22:10 pm
How is the enemy a target when you hit the helper? Are you hitting them both? Things only become a target of targetbind if they're movetype = H. The opponent MUST be in a hitstate for this to work.

You could ID the hitdef and use that as a requirement for the targetbind. Doesn't tell us why you're getting p2 as a target when you hit a helper though.
Title: Re: TargetBind.
Post by: Maistral on May 02, 2012, 09:42:23 am
Gah! I forgot that I could ID the hitdef, lol. Forgot it altogether lololol.

Oh well, shit happens. Thanks :D
Title: Re: TargetBind.
Post by: Maistral on May 02, 2012, 10:06:13 am
Meh, reopened.

Code:
[State 0, TargetBind]
type = TargetBind
triggerall = time < 36
trigger1 = movehit
time = 1
id = 2
pos = 20,-20

[State 1314, 1]
type = HitDef
trigger1 = time%4 = 0
attr = S, NA
damage = 4,1                  ;Damage that move inflicts, guard damage
animtype = Light                 ;Animation type: Light, Medium, Heavy, Back (def: Light)
guardflag = MA
hitflag = MAF
priority = 3, Hit
pausetime =0,11                 ;Time attacker pauses, time opponent shakes
sparkno = 1                    ;Spark anim no (Def: set above)
sparkxy = -30, -25              ;X-offset for the "hit spark" rel. to p2,
;Y-offset for the spark rel. to p1
hitsound = S9, 30                 ;Sound to play on hit
guardsound = S9, 30               ;Sound to play on guard
ground.type = High               ;Type: High, Low, Trip (def: Normal)
ground.slidetime = 0             ;Time that the opponent slides back
ground.hittime  = 10             ;Time opponent is in hit state
ground.velocity = -10 ,-.8             ;Velocity at which opponent is pushed
airguard.velocity = -10,-.8     ;Guard velocity in air (def: (air.xvel*1.5, air.yvel/2))
air.type = High                  ;Type: High, Low, Trip (def: same as ground.type)
air.velocity = -10,-3           ;X-velocity at which opponent is pushed,
;Y-velocity at which opponent is pushed
air.hittime = 12
envshake.time = 5
envshake.freq = 60
envshake.ampl = -4
envshake.phase = 90
ground.cornerpush.veloff = 0
air.cornerpush.veloff = 0
down.cornerpush.veloff = 0
guard.cornerpush.veloff = 0
airguard.cornerpush.veloff = 0
fall = 1
id = 2

So yeah, I put the id tag. The problem now is, the enemy would still bind to the attack when the enemy is standing up. This, I truly do not know now what to do. :(
Title: Re: TargetBind.
Post by: Maistral on May 02, 2012, 10:08:59 am
How is the enemy a target when you hit the helper? Are you hitting them both? Things only become a target of targetbind if they're movetype = H. The opponent MUST be in a hitstate for this to work.

You could ID the hitdef and use that as a requirement for the targetbind. Doesn't tell us why you're getting p2 as a target when you hit a helper though.

Yep. The attack only binds the enemy when P2 is movetype = H. My problem was when the enemy is in a lying-down state, and I hit its helper, P2 would be binded to the attack thus attacking both the helper and P2.

ID tags partially solved the problem. It only gets binded when the enemy's getting up now. :(
Title: Re: TargetBind.
Post by: Cyanide on May 02, 2012, 10:14:05 am
He shouldn't be ID 2 at that point, or is this using the attack twice in quick succession?

Type = Targetdrop
time = 0
Title: Re: TargetBind.
Post by: Maistral on May 03, 2012, 05:17:08 am
Nope, this one's attacking rapidly in a quick succession (ie. something like... how to describe.. oh; being machine-gunned "physically", or something like that)
Title: Re: TargetBind.
Post by: Cyanide on May 03, 2012, 08:40:45 am
Well then how does he wind up lying down with ID = 2? Does the attack miss him at some point yet keep going and he's managed to launch an unkillable projectile or something?
Title: Re: TargetBind.
Post by: Maistral on May 04, 2012, 01:45:26 pm
It's actually a helper that is always there.

It's similar to my old puppet character; for example when the parent is knocked out, then getting up, and while this is happening the puppet is hit by the binding attack; the parent would suddenly bind to the attack causing both the puppet and the parent to be hit.
Title: Re: TargetBind.
Post by: Maistral on May 05, 2012, 12:31:18 pm
Code:
[State 0, TargetBind]
type = TargetBind
triggerall = movehit
trigger1 = p2stateno != 5110                <<<<<<<<<<<<<
time = 1
pos = 20,-20
id = 2

This apparently solved it. Thanks anyway.