IMG

 
IMG
IMG   IMG
  Welcome to GTAForums! Be sure to check out the Grand Theft Auto V Forum.

You are not registered! (If you are, click here to login) Registering is fast, free and easy and allows you to instantly reply to any topic on GTAForums.
Why wait? Click here to register your own unique username and become part of the ever-growing community!


( Log In | Register | Revalidate Validation E-mail )
Quick Log-In:
  IMG
       
>
Forum Rules GTA Modification Forums

Please post mod releases in the Mod Showroom

GTAGarage.com
free mod hosting from GTANet, simply login with your GTAForums account details

GTAModding.com
GTANet's modding wiki

GTA Modding Chatroom
provided by irc.gtanet.com (Don't have an IRC client? Click here)


  Reply to this topicStart new topicStart Poll

 Changing Car Handling

 script?
 
Glenstorm  
Posted: Monday, Oct 19 2009, 08:08
Quote Post


Strive to be different
Group Icon
Group: Members
Joined: Sep 19, 2009

XXXXX



Hi.

I would like to change the handling of a particular car temporarily, how do I do it?

For example, I want to code in such that the car I'm currently in is very light (low mass). How do I code it?

Please reply. This is the only factor left for me to complete a great mod im working on.

Cheers

Glenstorm
PMMSN
  Top
 

 
ZAZ  
Posted: Monday, Oct 19 2009, 15:28
Quote Post


Kernlochbohrer
Group Icon
Group: Members
Joined: Jan 10, 2005

eu.gif

Member Award




look here: click
Users WebsitePM
  Top
 

 
Glenstorm  
Posted: Tuesday, Oct 20 2009, 14:01
Quote Post


Strive to be different
Group Icon
Group: Members
Joined: Sep 19, 2009

XXXXX



I don't get it. How do I know what to look for editing the mass of a car?
PMMSN
  Top
 

 
ZAZ  
Posted: Tuesday, Oct 20 2009, 15:19
Quote Post


Kernlochbohrer
Group Icon
Group: Members
Joined: Jan 10, 2005

eu.gif

Member Award




QUOTE (Glenstorm @ Oct 20 2009, 14:01)
I don't get it. How do I know what to look for editing the mass of a car?

I don't know.
I got a script which manipulates the handling of cheetah, don't know which handling part
I have tested and recognized a better handling then the original one
The script is made by Kotton, Big, ATP and Mindf*ck
Kottons_Chop_Shop

It modifies memadresses and works only if the car is created as new
get a cheetah, press M and choose Turing mode
CODE
{$CLEO}

0000:

:TINO_2
while true
wait 100
if
Player.Defined($PLAYER_CHAR)
then
if
00DD: actor $PLAYER_ACTOR driving_car_with_model #CHEETAH
then
if
0AB0: key_pressed 77//-key = M
then
break
end
end
end
end
03C0: 0@ = actor $PLAYER_ACTOR car
0247: load_model 415
038B: load_requested_models
gosub @Read
20@ -= @Text0
gosub @Create

:TINO_3
wait 150
if
00DD: actor $PLAYER_ACTOR driving_car_with_model #CHEETAH
004D: jump_if_false @TINO_8
if and
0248: model 415 available
0AB0: key_pressed 77
004D: jump_if_false @TINO_3
03F3: get_car 0@ primary_color_to 24@ secondary_color_to 25@
051E: 11@ = get_current_radio_station
0085: 12@ = 11@
02E3: 26@ = car 0@ speed
0013: 26@ *= 1.2
0174: 19@ = car 0@ z_angle
1@ = 0xC2B9DC
1@ += 3360 //224x15
1@ += 0xBC
0A8D: 2@ = read_memory 1@ size 4 virtual_protect 0
0A8C: write_memory 1@ size 4 value -0.16 virtual_protect 0

3@ = 0xC2B9DC
3@ += 3360 //224x15
3@ += 0xA4
0A8D: 4@ = read_memory 3@ size 4 virtual_protect 0
0A8C: write_memory 3@ size 4 value 1.00 virtual_protect 0

5@ = 0xC2B9DC
5@ += 3360 //224x15
5@ += 0x10
0A8D: 6@ = read_memory 5@ size 4 virtual_protect 0
0A8C: write_memory 5@ size 4 value 1.1 virtual_protect 0

7@ = 0xC2B9DC
7@ += 3360 //224x15
7@ += 0xB0
0A8D: 8@ = read_memory 7@ size 4 virtual_protect 0
0A8C: write_memory 7@ size 4 value 0.16 virtual_protect 0

9@ = 0xC2B9DC
9@ += 3360 //224x15
9@ += 0x1C
0A8D: 10@ = read_memory 9@ size 4 virtual_protect 0
0A8C: write_memory 9@ size 4 value -0.40 virtual_protect 0

0792: disembark_instantly_actor $PLAYER_ACTOR
0407: create_coordinate 15@ 16@ 17@ from_car 0@ offset 0.0 0.0 0.0
00A6: destroy_car 0@
00A5: 0@ = create_car 415 at 15@ 16@ 17@
0175: set_car 0@ z_angle_to 19@
036A: put_actor $PLAYER_ACTOR in_car 0@
04BA: set_car 0@ speed_to 26@
0229: set_car 0@ primary_color_to 24@ secondary_color_to 25@
041E: set_radio_station 12@
0249: release_model 415
01C3: remove_references_to_car 0@
03E6: remove_text_box
gosub @Read
20@ -= @Text1
gosub @Create

:TINO_4
wait 150
if
00DD: actor $PLAYER_ACTOR driving_car_with_model #CHEETAH
004D: jump_if_false @TINO_8
if and
0248: model 415 available
0AB0: key_pressed 77
004D: jump_if_false @TINO_4
03F3: get_car 0@ primary_color_to 24@ secondary_color_to 25@
051E: 11@ = get_current_radio_station
0085: 12@ = 11@
02E3: 26@ = car 0@ speed
0013: 26@ *= 1.2
0174: 19@ = car 0@ z_angle
0A8C: write_memory 1@ size 4 value -0.10 virtual_protect 0
0A8C: write_memory 3@ size 4 value 0.90 virtual_protect 0
0A8C: write_memory 5@ size 4 value 0.9 virtual_protect 0
0A8C: write_memory 7@ size 4 value 0.12 virtual_protect 0
0A8C: write_memory 9@ size 4 value -0.44 virtual_protect 0

0792: disembark_instantly_actor $PLAYER_ACTOR
0407: create_coordinate 15@ 16@ 17@ from_car 0@ offset 0.0 0.0 0.0
00A6: destroy_car 0@
00A5: 0@ = create_car 415 at 15@ 16@ 17@
0175: set_car 0@ z_angle_to 19@
036A: put_actor $PLAYER_ACTOR in_car 0@
04BA: set_car 0@ speed_to 26@
0229: set_car 0@ primary_color_to 24@ secondary_color_to 25@
041E: set_radio_station 12@
0249: release_model 415
01C3: remove_references_to_car 0@
03E6: remove_text_box
gosub @Read
20@ -= @Text2
gosub @Create

:TINO_5
wait 150
if
00DD: actor $PLAYER_ACTOR driving_car_with_model #CHEETAH
004D: jump_if_false @TINO_8
if and
0248: model 415 available
0AB0: key_pressed 77
004D: jump_if_false @TINO_5
03F3: get_car 0@ primary_color_to 24@ secondary_color_to 25@
051E: 11@ = get_current_radio_station
0085: 12@ = 11@
02E3: 26@ = car 0@ speed
0013: 26@ *= 1.2
0174: 19@ = car 0@ z_angle
0A8C: write_memory 1@ size 4 value -0.05 virtual_protect 0
0A8C: write_memory 3@ size 4 value 0.85 virtual_protect 0
0A8C: write_memory 5@ size 4 value 0.8 virtual_protect 0
0A8C: write_memory 7@ size 4 value 0.08 virtual_protect 0
0A8C: write_memory 9@ size 4 value -0.48 virtual_protect 0

0792: disembark_instantly_actor $PLAYER_ACTOR
0407: create_coordinate 15@ 16@ 17@ from_car 0@ offset 0.0 0.0 0.0
00A6: destroy_car 0@
00A5: 0@ = create_car 415 at 15@ 16@ 17@
0175: set_car 0@ z_angle_to 19@
036A: put_actor $PLAYER_ACTOR in_car 0@
04BA: set_car 0@ speed_to 26@
0229: set_car 0@ primary_color_to 24@ secondary_color_to 25@
041E: set_radio_station 12@
0249: release_model 415
01C3: remove_references_to_car 0@
03E6: remove_text_box
gosub @Read
20@ -= @Text3
gosub @Create

:TINO_6
wait 150
if
00DD: actor $PLAYER_ACTOR driving_car_with_model #CHEETAH
004D: jump_if_false @TINO_8
if and
0248: model 415 available
0AB0: key_pressed 77
004D: jump_if_false @TINO_6
03F3: get_car 0@ primary_color_to 24@ secondary_color_to 25@
051E: 11@ = get_current_radio_station
0085: 12@ = 11@
02E3: 26@ = car 0@ speed
0013: 26@ *= 1.2
0174: 19@ = car 0@ z_angle
0A8C: write_memory 1@ size 4 value -0.02 virtual_protect 0
0A8C: write_memory 3@ size 4 value 0.80 virtual_protect 0
0A8C: write_memory 5@ size 4 value 0.7 virtual_protect 0
0A8C: write_memory 7@ size 4 value 0.04 virtual_protect 0
0A8C: write_memory 9@ size 4 value -0.52 virtual_protect 0

0792: disembark_instantly_actor $PLAYER_ACTOR
0407: create_coordinate 15@ 16@ 17@ from_car 0@ offset 0.0 0.0 0.0
00A6: destroy_car 0@
00A5: 0@ = create_car 415 at 15@ 16@ 17@
0175: set_car 0@ z_angle_to 19@
036A: put_actor $PLAYER_ACTOR in_car 0@
04BA: set_car 0@ speed_to 26@
0229: set_car 0@ primary_color_to 24@ secondary_color_to 25@
041E: set_radio_station 12@
0249: release_model 415
01C3: remove_references_to_car 0@
03E6: remove_text_box
gosub @Read
20@ -= @Text4
gosub @Create

:TINO_7
wait 150
if or
0AB0: key_pressed 77
80DD: NOT actor $PLAYER_ACTOR driving_car_with_model #CHEETAH
004D: jump_if_false @TINO_7

:TINO_8
01C3: remove_references_to_car 0@
gosub @Read
20@ -= @Text
gosub @Create

:TINO_9
0002: jump @TINO_2

:Read
0A9F: 20@ = current_thread_pointer
20@ += 0x10
0A8D: 20@ = read_memory 20@ size 4 virtual_protect 0
return

:Create
if
0AA9: is_game_version_original
then
0AA5: call 0x588BE0 num_params 4 pop 4 0 0 0 20@
else
0AA5: call 0x5893B0 num_params 4 pop 4 0 0 0 20@
end
return

:Text0
hex
"Manettino:_ Active" 00
end

:Text
hex
"Manettino:_ Deactivated" 00
end

:Text1
hex
"Suspension:_ Touring" 00
end

:Text2
hex
"Suspension:_ Sport" 00
end

:Text3
hex
"Suspension:_ Novitec" 00
end

:Text4
hex
"Suspension:_ Racing" 00
end

:Text5
hex
"Script_by_Kotton" 00
end

Users WebsitePM
  Top
 

 
Deji  
Posted: Tuesday, Oct 20 2009, 23:33
Quote Post


Coding like a Rockstar!
Group Icon
Group: Members
Joined: Dec 24, 2007

ja.gif

XXXXX



Memory is pretty simple when you get used to it.

First get the car pointer (there's an opcode for that, search "car pointer").

I think then you do 0xB6F980 + your cars pointer.

Then + a number that can be found in this list: http://www.gtamodding.com/index.php?title=...esses_(SA)#Cars

Then you can use that variable to set the memory address with write_address.
Users WebsitePM
  Top
 

 
ZAZ  
Posted: Wednesday, Oct 21 2009, 20:45
Quote Post


Kernlochbohrer
Group Icon
Group: Members
Joined: Jan 10, 2005

eu.gif

Member Award




QUOTE (Deji @ Oct 20 2009, 23:33)
Memory is pretty simple when you get used to it.

First get the car pointer (there's an opcode for that, search "car pointer").

I think then you do 0xB6F980 + your cars pointer.

Then + a number that can be found in this list: http://www.gtamodding.com/index.php?title=...esses_(SA)#Cars

Then you can use that variable to set the memory address with write_address.

Thanks Deji, I never spend effort to find it out

CODE
Handling

0xC2B9DC - Handling Block Start. 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


In addition I got answers from Kotton
QUOTE (Kotton@)
QUOTE


1@ = 0xC2B9DC
1@ += 3360 //224x15
1@ += 0xBC
0A8D: 2@ = read_memory 1@ size 4 virtual_protect 0
0A8C: write_memory 1@ size 4 value -0.16 virtual_protect 0

as you can see, 0xC2B9DC is the beginning of the handling block-
each slot is 224 bytes (1 slot per vehicle) ..so being that the
cheetah is the 15th vehicle in the handling.cfg (LANDSTAL being #0)
-we get 224x15 = 3360

then we refer to what exact address we want to modify,
+0xBC= Suspension lower limit

so after reading that specific address, we write the new value

easy eh? lol

so again looking at the script, you can see that we've modified
the following with each keypress..

+0xBC= Suspension lower limit
+0xA4 = fTractionLoss
+0x10 = fDragMult
+0xB0 = fSuspensionDampingLevel
+0x1C = CentreOfMass.z

______________________________________________

if I wanted to modify the drag I would access 0x10

1@ = 0xC2B9DC
1@ += 3360 //224x15 (cheetah)
1@ += 0x10 //fdrag multiplier
0A8D: 2@ = read_memory 1@ size 4 virtual_protect 0
0A8C: write_memory 1@ size 4 value 2.5 virtual_protect 0 //2.5 would be the new value


Ok, now the praxis
I want to make cheetah much more faster but keeps stable
It's possible if I change 3 parameter of cheetahs original handling.cfg line
Topspeed to 850.0, Acceleration to 50.0 and Drag to 1.0
CODE
HANDLING.CFG

change fDragMult to 1.0 and  transmission to 850.0 50.0 (fMaxVelocity/fEngineAcceleration)

name       mass     turnmass  drag   centreofmass  boy traction           transmission

orig.
CHEETAH      1200.0    3000.0   2.0    0.0 -0.2 -0.2  70 0.80 0.9  0.50   5 230.0 30.0




mod.
CHEETAH      1200.0    3000.0   1.0    0.0 -0.2 -0.2  70 0.80 0.9  0.50   5 850.0 50.0


I tried it with the memory codes but any manipulation of accelaeration let the cheetah slide like a soap
Drag seems to work but can not prevent the sliding
speed was possible to increase but caused crashs by driving very fast, by any bump: freeze

the script below: go in groovestreet into red marker to get cheetah and manipulate handling memory

CODE
{$CLEO .cs}
:Handlg_1
03A4: name_thread 'Handlg'

:Handlg_2
0001: wait  0 ms
00D6: if  0
0256:   player $PLAYER_CHAR defined
004D: jump_if_false @Handlg_2
00D6: if  0
00FF:   actor $PLAYER_ACTOR  1 (in-sphere)near_point_on_foot 2491.5  -1667.5  13.35 radius  1.0  1.0  1.0
004D: jump_if_false @Handlg_2
0247: request_model #CHEETAH

:Handlg_3
0001: wait  0 ms
00D6: if  0
0248:   model #CHEETAH available
004D: jump_if_false @Handlg_3
00A5: 0@ = create_car #CHEETAH at 2487.5  -1660.5  13.35
0175: set_car 0@ z_angle_to 90.0

1@ = 0xC2B9DC
1@ += 3360 //224x15 (cheetah)
1@ += 0x84 //TransmissionData.fMaxVelocity
0A8D: 2@ = read_memory 1@ size 4 virtual_protect 0
0A8C: write_memory 1@ size 4 value 2.5 virtual_protect 0 //2.5 would be the new value

//3@ = 0xC2B9DC
//3@ += 3360 //224x15 (cheetah)
//3@ += 0x7C //TransmissionData.fEngineAcceleration
//0A8D: 4@ = read_memory 3@ size 4 virtual_protect 0
//0A8C: write_memory 3@ size 4 value 0.1 virtual_protect 0 //2.5 would be the new value

5@ = 0xC2B9DC
5@ += 3360 //224x15
5@ += 0x10//fDragMult multiplier
0A8D: 6@ = read_memory 5@ size 4 virtual_protect 0
0A8C: write_memory 5@ size 4 value 0.1 virtual_protect 0

0249: release_model #CHEETAH
0001: wait  1000 ms
0013: 2@ *=  100.0  // floating-point values
0013: 4@ *=  100.0  // floating-point values
0013: 6@ *=  100.0  // floating-point values
0092: 11@ = float_to_integer 2@  
0092: 12@ = float_to_integer 4@  
0092: 13@ = float_to_integer 6@

:Handlg_4
0001: wait  0 ms
00D6: if  0
0256:   player $PLAYER_CHAR defined
004D: jump_if_false @Handlg_4
03F0: enable_text_draw 1
045A: text_draw_1number  50.0  42.0 'NUMBER' 11@    // value
045A: text_draw_1number  200.0  45.0 'NUMBER' 12@    // value
045A: text_draw_1number  350.0  45.0 'NUMBER' 13@    // value
00D6: if  0
80FF:   NOT   actor $PLAYER_ACTOR  0 ()near_point_on_foot 2491.5  -1667.5  13.35 radius  2.0  2.0  2.0
004D: jump_if_false @Handlg_4
01C3: remove_references_to_car 0@  // Like turning a car into any random car
03F0: enable_text_draw 0
0002: jump @Handlg_2


i tried first 850.0 and 50.0 but cheetah was sliding a lot
itried 350.0 a d 35.0 and i tried hexcode and tried 35.0 and 5.0
cheetah was allways sliding
look for the textmessages
it shows the real value of the memadress
At the first going into read marker and keep standing there it shows the original handling memvalues
by the next going into red marker it shows the new values of the memadress
it was neccesary to multiplicate the values with 100 to show floats
(exemple: if the value would be 0.53 it will be displayed as 53)
the original value of velocitymemadress of cheetah is allways 1.04 and displayed as 104
the original value of drag of cheetah is allways 2.0 and displayed as 200
the original value of acceleration can't remember, i believe ciro
with 2.5 as write_memory of velocity can i drive 250.0
with 0.01 as write_memory of fEngineAcceleration can i drive also 250.0 and accelerate normal
I believe, this is not acceleration: 0x7C = TransmissionData.fEngineAcceleration
furthermore i'm wondering what (Multiplied by 5.5555599e-3) means
* +0x7C = TransmissionData.fEngineAcceleration (Multiplied by 3.9999999e-4)
* +0x80 = TransmissionData.fEngineInertia
* +0x84 = TransmissionData.fMaxVelocity (Multiplied by 5.5555599e-3)



This post has been edited by ZAZ on Thursday, Oct 22 2009, 15:33
Users WebsitePM
  Top
 

 
Glenstorm  
Posted: Monday, Oct 26 2009, 01:48
Quote Post


Strive to be different
Group Icon
Group: Members
Joined: Sep 19, 2009

XXXXX



What if I need to change the handling of the car I'm currently in? meaning, it can be anything, not just Cheetah.
PMMSN
  Top
 

 
Wesser  
Posted: Monday, Oct 26 2009, 13:54
Quote Post


The complexity simplifier, the efficiency optimizer
Group Icon
Group: Members
Joined: Aug 19, 2006

eu.gif

Member Award




Is this more clear and easier than kotton's script?

0xC2B9DC : Base Memory Address
+ 0xE0 : Block Size (for each vehicle defined in vehicles.dat)

+ 0x.. : Related things

There are 212 vehicles ID which start from 400. To get our vehicle number (400 = 0, 401 = 1, ...), we have to do this (untested).
CODE
0xE0 * ModelID-400 + 0x..

0@ = 415 // vehicle ID (cheetah)
0@ -= 400 // vehicle ID - first vehicle ID = vehicle number
0@ *= 0xE0 // vehicle number * bytes for each slot = vehicle block
0@ += 0xC2B9DC // vehicle block + handling block = vehicle handling block
0@ += 0x.. // vehicle handling block + some things
0A8D: 1@ = read_memory 0@ size 4 virtual_protect 0
PMMSNPlayStation Network
  Top
 

 
Revolution-Designes  
Posted: Monday, Oct 26 2009, 16:26
Quote Post


AKA JopperX9
Group Icon
Group: Members
Joined: Dec 28, 2008

eu.gif

Member Award




I'm currently creating a CLEO3 mod and want to increase the acceleration of the car i'm currently driving in. I gave the vehicle i'm currently driving the variable 1@. And i also found this memory adress on the internet:
CODE
+0x7C = TransmissionData.fEngineAcceleration (Multiplied by 3.9999999e-4)

But how can i put it into my script? Can i just use one code and add the memory adress to increase the acceleration or something else? confused.gif
I've never done this before so it's a little difficult for me... blush.gif

Grtz RD
Users WebsitePMMSN
  Top
 

 
Wesser  
Posted: Monday, Oct 26 2009, 18:11
Quote Post


The complexity simplifier, the efficiency optimizer
Group Icon
Group: Members
Joined: Aug 19, 2006

eu.gif

Member Award




Here it is what you need.
CODE

{$CLEO}

0000: NOP

while true
 wait 0
 if
 00DF:  actor $PLAYER_ACTOR driving
 then
   03C0: 1@ = actor $PLAYER_ACTOR car
   0441: 0@ = car 1@ model
   000E: 0@ -= 400
   0012: 0@ *= 0xE0
   000A: 0@ += 0xC2B9DC
   000A: 0@ += 0x7C
   0A8C: write_memory 0@ size 4 value 0.1 virtual_protect 0
 end
end

EDIT: I suppose it doesn't work since it can do it only for vehicles created as new, like ZAZ said. So ZAZ, what do you mean with this? Does it work only for created cars by .scm?

EDIT 2: I tried and it works with all vehicles too.

This post has been edited by Wesser on Monday, Oct 26 2009, 19:45
PMMSNPlayStation Network
  Top
 

 
Revolution-Designes  
Posted: Monday, Oct 26 2009, 18:36
Quote Post


AKA JopperX9
Group Icon
Group: Members
Joined: Dec 28, 2008

eu.gif

Member Award




QUOTE (Wesser @ Oct 26 2009, 18:11)
Here it is what you need.
CODE

{$CLEO}

0000: NOP

while true
 wait 0
 if
 00DF:  actor $PLAYER_ACTOR driving
 then
   03C0: 1@ = actor $PLAYER_ACTOR car
   0441: 0@ = car 1@ model
   000E: 0@ -= 400
   0012: 0@ *= 0xE0
   000A: 0@ += 0xC2B9DC
   000A: 0@ += 0x7C
   0A8C: write_memory 0@ size 4 value 0.1 virtual_protect 0
 end
end

I suppose it doesn't work since it can do it only for vehicles created as new, like ZAZ said. So ZAZ, what do you mean with this? Does it work only for created cars by .scm?

Don't i have to add a value to the code? Like 10 or 20. So the car will accelerate with 10 or 20 km/h more?
Users WebsitePMMSN
  Top
 

 
Wesser  
Posted: Monday, Oct 26 2009, 19:44
Quote Post


The complexity simplifier, the efficiency optimizer
Group Icon
Group: Members
Joined: Aug 19, 2006

eu.gif

Member Award




It's weird but I can't get it to work with vehicles which have more than 16 as their ID. Anyone know why?
PMMSNPlayStation Network
  Top
 

 
ZAZ  
Posted: Tuesday, Oct 27 2009, 21:31
Quote Post


Kernlochbohrer
Group Icon
Group: Members
Joined: Jan 10, 2005

eu.gif

Member Award




QUOTE (Wesser @ Oct 26 2009, 19:44)
It's weird but I can't get it to work with vehicles which have more than 16 as their ID. Anyone know why?

I confirm. I tried with taxi and had no effect.
Users WebsitePM
  Top
 

 
Wesser  
Posted: Friday, Nov 13 2009, 21:32
Quote Post


The complexity simplifier, the efficiency optimizer
Group Icon
Group: Members
Joined: Aug 19, 2006

eu.gif

Member Award




Finally, I found a way to solve that. Handling lines are read in groups which can be respectively divided into: cars -> bikes -> boats -> planes. Unfortunally, the lines aren't ordered like vehicles ID (handling.cfg - vehicles.ide).

Since we can't know what's the real line position, I wrote an external file where I put all positions per ID, picked from vehicles.ide.

Here is the code:
CODE

{$CLEO}

0000: NOP

4@ = 0

while true
 wait 0
 if
 00DF:  actor $PLAYER_ACTOR driving
 then
   03C0: 1@ = actor $PLAYER_ACTOR car
   0441: 0@ = car 1@ model
   gosub @ReadFromFile
   0@ -= 400
   0@ *= 0xE0
   0@ += 0xC2B9DC
   0@ += 0x7C
   0A8D: 2@ = read_memory 0@ size 4 virtual_protect 0
   0A8C: write_memory 0@ size 4 value 0.1 virtual_protect 0
   4@ = 1
   repeat
     wait 0
   until 80DF:  not actor $PLAYER_ACTOR driving
 else
   if
     4@ <> 0
   then
     0A8C: write_memory 0@ size 4 value 2@ virtual_protect 0
     4@ = 0
   end
 end
end

:ReadFromFile
0A99: chdir 0
if
0A9A: 1@ = openfile "./cleo/handlingId.dat" mode 0x6272
then
 for 2@ = 400 to 0@
   0A9D: readfile 1@ size 2 to 3@
 end
 0085: 0@ = 3@
 0A9B: closefile 1@
end
return

Before trying it, you need the file I was talking about downloadable from here. It's not 100% tested, so please report any bugs. wink.gif

I hope this should be useful. rolleyes.gif

This post has been edited by Wesser on Friday, Dec 11 2009, 20:19
PMMSNPlayStation Network
  Top
 

 
Wesser  
Posted: Monday, Jul 26 2010, 16:15
Quote Post


The complexity simplifier, the efficiency optimizer
Group Icon
Group: Members
Joined: Aug 19, 2006

eu.gif

Member Award




Sorry for bumping an old topic but it's necessary cause I've just found an alternative and simplest way:
CODE

{$CLEO}

0000: NOP

3@ = 0

while true
 wait 0
 if
 00DF:  actor $PLAYER_ACTOR driving
 then
   03C0: 0@ = actor $PLAYER_ACTOR car
   0AB1: @getVehHandlingOffset 1 from_car 0@ store_to 1@
   1@ += 0x7C
   0A8D: 2@ = read_memory 1@ size 4 virtual_protect 0
   0A8C: write_memory 1@ size 4 value 0.1 virtual_protect 0
   3@ = 1
   repeat
     wait 0
   until 80DF:  not actor $PLAYER_ACTOR driving
 else
   if
     3@ <> 0
   then
     0A8C: write_memory 1@ size 4 value 2@ virtual_protect 0
     3@ = 0
   end
 end
end

:getVehicleNum
{
 Parameters:
   Passed:
     0@ - vehicle handle
   Result:
     1@ - vehicle number

 Example:
   0AB1: @getVehicleNum 1 from_car 0@ store_to 1@
}
0441: 1@ = car 0@ model
1@ -= 400
0AB2: ret 1 1@

:getVehHandlingOffset
{
 Parameters:
   Passed:
     0@ - vehicle handle
   Result:
     3@ - vehicle handling offset

 Example:
   0AB1: @getVehHandlingOffset 1 from_car 0@ store_to 1@
}
0AB1: @getVehicleNum 1 from_car 0@ store_to 1@
0085: 2@ = 1@
2@ *= 0x308
2@ += 0xB1F650
2@ += 0x4E
0A8D: 3@ = read_memory 2@ size 2 virtual_protect 0 // get handling ID
3@ *= 0xE0
3@ += 0xC2B9DC
0AB2: ret 1 3@
PMMSNPlayStation Network
  Top
 

 
carljrbrass  
Posted: Friday, Mar 25 2011, 11:41
Quote Post


Player Hater
Group Icon
Group: Members
Joined: Mar 25, 2011

XXXXX



Hey guys, sorry for bringing this up after so long, but ive been a fan of ZAZ's is scripts since pimpmycar frst came out. that got me hooked to cleo scripting, but ive tried hard for a good 2 years but im still at a very beginner level. ive made a mod for the Hotring racer (hotrina) and its sorta a dragster mod, and i was wondering if ter was some way to edit that handling while i was in game.....and google led me here Shifty41s_beerhatsmilie2.gif

anyway's i tried my hand at that stuff but failed, the moment i started gta sa up the game would just crash after loading a savegame. so ive been overthese scripts for a while, but ive had no luck wat-so-ever suicidal.gif . ive also tried to make a mod that when a car shifts down a flame bursts out the eshuast...but ive done smtn wrong and the flame just stays there and after a few seconds starts lagging me like a b*tch rampage_ani.gif devil.gif

anyway's i was wondering if u guys could give me a few pointers or a little help. anyting would be fine colgate.gif thanx for just takin a look at this too alien.gif

in short im just tryin to get the hotring to load a diffrent handling in game, like type 'DRAG' and it changes xD

Thanx in advance!

PM
  Top
 

 
carljrbrass  
Posted: Friday, Mar 25 2011, 11:44
Quote Post


Player Hater
Group Icon
Group: Members
Joined: Mar 25, 2011

XXXXX



O, and i frgt...if i have to download another file or smtn like that it would be no problem at all. this mod isnt like, public. its just for me and a few buddies and whoeverelse wants it xD
PM
  Top
 

 
ZAZ  
Posted: Friday, Mar 25 2011, 16:14
Quote Post


Kernlochbohrer
Group Icon
Group: Members
Joined: Jan 10, 2005

eu.gif

Member Award




QUOTE (carljrbrass @ Mar 25 2011, 11:44)
O, and i frgt...if i have to download another file or smtn like that it would be no problem at all. this mod isnt like, public. its just for me and a few buddies and whoeverelse wants it xD

There are script examples in this topic, so you can do it yourself.
I wrote a report of my tests, you should read it.

If you don't understand it, her's the fazit:
There are problems

problem1
it was not possible for every car but Wesser found a way to fix it and showed the method in his last script which he posted at Jul 26 2010

problem2
the game becomes unstablty if you increase the acceleration

problem3
it don't makes fun to write a hanglingmodscript because of problem2



This post has been edited by ZAZ on Friday, Mar 25 2011, 16:18
Users WebsitePM
  Top
 

 
carljrbrass  
Posted: Saturday, Mar 26 2011, 15:02
Quote Post


Player Hater
Group Icon
Group: Members
Joined: Mar 25, 2011

XXXXX



Thanx for the reply and advice, ive tried it using wesser's methood agn after reading the previous post, but still the same result, i can get it to read, but it only reads vehicle mass and top speed, i think, not shure, but think..it also is reading engine inertia...it seems like that a bit but im not shure. but if i raise the top speed just a tiny bit the game crashes when the car changes gears at a high speed, it does like a small bump like *\ and come back down - and then it goes half way up and the game freezez for a little while and then crashes. so right now im just experamenting with things but i hope i can make it work. if i increase the acceleration of any car by +6 it crashes. ive tested on the infernus hotringracer and nrg...yea...nrg crashed when i accelerated lol so it was a fail. right now im trying to see if its crashing be cause of something else or cause of the speed bieng +6...cause +6 isnt really much sad.gif. anyways thanx for the help really appriceate it. and btw ive got a little progress of the gear shift flame, i had the timer wrong xD
PM
  Top
 

 

1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)

0 Members:

Topic Options Reply to this topicStart new topicStart Poll
Search topic for posted by (exact match)



 
IMG IMG