News:

MFG's Character of the Month: October 2026 Nominations

Main Menu

Snap Issue

Started by kargon, July 01, 2016, 12:32:17 AM

Previous topic - Next topic

kargon

In hitdef, is there a way to force the opponent to snap a specific distance from the point of contact than from the attacker? I've tried snap = 200, for example, and all it does is force the opponent, on hit, to snap his root to 200 from the attacker's root. Instead, I want him to snap 200 away from the point of contact, so if the roots are 150 apart, and I want him to snap an additional 200, he would end up 350 away from me.

Also, can this be done on guard as well? Force the opponent X units away from you.

Thanks!

kargon

I guess basically a PosAdd for P2 on hit or guard?

Rajaa Retired

The docs recommend using targetbind for that, but if snap works for you, go ahead.

The formula is simple. Just add p2dist x to 200.

snap = floor(p2dist x + 200)

kargon

Thanks! I'll give it a try and report on the results!

Odb718

You may need some "Facing" math in there. +200 may not work if the character is pointed the wrong direction on the wrong side. Especially if you're using helpers like it sounds like. But the idea is correct.

The move guarded may be possible by setting the x velocity with some tricky math. I think my Ibuki does something similar. But getting it to SNAP there, I doubt it.
vVv Gouken718 vVv SabreTooth718 vVv


XGargoyle

Use TargetBind instead of snap


XGargoyle: Battle posing since 1979
http://xgargoyle.mgbr.net
http://www.pandorabots.com/pandora/talk?botid=e71c0d43fe35093a  <-- Please click that link
http://paypal.me/XGargoyle  <-- Donations welcome!

kargon

Is there a way to get the current distance of the players and then add an additional amount? That way I could always have the desired effect of pushing the opponent back an additional X amount.

Odb718

#7
I made a pretty complete post. It may be in Mugen Class... let me try and track it down.

----
reverse image search ftw.
http://mugenguild.com/forum/topics/rootdist-triggers-169969.0.html

---- ----
wait, do you mean without helpers involved? p2dist x and p2BodyDist X. Both are explained in Mugen Class. But P2Dist is probably exactly what you want.
vVv Gouken718 vVv SabreTooth718 vVv


kargon