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 → Finding Aiming Vector
Finding Aiming Vector
2001-01-27, 10:57 AM #1
When using FireProjectile one of the parameters is a vector on how to fire it. I want that vector to aim at a moving object so I need to know how to get the vector for one thing to fire at another. How would I do that?
"Jedi Masters don't wear togas."
2001-01-27, 11:34 AM #2
player = GetLocalPlayerThing();
blah = FirstThingInView();
blah2 = GetThingPos(blah);
avector = VectorSub(player, blah2);
FireProjectile(avector goes in the parameter(s) that you need for vectors, here);

Try it. Need to fill in parameters for FirstThingInView(), I believe Hideki's site has it (http://millennium.massassi.net).

-Jipe
2001-01-27, 1:08 PM #3
It almost works, but it fires the projectile about 90 degrees to the right.
"Jedi Masters don't wear togas."
2001-01-27, 2:14 PM #4
Try this.

Code:
op = FirstThingInView(player, aimFovDist, aimFovAngle, 0x404);

pPos = GetThingPos(player);
oPos = GetThingPos(op);

aimVec = VectorSub(pPos, oPos);
FireProjectile(player, template, sound, key, fromVec, aimVec, 1, aimFovDist, aimFovAngle);


------------------
http://millennium.massassi.net/ - Millennium

↑ Up to the top!