Acceleration. - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Acceleration. (
/showthread.php?tid=195505)
Acceleration. -
Bessensap - 02.12.2010
Again, this is me with another weird sin tan cos thingy.
I'm in a vehicle
*.
I want to do this:
I have 2 coords, 1 coord which i will choose later, and the vehicle pos
Then i want to Set the vehicle velocity so, that it goes straight to my coord.
Yes, Vehicle, cause SetPlayerVelocity Sucks.
thx
Re: Acceleration. -
randomkid88 - 02.12.2010
If you want it to go straight to it, why not just use SetVehiclePos? Because this way if there are objects in the way the car would explode.
Re: Acceleration. -
Bessensap - 07.12.2010
Quote:
Originally Posted by randomkid88
If you want it to go straight to it, why not just use SetVehiclePos? Because this way if there are objects in the way the car would explode.
|
"Sigh"
Maybe because im making something with which i would like to use SetVehicleVelocity, because i'm not trying to set the pos to somewhere i'm wanting to launch him somewhere.
Re: Acceleration. -
Bessensap - 09.12.2010
Bump. Anyone?
Re: Acceleration. -
Bessensap - 16.12.2010
Bump. Sorry guys, been a week.
Re: Acceleration. -
Babul - 16.12.2010
Код:
Slowdown=100
DeltaPosX=XA-XB
DeltaPosY=YA-YB
Angle=-(90+(atan2(YA-YB,XA-XB)))
Radius=floatsqroot((DeltaPosX*DeltaPosX)+(DeltaPosZ*DeltaPosZ))
maybe some of this shit helps you. at least it works in my oject editor..
to get your vehicle accelration speeds, you should divide the Radius with a pretty high value, thats the Slowdown=100 for, maybe increasing it upto Slowdown=1000 helps, if your coordinates are far away. the result of Raduis/Slowdown should get you a value for the speed (like 2, 3, or even 4?). you know that i guess
Код:
VehicleAccX=Radius/Slowdown*floatsin(Angle-DeltaPosX,degrees)
VehicleAccY=Radius/Slowdown*floatcos(Angle-DeltaPosX,degrees)