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 → vector equation help.
vector equation help.
2003-02-01, 1:42 PM #1
Me again. I'm trying to figure out what vector equation to use if I want to make it so the player shoots a projectile, but the projectile comes out of another thing in a different location. What do I have to enter in the fire offset section of the fireprojectile() verb to accomplish this?

------------------
Those who stare in the eyes of death and laugh will be the first to go.
Those who stare in the eyes of death and laugh will be the first to go.
2003-02-01, 1:57 PM #2
Err you must have a problem with your fireprojectile line...

FireProjectile(player, dadad etc);

The player is the thing where the projectile is fired from... So you can fire from another things position.

[This message has been edited by Hellcat (edited February 01, 2003).]
Team Battle.
2003-02-01, 2:19 PM #3
er.... no I don't have a problem with the fireprojectile line... the projectile fires, but I can't get the vector to fire from something that's floating above me. The thing floating above me faces enemies and I want a projectile to fire from it, but I also want the player to get the kills that the thing above me shoots. If there's another way to do this other than haveing the player shoot the projectile from a vector that makes it appear as though the thing floating above me is shooting, that will work to.

------------------
Those who stare in the eyes of death and laugh will be the first to go.

[This message has been edited by Hoard (edited February 01, 2003).]
Those who stare in the eyes of death and laugh will be the first to go.
2003-02-02, 12:52 PM #4
This is for bob right??

Just set bobs look then fire the projectile from the bob object... it will do what you want.

Code:
SetThingLook(bob, enemy);
FireProjectile(bob, projectile, sound, 8, '0.0 0.0 0.0', '0 0 0', 1.0, 0x20, 0.0, 0.0);
Team Battle.
2003-02-02, 3:02 PM #5
no no, I want to projectile to come from the player, so it registers the player as the killer in a MP game. If bob fires the projectile, it treats the kill like a suicide.

------------------
Those who stare in the eyes of death and laugh will be the first to go.
Those who stare in the eyes of death and laugh will be the first to go.
2003-02-02, 3:30 PM #6
Well that makes alot more sense then [http://forums.massassi.net/html/biggrin.gif]

I havnt tested this yet, so it might not work [http://forums.massassi.net/html/wink.gif]

Code:
fire_pos = VectorAdd(GetThingPos(player), VectorSub(GetThingPos(player), GetThingPos(bob)));

projectile = FireProjectile(player, projectile, sound, 8, fire_pos, '0 0 0', 1.0, 0x20, 0.0, 0.0);

SetThingLook(projectile , GetThingLVec(bob));


You might need to normalise the fire_pos.


[This message has been edited by Hellcat (edited February 02, 2003).]
Team Battle.

↑ Up to the top!