Offset for change vehicle handling?

0xNull

Member
Joined
Jul 14, 2018
Messages
24
Reaction score
0
Hello! I'm trying to change at least one of the characteristics of the car. 

I found this offset:

0xC2B9DC - The beginning of the Handling block. Each slot has 224 bytes of data.
  • +0x0 = [dword] Index / Identifier
  • +0x4 = fMass
  • +0x8 = 1.0 / fMass
  • +0xC = fTurnMass
  • +0x10 = fDragMult
  • +0x14 = CentreOfMass.x
  • +0x18 = CentreOfMass.y
  • +0x1C = CentreOfMass.z
  • +0x20 = [byte] nPercentSubmerged
  • +0x24 = fMass * 8.0000001e-1 / nPercentSubmerged
  • +0x28 = fTractionMultiplier
  • +0x74 = [byte] TransmissionData.nDriveType
  • +0x75 = [byte] TransmissionData.nEngineType
  • +0x76 = [byte] TransmissionData.nNumberOfGears
  • +0x7C = TransmissionData.fEngineAcceleration (Multiplied by 3.9999999e-4)
  • +0x80 = TransmissionData.fEngineInertia
  • +0x84 = TransmissionData.fMaxVelocity (Multiplied by 5.5555599e-3)
  • +0x94 = fBrakeDeceleration (Multiplied by 3.9999999e-4)
  • +0x98 = fBrakeBias
  • +0x9C = [byte] bABS
  • +0xA0 = fSteeringLock
  • +0xA4 = fTractionLoss
  • +0xA8 = fTractionBias
  • +0xAC = fSuspensionForceLevel
  • +0xB0 = fSuspensionDampingLevel
  • +0xB4 = fSuspensionHighSpdComDamp
  • +0xB8 = Suspension upper limit
  • +0xBC= Suspension lower limit
  • +0xC0 = Suspension bias between front and rear
  • +0xC4 = Suspension anti-dive multiplier
  • +0xC8 = fCollisionDamageMultiplier (multiplier not yet found)
  • +0xCC = [hex] modelFlags
  • +0xD0 = [hex] handlingFlags
  • +0xD4 = fSeatOffsetDistance
  • +0xD8 = [dword] nMonetaryValue
  • +0xDC = [byte] Front lights
  • +0xDD = [byte] Rear lights
  • +0xDE = [byte] Vehicle anim group
but when I try to call a pointer 0xC2B9DC in a cheat engine, and then add 0x14 to it, it does not find anything


Please, help me  :-/
 

luxdav

Active member
Joined
Sep 17, 2014
Messages
45
Reaction score
5
heres one example for the mass
 

Attachments

  • mass.PNG
    mass.PNG
    6.3 KB · Views: 60

0xNull

Member
Joined
Jul 14, 2018
Messages
24
Reaction score
0
luxdav said:
heres one example for the mass

Wow! Really working. Sorry, but where you get this addresses? (8C and BA18FC)


0xNull said:
luxdav said:
heres one example for the mass

Wow! Really working. Sorry, but where you get this addresses? (8C and BA18FC)

Ohh... This only works for the mass of the car. Can I somehow change, for example, the angle of rotation of the wheels? Or change the drive from the rear to the front
 
Joined
Dec 31, 2015
Messages
712
Reaction score
27
0xNull said:
0xC2B9DC - The beginning of the Handling block

jiGSb02.png


Should be easy enough to understand what I mean

Also you should also understand that every car ingame has its own ID and in case you want to change the property of any desired car you have to do the following math :

0xE0 * ID + 0xC2B9DC
 

luxdav

Active member
Joined
Sep 17, 2014
Messages
45
Reaction score
5
I used this https://github.com/thereals0beit/m0d-s0beit-sa/blob/91cd572e728dfdbf854dfa30072bbc81ca54aaa1/src/cheat.h#L558 and calculated all the adresses


I'd rather use the pointer to the car im sitting in, due to the fact that I dont care about the handling of cars im not driving


Okay, 0xC2B9DC contains the handling of all the model ids!
 

0xNull

Member
Joined
Jul 14, 2018
Messages
24
Reaction score
0
supahdupahnubah said:
0xNull said:
0xC2B9DC - The beginning of the Handling block

jiGSb02.png


Should be easy enough to understand what I mean

