Jump to content


  • Posts

  • Joined

  • Last visited

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

DefiniteIntegral's Achievements


Rat (9/54)



  1. You could just use a normal vehicle, and create your own moveObject type function for moving it. It is possible to use setElementPosition on a frozen vehicle I think.... So just freeze your vehicle to stop it falling and move it along a linear path.
  2. I am not certain, but I think turn velocity is measured in radians per second. Can someone confirm this? Drift is about a bit more than turn velocity. You should take rotation, velocity and speed into account also. Trigonometry, vectors and dot products are your friend. 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. So yeah a good drift measurement is difficult if you don't know some math. If you want an simple one you should be able to do that pretty easily. Just set some parameters for min and max speed and turn velocity, and come up with an arbitrary score. eg minspeed = 0.1 maxspeed = 1.5 minturnspeed = math.rad(1) maxturnspeed = math.rad(45) maxscore = 10.0 -- Score when drifting at maximum speed and turn velocity function someFunction(vehicle) local vx, vy, vz = getElementVelocity(vehicle) local rx, ry, rz = getVehicleRotation(vehicle) local rvx, rvy, rvz = getVehicleTurnVelocity(vehicle) local speed = math.sqrt(vx*vx + vy*vy + vz*vz) local score = 0 local onGround = isVehicleOnGround(vehicle) -- this wont work for monster truck local upright =((rx >= 0 and rx <= 90) or (rx >= 270 and rx <= 360)) and ((ry >= 0 and ry <= 90) or (ry >= 270 and ry <= 360)) -- Don't score upside down vehicle -- only score if on ground and upright if onGround == true and upright == true then -- only score if above minimum speed and turn speed limits -- Only take vehicles Z rotation into account since it is vehicle relative if speed >= minspeed and rvz >= minturnspeed then -- cap speeds at maximum. This allows scoring above max speed, capped at max rate. if speed > maxspeed then speed = maxspeed end if turnspeed > maxturnspeed then turnspeed = maxturnspeed end -- add score local speedRatio = (speed - minspeed) / (maxspeed - minspeed) -- Get speed and turn speed ratio local turnSpeedRatio = (rvz - minturnspeed) / (maxturnspeed - minturnspeed) local scoreScalar = speedRatio * turnSpeedRatio -- Multiply ratios to find combined ratio. score = maxscore * scoreScalar -- Scale max score by combined speed ratio end end return score end .. or something like that. I just came up with that off the top of my head, there are probably mistakes. As for your marker issue... you could use the server events onMarkerHit and onMarkerLeave to start/stop a timer to accumulate score. Or, you could just have an infinitely repeating timer so drifting can be scored constantly.
  3. Why include a y rotation? You only need X and Z when you are transforming relative to GTA world space, since the world coordinates have constant orientation. Even if you are transforming relative to a vehicles orientation Y rotation still isn't necessary since it only controls the vehicles roll. I am not sure about ped orientations.
  4. Please tell me that DP3 isn't going to return to a system whereby it is impossible to play LAN games without a serial. I am dreaming of an optionally non-authenticating DP3 server...
  5. Thanks for that. I put some very basic info in the wiki. It is just a plain text description though, I am no wiki editor..
  6. setVehicleAdjustableProperty : I noticed this blank entry in the wiki a couple of days ago. I also notice it can be called from DP2, although I have no idea what the property names are. Before I go getting my hopes up as to what sort of properties may be adjustable... does anyone have any information on this function?
  7. Wait. Does that mean MTA is not a server-authoritative system? Since that's pretty much what I have been assuming this whole time. In that case, the lag bugs in the present version were introduced by me attempting to operate under that assumption. I can fix it easily now. Edit: Updated. It should work now, hopefully.
  8. Thanks. Too bad it still barely works with anything above mild lag. If only MTA exposed an interface for modifying vehicle parameters in GTA directly, this entire mod would become completely unnecessary, and the lag issues resulting from my 'brute force' velocity modification would disappear. Of course I know that will never happen. Sigh... I can dream, though.
  9. Edit : Update released. Hopefully this fixes things...
  10. Yeah, I have experienced this as well. Firstly, it takes the server quite a while to load the maps. I suspect this has something to do with the length of the server-side script, as the problem continued to get worse as the script gained length. The script is now much longer than the original race server-side script. However even with that, it should still load after a while. However, I have also experienced the perpetual black screen problem. I am not sure how to fix it though... as no errors come up in the server logs. Usually all I need to do in this case is have the client experiencing black screen to disconnect from the server, then reconnect. Upon reconnecting it just seems to magically work straight away. To be fair, however, I also get this problem using the normal race mod, not just boost. Do you have any server-side errors come up on connect that you can post here? That would help me immensely. I am not actively working on this mod presently (I have moved on to Half Life 2 editing...), but I will try to fix any bugs that pop up. Actually thinking about it, I do have one suspicion about the cause, I shall have to look into it. I think perhaps in trying to remove server side warnings (because they annoy me), I might have introduced a spawning-related bug. If you don't mind, could you try sending me one of your map files? I would like to test it out myself to see if that helps me figure out the problem. Even just if you throw together a demo map, or whatever. You can send it to [email protected] Edit: Fix uploaded.
  11. The reason for the long description was to outline changes made to the race mod. These changes were the main point to this release. I don't think these maps are anything special. For example they are ridiculously easy. They are largely just demonstrations of crazy stuff that can be done. I made them and the race modifications for fun... there is no 'worth' to be had from the start.
  12. You could try having a look at setElementDimension and setElementInterior http://development.mtasa.com/index.php? ... tDimension http://development.mtasa.com/index.php? ... ntInterior I haven't used interiors so that's about the best I can do to help you.
  13. It isn't actually moving along the x-axis. The effect you describe comes from the edge of the model moving away as a result of the rotation. Just play with the numbers a bit to compensate for the apparent drift. road = createObject ( 18450, -992.48059082031, 340.8141784668, 2.2976553440094 ) road2 = createObject ( 18450, -912.5, 340.8141784668, 2.2976553440094 ) function roadup() if road then local posx, posy, posz = getElementPosition(road) moveObject ( road, 8000, posx + 2, posy, posz + 10, 0, 15, 0 ) end end addCommandHandler ("roadup", roadup ) function roaddown() if road then local posx, posy, posz = getElementPosition(road) moveObject ( road, 8000, posx - 2, posy, posz - 10, 0, -15, 0 ) end end addCommandHandler ("roaddown", roaddown ) That is a pretty close estimate. Could still be made a bit nicer though.
  14. Ah yes indeed. I must have been blind to miss that That's what I get for being too lazy to read the wiki most of the time. I was rather expecting something like rotateObject. That fit better with my perception of naming convention in MTA.
  • Create New...