Massassi Forums Logo

This is the static archive of the Massassi Forums. The forums are closed indefinitely. Thanks for all the memories!

You can also download Super Old Archived Message Boards from when Massassi first started.

"View" counts are as of the day the forums were archived, and will no longer increase.

ForumsCog Forum → calling all vector mathematicians
calling all vector mathematicians
2009-11-19, 11:48 AM #1
So I'm working on an allies cog that has allied soldiers follow the player around

So basically what I need to know is how find a vector that's maybe 0.2 to 0.5 jku behind the player (a stoping point for the allies behind the player)

Do I need to use VectorAdd or VectorSub or something lik that?
2009-11-19, 1:24 PM #2
Couldn't you just have them stop when they are in a certain distance from the player? When the player moves in a certain direction they will end up behind him anyway. The only thing you'd need to do any sort of math is if you wanted them to line up parade-style.
2009-11-19, 1:40 PM #3
Just do VectorLen(VectorSub(GetThingPos(player), GetThingPos(ally))), that yields the distance.
Bassoon, n. A brazen instrument into which a fool blows out his brains.
2009-11-19, 2:54 PM #4
awesome.. thank you guys... i make things more difficult than they really are lol
2009-11-19, 6:27 PM #5
Originally posted by MysteriousSith:
calling all vector mathematicians [...] i make things more difficult than they really are lol


the answer is dependent on the field your vectors are over
2009-11-19, 8:33 PM #6
I'm interested to see how it turns out, as I once was wanting to make allies follow the player as well. I don't know if they'll end up bunching together like a flock of geese -- you might have to put a condition in there so they stay a certain distance from each other as well. I also wonder about friendly fire, but start off simple, and see how it turns out before worrying about the "what ifs."

↑ Up to the top!