The Mugen Fighters Guild
M.U.G.E.N Central => Development => Topic started 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.
-
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."
-
It doesn't help when the attacker is a helper
-
Yeah, you can't have helper as your target anyways.
-
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.
-
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.
-
@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.
-
Thank you! Cyanide
Great idea.
-
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.
-
playerID(gethitvar(fall.envshake.ampl))
this is what I want :)