nyolc8 Posted February 20, 2015 Share Posted February 20, 2015 Hi all, I wondering if it's possible to set handling for a specific car model, BUT not for spawned existing vehicle. Is it possible? I know for spawned vehicles, it's possible. Just want to change it before vehicles spawn (so I want to set modified handling at game start) What is the pointer for a specific car model? I just need that. Link to comment Share on other sites More sharing options...
ZAZ Posted February 22, 2015 Share Posted February 22, 2015 read this topic please: click it was always only possible to change handling by script before spawning the car, not for an already available car it was possible to maipulate handling for a part of the car models, for a big part of the car models we had problems, don't know if Wesser found a fix handling manipulation is a hard work, game crashes and don't makes fun CLEO MODS CLEO Script Tutorial Link to comment Share on other sites More sharing options...
nyolc8 Posted February 22, 2015 Author Share Posted February 22, 2015 I wanted to clear the swinging chassis handling flag. I managed to change the double exhaust modelflag (bit) on the fly and it changes instantly. Both setting it and clearing it works without problem on the fly. But this(exhaust) is the only flag I managed to change. No other got changed even when it's value got modified. I don't really get it why only the exhaust flag applies and others not. Link to comment Share on other sites More sharing options...
Shmoopy Posted February 25, 2015 Share Posted February 25, 2015 (edited) From handling.cfg:CODE; (af) modelFlags!!! WARNING - Now written HEX for easier reading of flags;; 1st digit 1: IS_VAN 2: IS_BUS 4: IS_LOW 8: IS_BIG; 2nd digit 1: REVERSE_BONNET 2: HANGING_BOOT 4: TAILGATE_BOOT 8: NOSWING_BOOT; 3rd digit 1: NO_DOORS 2: TANDEM_SEATS 4: SIT_IN_BOAT 8: CONVERTIBLE; 4th digit 1: NO_EXHAUST 2: DOUBLE_EXHAUST 4: NO1FPS_LOOK_BEHIND 8: FORCE_DOOR_CHECK; 5th digit 1: AXLE_F_NOTILT 2: AXLE_F_SOLID 4: AXLE_F_MCPHERSON 8: AXLE_F_REVERSE; 6th digit 1: AXLE_R_NOTILT 2: AXLE_R_SOLID 4: AXLE_R_MCPHERSON 8: AXLE_R_REVERSE; 7th digit 1: IS_BIKE 2: IS_HELI 4: IS_PLANE 8: IS_BOAT; 8th digit 1: BOUNCE_PANELS 2: DOUBLE_RWHEELS 4: FORCE_GROUND_CLEARANCE 8: IS_HATCHBACK;; (ag) handlingFlags - written in HEX;; 1st digit 1: 1G_BOOST 2: 2G_BOOST 4: NPC_ANTI_ROLL 8: NPC_NEUTRAL_HANDL; 2nd digit 1: NO_HANDBRAKE 2: STEER_REARWHEELS 4: HB_REARWHEEL_STEER 8: ALT_STEER_OPT; 3rd digit 1: WHEEL_F_NARROW2 2: WHEEL_F_NARROW 4: WHEEL_F_WIDE 8: WHEEL_F_WIDE2; 4th digit 1: WHEEL_R_NARROW2 2: WHEEL_R_NARROW 4: WHEEL_R_WIDE 8: WHEEL_R_WIDE2; 5th digit 1: HYDRAULIC_GEOM 2: HYDRAULIC_INST 4: HYDRAULIC_NONE 8: NOS_INST; 6th digit 1: OFFROAD_ABILITY 2: OFFROAD_ABILITY2 4: HALOGEN_LIGHTS 8: PROC_REARWHEEL_1ST; 7th digit 1: USE_MAXSP_LIMIT 2: LOW_RIDER 4: STREET_RACER; 8th digit 1: SWINGING_CHASSISHere is an example flag line from the stallion, columns af and ag:CODE2800 4The flags are written in hex, so are formed backwards. The 2800 is the af column, and the 4 is the ag, but the '1st digit' (as the key calls it) is in fact 0 for the af column, and 4 for the ag column. So for the af column, the 3rd and 4th digits are '8' and '2' respectively. Once you get that, you can match them up to the key.So for af, the first digit is 0, so the car isn't a van, a bus, a lowrider or a 'big' vehicle. 0 is the value you use so the game registers the 1st digit as being accounted for, but won't apply a flag.Thus, we can work out the af settings for the Stallion. The first 2 digits are 0, so none of those possible flags are applied. 3rd digit is 8. This applies the 'convertible' flag to the car, which means CJ will jump over the door when he gets into an open-top variation of the Stallion. The 4th digit is 2, which applies the double exhaust flag to the Stallion, so it has two functioning exhaust pipes. Past this setting, the Stallion doesn't need any more flags, so no more flags have to be accounted for by a 0. However you could make it 00002800 and the af line would still be valid (all 8 possible flag settings are accounted for).The ag column has only one digit in it, 4, but other handling lines for cars will have as many digits as the Stallion's af column in their ag column. As there is only one number, this is logically taken as the 1st digit, with no more digits afterwards (though again, it could be 00000004 and be valid). The 4 makes the car have NPC_NEUTRAL_HANDL enabled, which I believe affects normal pedestrian handling for the Stallion when th eplayer isn't the one driving.You may notice however that with the way things are working, you can't have a convertible car with no doors, as they are handled by the same flag (3rd digit of af). However, all you need to do is add the two settings together, and make 9. This would be your 3rd digit to have both those setting enabled. Obviously you can't enter a 10, 11 or 12 for numerically higher possibilities, but this is written in hex. '10' is represented by 'A', '11' is represented by 'B' and so on, upwards.Now you have a grasp of the way the flags work, and how hex is written, we can move onto creating your own flag lines for your own cars.Let's take some typical settings from all available options that you may want;REVERSE_BONNET, DOUBLE_EXHAUST, FORCE_DOOR_CHECK, DOUBLE_RWHEELS, 2G_BOOST, NO_HANDBRAKE, OFFROAD_ABILITY2, HALOGEN_LIGHTS, PROC_REARWHEEL_1STNow we set about applying these. The first 4 are catered for by the af column, so we go through the list of options adding up the number sum where applicable. 1st digit has none of the options we want, so we make it 0. 2nd digit has our reverse bonnet option at 1, so we take that and make 1 our 2nd digit. 3rd digit has no settings we want, so it becomes 0. 4th digit has two of our wanted settings, at 2 and 8. So we add these together to make 10, and represent that with A. So far we have A010. The final option held with the af column is double_rhweels, which is accounted for by the 8th digit with a 2. So we make all digits up to the last 0, and we have this as our final af column:CODE2000A010You do the same work-through process for the ag column, and you end up with:CODED00012, or 00D00012I hope that makes sense.<3D Flags do not follow a certain order, you should write a 4 byte that contains the whole hex flags (like he did at the end) onto the memoryFor Example: [email protected] += 0xD0 // handling flags0A8C: write_memory [email protected] size 4 value 0x00D00012 virtual_protect 0 You see the 6th digit is D, D is 13 in decimal : 6th digit 1: OFFROAD_ABILITY 2: OFFROAD_ABILITY2 4: HALOGEN_LIGHTS 8: PROC_REARWHEEL_1ST Edited February 25, 2015 by Shmoopy Link to comment Share on other sites More sharing options...
nyolc8 Posted February 25, 2015 Author Share Posted February 25, 2015 I did it like this: [email protected] += 208 0A8D: [email protected] = read_memory [email protected] size 4 virtual_protect 008C3: clear [email protected] bit 280A8C: write_memory [email protected] size 4 value [email protected] virtual_protect 0Isn't this good? I wrote the whole 4 byte, but with the modified bit in it. I did it like this with the exhaust and it worked. But not working with the swinging chassis flag. Link to comment Share on other sites More sharing options...
Shmoopy Posted February 25, 2015 Share Posted February 25, 2015 Give me the vehicle model id Link to comment Share on other sites More sharing options...
nyolc8 Posted February 25, 2015 Author Share Posted February 25, 2015 596 (copcarla) Link to comment Share on other sites More sharing options...
Shmoopy Posted February 25, 2015 Share Posted February 25, 2015 (edited) No more chassis swinging, the effect is seen after a game restart. 0AB1: call_scm_func @VehGetHandlingPointer 1 model #COPCARLA ret:HandliPtr [email protected]@ += 0xD0 // handlingFlags0A8C: write_memory [email protected] size 4 value 0x00200008 virtual_protect 0 :[email protected] -= [email protected] *= 0x308 [email protected] += 0xB1F650 [email protected] += 0x4E 0A8D: [email protected] = read_memory [email protected] size 2 virtual_protect [email protected] *= 0xE0 [email protected] += 0xC2B9DC 0AB2: ret 1 [email protected] The default flags are : 0x10200008 as seen from the handling.cfg file , its a hex number and not decimal 0x00200008 I dont know if there is a function that reloads the handling data of a vehicle Credits to Wesser for his handling offset function Edited February 25, 2015 by Shmoopy Link to comment Share on other sites More sharing options...
nyolc8 Posted February 26, 2015 Author Share Posted February 26, 2015 How do you mean the effect seen after game restart? The script runs, and after I need to restart the game to see the change? Where is the change stored until game started then? Or you mean the script need to run at game start? Link to comment Share on other sites More sharing options...
Shmoopy Posted February 26, 2015 Share Posted February 26, 2015 By game restart i mean Pause game->Start new game not Quit game. Certain flags do not have instant effect change, I'll see if I can force the game to check the flag stat on change. Link to comment Share on other sites More sharing options...
nyolc8 Posted February 26, 2015 Author Share Posted February 26, 2015 Thank you Btw I want to change flags with cleo because I want to use it on samp (samp blocking handling.cfg editing) So this is why the game restarting is not good for me Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now