Handling.lua

Modding discussion that doesn't fit into the above areas
Bookmark and Share

Handling.lua

Postby [DRuG]Stijger on Sun Jan 22, 2012 11:46 pm

Hey guys,

With a lot of mods comes a customized handling.cfg line.
But MTA uses scripts for that right?
And yeah you got some nice handling scripts out there, but those aren't easily adjusted.
So to make life easier to use the customized handling from the modder use:
http://www.potholestudios.com/Content/pid=45.html
There you can input any handling.cfg (Also the exported ones from Hedit, NikT ;) )
And out comes a MTA Lua Handling.

Copy paste this into:
Code: Select all
function handling (  )
for _,veh in pairs(getElementsByType("vehicle")) do
   if getElementModel(veh) == 560 then
      setVehicleHandling (veh, "mass", 1600)
        setVehicleHandling(veh, "turnMass", 3921.3)
        setVehicleHandling(veh, "dragCoeff", 1.8 )
        setVehicleHandling(veh, "centerOfMass", { 0, -0.4, 0 } )
        setVehicleHandling(veh, "percentSubmerged", 75)
        setVehicleHandling(veh, "tractionMultiplier", 0.75)
        setVehicleHandling(veh, "tractionLoss", 0.85)
        setVehicleHandling(veh, "tractionBias", 0.52)
        setVehicleHandling(veh, "numberOfGears", 5)
        setVehicleHandling(veh, "maxVelocity", 400)
        setVehicleHandling(veh, "engineAcceleration", 20 )
        setVehicleHandling(veh, "engineInertia", 10)
        setVehicleHandling(veh, "driveType", "rwd")
        setVehicleHandling(veh, "engineType", "petrol")
        setVehicleHandling(veh, "brakeDeceleration", 10)
        setVehicleHandling(veh, "brakeBias", 0.53)
        setVehicleHandling(veh, "steeringLock", 35)
        setVehicleHandling(veh, "suspensionForceLevel", 1.3)
        setVehicleHandling(veh, "suspensionDamping", 0.12)
        setVehicleHandling(veh, "suspensionHighSpeedDamping", 0)
        setVehicleHandling(veh, "suspensionUpperLimit", 0.28 )
        setVehicleHandling(veh, "suspensionLowerLimit", -0.12)
        setVehicleHandling(veh, "suspensionFrontRearBias", 0.38 )
        setVehicleHandling(veh, "suspensionAntiDiveMultiplier", 0)
        setVehicleHandling(veh, "seatOffsetDistance", 0.2)
        setVehicleHandling(veh, "collisionDamageMultiplier", 0.24)
        setVehicleHandling(veh, "monetary", 25000)
        setVehicleHandling(veh, "modelFlags", 0x40000000)
        setVehicleHandling(veh, "handlingFlags", 0x10200008 )
        setVehicleHandling(veh, "headLight", 0)
        setVehicleHandling(veh, "tailLight", 1)
        setVehicleHandling(veh, "animGroup", 0)
      end
   end

end
addEventHandler ( "onPlayerVehicleEnter", getRootElement(), handling )

Overwriting the other SetVehicleHandling's
(watch for the "setVehicleHandling(veh, "ABS", 0)" , that one can give some trouble sometimes)
Change the Car ID Number: 560 = Sultan
(link car ID: http://wiki.multitheftauto.com/index.php?title=Vehicle_IDs)

Save as handling.lua in your mapdirectory
Add to your metafile the line:
<script src="handling.lua" type="server"></script>
And your done.

(Btw the example script gives a sultan crazy acceleration and maxspeed)
User avatar

[DRuG]Stijger
[DRuG] member

Status:
Good Luck Veccie

[DRuG] member
DRuG server admin
 
Posts: 197
Joined: Thu Oct 07, 2010 8:42 am
Location: The Netherlands


Re: Handling.lua

Postby [DRuG]NikT on Mon Jan 23, 2012 6:57 pm

Awesome dude!

Definitely be using this one.. means lots of work for me though 8)

Hey, you know what's a real shame??

PotholeStudios is run by my #1 fan... one of the few people on this planet I genuinely dislike.

His name shall not be mentioned.

:evilgrin:


"But my head's all messed up, so you better driive brother"
User avatar

[DRuG]NikT
[DRuG] cofounder & your host

Status:
Check out the downloads and members areas on drugcrew.com

[DRuG] cofounder & your host
[DRuG] coleader
[DRuG] member
DRuG server admin
[AGS] member
]DR[ member
 
Posts: 2532
Joined: Sat Jul 28, 2007 10:39 am
Location: Melbourne, Victoria, Australia


Re: Handling.lua

Postby [DRuG]Stijger on Mon Jan 23, 2012 7:35 pm

#1 Fan ehh :D Well we will not mention it further then. ;)

But would be more then willing to help offcourse.
Just figured you would be interested in the script.
But let me know when i can help.
User avatar

[DRuG]Stijger
[DRuG] member

Status:
Good Luck Veccie

[DRuG] member
DRuG server admin
 
Posts: 197
Joined: Thu Oct 07, 2010 8:42 am
Location: The Netherlands



Return to Miscellaneous

Who is online

Users browsing this forum: No registered users and 2 guests

cron