The Mugen Fighters Guild

M.U.G.E.N Central => Development => Topic started by: beterhans on July 26, 2014, 08:44:56 am

Title: Is there a easy way for a target get info from the attacker?
Post by: beterhans on July 26, 2014, 08:44:56 am
the attacker have a easy tool Target(xxx), parameter....
but the target have nothing to know what's going on at the attacker side.

I could only use the PlayerID but It may cause bug on 2vs2 fight.
Title: Re: Is there a easy way for a target get info from the attacker?
Post by: Алексей on July 26, 2014, 08:05:51 pm
Well, something that you may not have known is that "enemy(0)" redirects to P1 and "enemy(1)" redirects to his partner, in the eyes of the opposing team.

So try experimenting with "enemy" and "enemynear."
Title: Re: Is there a easy way for a target get info from the attacker?
Post by: beterhans on July 27, 2014, 11:17:56 am
It doesn't help when the attacker is a helper
Title: Re: Is there a easy way for a target get info from the attacker?
Post by: Алексей on July 27, 2014, 06:40:33 pm
Yeah, you can't have helper as your target anyways.
Title: Re: Is there a easy way for a target get info from the attacker?
Post by: Bastard Mami on July 28, 2014, 03:46:17 am
yeah, teh helper is very liekly gonan dissapear when you hit him, assuming you can hit him at all; if that does not happen the helper is gonna get drunk.
Title: Re: Is there a easy way for a target get info from the attacker?
Post by: Cyanide on July 28, 2014, 08:46:38 am
I am assuming custom state here. This is something rednavi came up with, gives you limited options but i suppose if you can ID your attacker you can then set specific values.

Gethitvar. You make sure that the following are in your hitdef

fall.envshake.time = 0 ;This is just so it doesn't actually take effect
fall.envshake.ampl = Random ID that you need for the effect. Use any numbers you like

Then within the custom state you can apply specific effects dependant on gethitvar(fall.envshake.ampl) For example

[State  800]
type = velset
trigger1 = gethitvar(fall.envshake.ampl) = 6
x = 20

[State  800]
type = velset
trigger1 = gethitvar(fall.envshake.ampl) = 4
y = -8

Etc. Imperfect, but gives you some options. Really only useful in custom states although you could apply it in a custom common1.cns too. Not useful globally because it requires opponent specific code. p1 and p2 both need to be aware of the envshake stuff. If that can't be done, you're kinda boned.
Title: Re: Is there a easy way for a target get info from the attacker?
Post by: Алексей on July 28, 2014, 12:28:59 pm
@Cyanide, that's an excellent idea. Rednavi's a smart guy.

@beterhans, I think you can utilize that to your advantage. Set fall.envshake.ampl = ID or root,ID (if you're attacking with a helper). Then, in the custom state, you can use playerID(gethitvar(fall.envshake.ampl)) to redirect to the play who hit you.

As Cyanide mentioned, that would only work in a custom state well. However, the gethitvar values are actually set anytime you're hit. From what I remember, during testing, they actually stay the same until something else happens. I was testing with gethitvar(animtype). I hit P1 and was outputting the value of that. It was the same until I either got hit again or started attacking.
Title: Re: Is there a easy way for a target get info from the attacker?
Post by: beterhans on July 28, 2014, 01:57:43 pm
Thank you! Cyanide
Great idea.

Title: Re: Is there a easy way for a target get info from the attacker?
Post by: Cyanide on July 29, 2014, 08:41:45 am
Quote
playerID(gethitvar(fall.envshake.ampl))
You're in a custom hitstate, you don't need playerID or anything like that, just gethitvar on its own.
Title: Re: Is there a easy way for a target get info from the attacker?
Post by: beterhans on July 29, 2014, 08:59:03 am
playerID(gethitvar(fall.envshake.ampl))

this is what I want :)