Vehicle angle wrong

Started by Ankris, Nov 25, 2016, 08:21 PM

Previous topic - Next topic

Ankris

No matter what I do (Euler & Quaternion), I always get the same angle:



when I want this angle:



Any idea?

Mötley

Have you tried

http://forum.liberty-unleashed.co.uk/index.php/topic,1771.0.html ?

This is a bug that really needs to be solved..

I hope you didn't do a lot of vehicle saving at once >:( :-[..

Mötley

#2
I will figure something out, Unless someone better than me finds out a better method.

But for now.. I had used player.Angle in the past.. But you need to drive straight to where you want the car, From what I remember, No direct car spawn, enter, turn save, etc..

Something like this should buy you some time until someone else helps,.. :-\

  if (cmd == "angle")
  {
        if (player.Vehicle)
        {
             print("Broken Angle " + player.Vehicle.Angle)
             player.Vehicle.Angle = player.Angle;
             print("New Angle " + player.Vehicle.Angle)
             /* In-case something weird happened */
             print("The new angle should return " + player.Angle)
        }
        else MessagePlayer("Wheres the car?", player, 255, 0, 0);
  }

Maybe you could try setting the players angle instead to what you want it. If the vehicle angles to your desire save it with player.Angle. Should do the trick

Xmair

function GetRadiansAngle(Rotation)
{
 local angle;
 angle = ::asin( Rotation.z ) * -2;
 return Rotation.w < 0 ? 3.14159 - angle : 6.28319 - angle;
}
Source.

Credits to Boystang!

VU Full Member | VCDC 6 Coordinator & Scripter | EG A/D Contributor | Developer of VCCNR | Developer of KTB | Ex-Scripter of EAD

Xmair

Just use the function instead of rotation angle x,y,z.

Credits to Boystang!

VU Full Member | VCDC 6 Coordinator & Scripter | EG A/D Contributor | Developer of VCCNR | Developer of KTB | Ex-Scripter of EAD

Mötley

local rot = Vector(sqlite_column_data(query, 4), sqlite_column_data(query, 5), sqlite_column_data(query, 6));
vehicle.EulerAngle = rot;

What?!



My code does not crash for me. I have been able to save vehicle angles.

For me, I just set the vehicle angle to be the players angle, Set the angle to my desire, Then save that vehicle,

I just use Vehicle.Angle when installing the cars.

Player.Angle for saving the car.

Not some Vector. But maybe there is supposed to be a different way idk..

KAKAN

Ankris, use like this:-
"Update h set angle="+player.Vehicle.GetRadiansAngle()
Then, use that angle instead of vector while creating the vehicle
oh no