Blockland Forums > Modification Help
Adding relative velocity (vectors)
<< < (2/2)
lordician:
Hmm, Amade's example didn't really help after all.
Amade, could you explain what this was for?
Maybe i didn't understand the script right but so far i got that it got like the vector that is like the direction between 2 slots.

Another time,
I have 2 vectors.
Vec1: "0 0 6" being the velocity i want to add
Vec2: "1 5 7" being the direction i want the velocity to be added.
How to?
Amade:
The script was made with players in mind. For example, if you wanted to move a player forward (relative to the direction the player is facing) with it you would use a vector scaled from the vector "0 1 0", though a simpler way to do that would be to scale the eye vector.

The script by Clockturn is made to convert an absolute vector to one relative to the location of a slot on a player, which is assumed to be the eye node if no node is specified.

I'm still not understanding what you're trying to do, though.
lordician:

--- Quote from: Amade on November 03, 2011, 04:11:03 PM ---The script was made with players in mind. For example, if you wanted to move a player forward (relative to the direction the player is facing) with it you would use a vector scaled from the vector "0 1 0", though a simpler way to do that would be to scale the eye vector.

The script by Clockturn is made to convert an absolute vector to one relative to the location of a slot on a player, which is assumed to be the eye node if no node is specified.

I'm still not understanding what you're trying to do, though.

--- End quote ---
Vehicle goes up no matter how it is angled.
So even if the vehicle is upside down it will still go up if i add the vector "0 0 6".
But i want the vehicle to get this 6 upward velocity for what it's upward is.
So like, if that thing is upside down, he will move downwards because he is upside down.
Better?
Amade:

--- Quote from: lordician on November 03, 2011, 06:10:59 PM ---Vehicle goes up no matter how it is angled.
So even if the vehicle is upside down it will still go up if i add the vector "0 0 6".
But i want the vehicle to get this 6 upward velocity for what it's upward is.
So like, if that thing is upside down, he will move downwards because he is upside down.
Better?
--- End quote ---
Much better, yes. In that case you would just modify the coding from Clockturn I posted to work with vehicles. If you don't feel like modifying you can do a slightly hacky thing to get around its being defined for players:
--- Code: ---Player::getRelativeVector(%vehicle, "0 0 6", "eye");
--- End code ---
Navigation
Message Index
Previous page

Go to full version