Blockland Forums > Modification Help
Add Velocity
<< < (3/4) > >>
Destiny/Zack0Wack0:
I tried to work it out. It involved using axisToEuler and some tricky maths. Didn't work though. Pretty sure Truce or Space Guy will come in here with an easy method completely foiling my attempt :cookieMonster:
Truce:

--- Quote from: Destiny/Zack0Wack0 on January 10, 2011, 12:21:23 AM ---Pretty sure Truce or Space Guy will come in here with an easy method completely foiling my attempt :cookieMonster:

--- End quote ---

Well since Space Guy is sleeping...  :cookieMonster:


--- Code: ---%pos = vectorAdd(%pos,%offx * %vy + %offy * %vx SPC %offy * %vy + %offx * -%vx SPC %offz);
--- End code ---

%pos is the position of the player
%vx and %vy are the two components to the player's forward vector*
%offx, %offy, and %offz are the position offsets

For example, to get a position 5 units to the player's right, %offx would be 5.
And 3 units to the left and 3 units behind would be %offx = -3 and %offy = -3.

*easiest way:


--- Code: ---%fv = %pl.getForwardVector();
%vx = getWord(%fv,0);
%vy = getWord(%fv,1);
--- End code ---
Nexus:
AAAAUghghh.... vector math.

Good to know there is someone out there that gets it, though.
Destiny/Zack0Wack0:

--- Quote from: Truce on January 10, 2011, 12:54:38 AM ---position

--- End quote ---

--- Quote from: howtoshotbillwetellyou on January 09, 2011, 11:33:10 PM ---velocity

--- End quote ---
I checked your script in-game just to be sure, and it's definitely not what he is asking. Maybe you should go sleep as well :cookieMonster:
Truce:

--- Quote from: Destiny/Zack0Wack0 on January 10, 2011, 02:14:48 AM ---I checked your script in-game just to be sure, and it's definitely not what he is asking. Maybe you should go sleep as well :cookieMonster:

--- End quote ---

I think you're the one tired here - I used it as an example to get a position relative to where the player's facing. For velocity, instead of vectorAdd(%pos,<expression>), you can %pl.addVelocity(<expression>). It uses the same calculations.
Navigation
Message Index
Next page
Previous page

Go to full version