Local speedRatio = (speed - minspeed) / (maxspeed - minspeed) - Get speed and turn speed ratio This allows scoring above max speed, capped at max rate. Local upright =((rx >= 0 and rx = 270 and rx = 0 and ry = 270 and ry = minspeed and rvz >= minturnspeed then Local onGround = isVehicleOnGround(vehicle) - this wont work for monster truck Local speed = math.sqrt(vx*vx + vy*vy + vz*vz) Local rvx, rvy, rvz = getVehicleTurnVelocity(vehicle) Local rx, ry, rz = getVehicleRotation(vehicle) Local vx, vy, vz = getElementVelocity(vehicle) Maxscore = 10.0 - Score when drifting at maximum speed and turn velocity Just set some parameters for min and max speed and turn velocity, and come up with an arbitrary score. If you want an simple one you should be able to do that pretty easily. So yeah a good drift measurement is difficult if you don't know some math. Getting a really accurate measurement of drift in MTA might be difficult though, since I don't think there is a way to get the coordinates of the center of the front and back axles. Trigonometry, vectors and dot products are your friend. You should take rotation, velocity and speed into account also. Can someone confirm this?ĭrift is about a bit more than turn velocity. I am not certain, but I think turn velocity is measured in radians per second.
0 Comments
Leave a Reply. |