YesNoOk
avatar

Is there a easy way for a target get info from the attacker? (Read 8128 times)

Started by beterhans, July 26, 2014, 08:44:56 am
Share this topic:
Is there a easy way for a target get info from the attacker?
#1  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.
Re: Is there a easy way for a target get info from the attacker?
#2  July 26, 2014, 08:05:51 pm
  • ****
  • Target Acquired.
    • Ukraine
    • mugencoder.com
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."

-[Все слова это только слова.]-
Re: Is there a easy way for a target get info from the attacker?
#3  July 27, 2014, 11:17:56 am
  • ****
It doesn't help when the attacker is a helper
Re: Is there a easy way for a target get info from the attacker?
#4  July 27, 2014, 06:40:33 pm
  • ****
  • Target Acquired.
    • Ukraine
    • mugencoder.com
Yeah, you can't have helper as your target anyways.

-[Все слова это только слова.]-
Re: Is there a easy way for a target get info from the attacker?
#5  July 28, 2014, 03:46:17 am
  • ******
  • [E]
    • Mexico
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.
Re: Is there a easy way for a target get info from the attacker?
#6  July 28, 2014, 08:46:38 am
  • ******
  • Legendary XIII
  • I am the eye of the storm to come!
    • New Zealand
    • network.mugenguild.com/cyanide/
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.


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: Is there a easy way for a target get info from the attacker?
#7  July 28, 2014, 12:28:59 pm
  • ****
  • Target Acquired.
    • Ukraine
    • mugencoder.com
@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.

-[Все слова это только слова.]-
Re: Is there a easy way for a target get info from the attacker?
#8  July 28, 2014, 01:57:43 pm
  • ****
Thank you! Cyanide
Great idea.

Re: Is there a easy way for a target get info from the attacker?
#9  July 29, 2014, 08:41:45 am
  • ******
  • Legendary XIII
  • I am the eye of the storm to come!
    • New Zealand
    • network.mugenguild.com/cyanide/
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.


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: Is there a easy way for a target get info from the attacker?
#10  July 29, 2014, 08:59:03 am
  • ****
playerID(gethitvar(fall.envshake.ampl))

this is what I want :)