Also you should also understand that every car ingame has its own ID and in case you want to change the property of any desired car you have to do the following math :

0xE0 * ID + 0xC2B9DC

Hmm ... Somehow it does not work. I tried this:

           //elegy model ID
0xE0 * 562 + 0xC2B9DC + 4

And it gave out just 0. Why? :c
 
Joined
Dec 31, 2015
Messages
712
Reaction score
27
0xNull said:
supahdupahnubah said:
0xNull said:
0xC2B9DC - The beginning of the Handling block

jiGSb02.png


Should be easy enough to understand what I mean

Also you should also understand that every car ingame has its own ID and in case you want to change the property of any desired car you have to do the following math :

0xE0 * ID + 0xC2B9DC

Hmm ... Somehow it does not work. I tried this:

           //elegy model ID
0xE0 * 562 + 0xC2B9DC + 4

And it gave out just 0. Why? :c

If you tried this math inside the cheat engine then the reason why it couldn't possibly work is that it takes only hexadecimal numbers, that means you have to convert 562 to hex
 

0xNull

Member
Joined
Jul 14, 2018
Messages
24
Reaction score
0
supahdupahnubah said:
0xNull said:
supahdupahnubah said:
0xNull said:
0xC2B9DC - The beginning of the Handling block

jiGSb02.png


Should be easy enough to understand what I mean

Also you should also understand that every car ingame has its own ID and in case you want to change the property of any desired car you have to do the following math :

0xE0 * ID + 0xC2B9DC

Hmm ... Somehow it does not work. I tried this:

           //elegy model ID
0xE0 * 562 + 0xC2B9DC + 4

And it gave out just 0. Why? :c

If you tried this math inside the cheat engine then the reason why it couldn't possibly work is that it takes only hexadecimal numbers, that means you have to convert 562 to hex


Okay, I found in Google that 562 is 0x232. Now I try this:

0xE0*0x232+0xC2B9DC+0x4

And got this:


Capture.png



Why?
sorry for my stupidity)
 
Joined
Dec 31, 2015
Messages
712
Reaction score
27
0xNull said:
Hmm ... Somehow it does not work. I tried this:

           //elegy model ID
0xE0 * 562 + 0xC2B9DC + 4

And it gave out just 0. Why? :c

Not your fault, I kinda misinformed you
You should substract 400 from Model ID to get handling.cfg ID, also that may not work for 100% but as example here's the way of changing Infernus mass

0xE0*0xB+0xC2B9DC+0x4
0xB here is 0x232 - 0x190, so I guess the final template is ([Hexadecimal MODEL ID]-0x190)*0xE0+0xC2B9DC+0x4
 

0xNull

Member
Joined
Jul 14, 2018
Messages
24
Reaction score
0
supahdupahnubah said:
0xNull said:
Hmm ... Somehow it does not work. I tried this:

           //elegy model ID
0xE0 * 562 + 0xC2B9DC + 4

And it gave out just 0. Why? :c

Not your fault, I kinda misinformed you
You should substract 400 from Model ID to get handling.cfg ID, also that may not work for 100% but as example here's the way of changing Infernus mass

0xE0*0xB+0xC2B9DC+0x4
0xB here is 0x232 - 0x190, so I guess the final template is ([Hexadecimal MODEL ID]-0x190)*0xE0+0xC2B9DC+0x4

Thank you! It Really working!
 

luxdav

Active member
Joined
Sep 17, 2014
Messages
45
Reaction score
5
0xNull said:
supahdupahnubah said:
0xNull said:
Hmm ... Somehow it does not work. I tried this:

           //elegy model ID
0xE0 * 562 + 0xC2B9DC + 4

And it gave out just 0. Why? :c

Not your fault, I kinda misinformed you
You should substract 400 from Model ID to get handling.cfg ID, also that may not work for 100% but as example here's the way of changing Infernus mass

0xE0*0xB+0xC2B9DC+0x4
0xB here is 0x232 - 0x190, so I guess the final template is ([Hexadecimal MODEL ID]-0x190)*0xE0+0xC2B9DC+0x4

Thank you! It Really working!

The ids are not the model ids but in the order of the handling cfg i think


Here are the IDs

https://s3.eu-central-1.amazonaws.com/sampdev/handling.html
 
Top