Jump to content
    1. Welcome to GTAForums!

    1. GTANet.com

    1. GTA Online

      1. Los Santos Drug Wars
      2. Updates
      3. Find Lobbies & Players
      4. Guides & Strategies
      5. Vehicles
      6. Content Creator
      7. Help & Support
    2. Red Dead Online

      1. Blood Money
      2. Frontier Pursuits
      3. Find Lobbies & Outlaws
      4. Help & Support
    3. Crews

    1. Grand Theft Auto Series

      1. Bugs*
      2. St. Andrews Cathedral
    2. GTA VI

    3. GTA V

      1. Guides & Strategies
      2. Help & Support
    4. GTA IV

      1. The Lost and Damned
      2. The Ballad of Gay Tony
      3. Guides & Strategies
      4. Help & Support
    5. GTA San Andreas

      1. Classic GTA SA
      2. Guides & Strategies
      3. Help & Support
    6. GTA Vice City

      1. Classic GTA VC
      2. Guides & Strategies
      3. Help & Support
    7. GTA III

      1. Classic GTA III
      2. Guides & Strategies
      3. Help & Support
    8. Portable Games

      1. GTA Chinatown Wars
      2. GTA Vice City Stories
      3. GTA Liberty City Stories
    9. Top-Down Games

      1. GTA Advance
      2. GTA 2
      3. GTA
    1. Red Dead Redemption 2

      1. PC
      2. Help & Support
    2. Red Dead Redemption

    1. GTA Mods

      1. GTA V
      2. GTA IV
      3. GTA III, VC & SA
      4. Tutorials
    2. Red Dead Mods

      1. Documentation
    3. Mod Showroom

      1. Scripts & Plugins
      2. Maps
      3. Total Conversions
      4. Vehicles
      5. Textures
      6. Characters
      7. Tools
      8. Other
      9. Workshop
    4. Featured Mods

      1. Design Your Own Mission
      2. OpenIV
      3. GTA: Underground
      4. GTA: Liberty City
      5. GTA: State of Liberty
    1. Rockstar Games

    2. Rockstar Collectors

    1. Off-Topic

      1. General Chat
      2. Gaming
      3. Technology
      4. Movies & TV
      5. Music
      6. Sports
      7. Vehicles
    2. Expression

      1. Graphics / Visual Arts
      2. GFX Requests & Tutorials
      3. Writers' Discussion
      4. Debates & Discussion
    1. Announcements

    2. Support

    3. Suggestions

[Q|SA] Traffic AI Question


savidge
 Share

Recommended Posts

Hello, I wanted to know if it's possible to make all land vehicles in San Andreas have the same traffic AI as the police department vehicles. For instance, in places like Mulholland, the vehicles' wheels "hover" off the ground sometimes because it's a hilly road on a slant, whereas if a police vehicle were to drive up the same hilly road, it would have all four wheels on the ground and it would behave the same way as if CJ was driving it himself. If anybody knows how to do this either via SCM editing or via CLEO, it'd be much appreciated. Thanks for reading :)

Link to comment
Share on other sites

Didn't know that the AI behaves differently depending on the area. Well I noticed one change, the cars on highways were driving so f********g fast that one hispanic w***e just pushed me once with her Nebula, I had full health, and I died.

DhF4CUK7S5mrQmZkTLK8DA.png

Link to comment
Share on other sites

Didn't know that the AI behaves differently depending on the area. Well I noticed one change, the cars on highways were driving so f********g fast that one hispanic w***e just pushed me once with her Nebula, I had full health, and I died.

Yeah, that's another thing. I managed to find some script that edits the highway traffic nodes so that they slow down a fair bit, but what also bugs me is that they exit on the outside lane a lot. I've had too many car wrecks to recall because of this :panic:

Link to comment
Share on other sites

here's my old script, what is actually unfinished (it have a lot of problems, and im too lazy to finish it)

{$CLEO}0000:0A96: [email protected] = actor $PLAYER_ACTOR structwhile true    wait 0    0A8D: [email protected] = read_memory 0xB74494 size 4 virtual_protect 0    [email protected] += 0x4    0A8D: [email protected] = read_memory [email protected] size 4 virtual_protect 0    for [email protected] = 0 to 27904 step 0x100        0A8D: [email protected] = read_memory [email protected] size 1 virtual_protect 0        000A: [email protected] += 0x1        005A: [email protected] += [email protected]                                                                 0A97: [email protected] = car [email protected] struct        [email protected] += 1192        0A8D: [email protected] = read_memory [email protected] size 1 virtual_protect 0        if            not [email protected] == 3            then            [email protected] += 236            0A8D: [email protected] = read_memory [email protected] size 4 virtual_protect 0            if                [email protected] < 2                then                [email protected] -= 308                0A8D: [email protected] = read_memory [email protected] size 4 virtual_protect 0                if and                    [email protected] > 0                    803B:   [email protected] == [email protected]  // (int)                    then                    if                        8975:   car [email protected] emergency_vehicle                        then                        [email protected] -= 169                        0A8D: [email protected] = read_memory [email protected] size 1 virtual_protect 0                        [email protected] += 3                          0407: store_coords_to [email protected] [email protected] [email protected] from_car [email protected] with_offset 0.0 0.0 0.0                        car.DriveTo([email protected], [email protected], [email protected], [email protected])                        0A8C: write_memory [email protected] size 1 value 1 virtual_protect 0                        [email protected] += 238                        0A8C: write_memory [email protected] size 1 value 3 virtual_protect 0                         [email protected] -= 239                        0209: [email protected] = random_int_in_ranges 0 10                                                        if                            [email protected] < 9                            then                            0A8C: write_memory [email protected] size 1 value 0 virtual_protect 0                            else                            0A8C: write_memory [email protected] size 1 value 5 virtual_protect 0                        end                         [email protected] -= 1                        0A8C: write_memory [email protected] size 1 value [email protected] virtual_protect 0                     end                end            end        end     endend
Link to comment
Share on other sites

 

here's my old script, what is actually unfinished (it have a lot of problems, and im too lazy to finish it)

 

Thanks man, this is just what I was looking for! I don't know what you mean by "problems" but I have only one flaw to point out -- some vehicles try to overtake others at red lights and end up waiting for the red light on the other side of the road. Other than that, this script is brilliant! :)

Link to comment
Share on other sites

  • 2 weeks later...

some vehicles try to overtake others at red lights and end up waiting for the red light on the other side of the road.

i just wanted to randomize AI )) anyway here's a small "lazy update". just ctrl+c ctrl+v all traffic part of CCarCtrl in each struct, i hope this one will fix all issues without crashes. also, if you know some unused addresses in carstruct, u can replace bomb address, what im using as mark

{$CLEO}0000:0A96: [email protected] = actor $PLAYER_ACTOR structwhile true    wait 0    0A8D: [email protected] = read_memory 0xB74494 size 4 virtual_protect 0    [email protected] += 0x4    0A8D: [email protected] = read_memory [email protected] size 4 virtual_protect 0    for [email protected] = 0 to 27904 step 256        0A8D: [email protected] = read_memory [email protected] size 1 virtual_protect 0        000A: [email protected] += 1        if and            0029: [email protected] >= 0x00             001B: 128 > [email protected]            then            005A: [email protected] += [email protected]                                                         0A97: [email protected] = car [email protected] struct            [email protected] += 1192            0A8D: [email protected] = read_memory [email protected] size 1 virtual_protect 0            if                not [email protected] == 3                then                [email protected] += 236                0A8D: [email protected] = read_memory [email protected] size 4 virtual_protect 0                if                    [email protected] < 2                    then                    [email protected] -= 308                    0A8D: [email protected] = read_memory [email protected] size 4 virtual_protect 0                    if and                        [email protected] > 0                        803B:   [email protected] == [email protected]  // (int)                        then                        if                            8975:   car [email protected] emergency_vehicle                            then                            0A97: [email protected] = car [email protected] struct                            0A8E: [email protected] = [email protected] + 0x390                            0AC6: [email protected] = label @_test offset                            for [email protected] = 0 to 37 step 1                                0A8D: [email protected] = read_memory [email protected] size 4 virtual_protect 0                                [email protected] += 4                                0A8C: write_memory [email protected] size 4 value [email protected] virtual_protect 0                                [email protected] += 4                            end                            car.DriveTo([email protected], 0.0, 0.0, 0.0)                            0A8E: [email protected] = [email protected] + 0x390                            0AC6: [email protected] = label @_test offset                                                            for [email protected] = 0 to 37 step 1                                0A8D: [email protected] = read_memory [email protected] size 4 virtual_protect 0                                [email protected] += 4                                0A8C: write_memory [email protected] size 4 value [email protected] virtual_protect 0                                [email protected] += 4                            end                            0A8E: [email protected] = [email protected] + 1192                            0A8C: write_memory [email protected] size 1 value 3 virtual_protect 0                         end                    end                end            end         end    endend:_testhex00 00 00 00 00 00 00 0000 00 00 00 00 00 00 0000 00 00 00 00 00 00 0000 00 00 00 00 00 00 0000 00 00 00 00 00 00 0000 00 00 00 00 00 00 0000 00 00 00 00 00 00 0000 00 00 00 00 00 00 0000 00 00 00 00 00 00 0000 00 00 00 00 00 00 0000 00 00 00 00 00 00 0000 00 00 00 00 00 00 0000 00 00 00 00 00 00 0000 00 00 00 00 00 00 0000 00 00 00 00 00 00 0000 00 00 00 00 00 00 0000 00 00 00 00 00 00 0000 00 00 00 00 00 00 0000 00 00 00 00 00 00 0000 00 00 00 end

btw, saw the func CCarSwithphysicstonormal or something like this, maybe later i will see what it can do

Link to comment
Share on other sites

i just wanted to randomize AI )) anyway here's a small "lazy update". just ctrl+c ctrl+v all traffic part of CCarCtrl in each struct, i hope this one will fix all issues without crashes. also, if you know some unused addresses in carstruct, u can replace bomb address, what im using as mark

 

 

btw, saw the func CCarSwithphysicstonormal or something like this, maybe later i will see what it can do

 

Wow, this is brilliant! Yep, it works fine without any crashing issues as well, you should release this on the Mod Showroom or something, I bet loads of people would want this. Thanks again, feel free to contribute more if you've found something worth mentioning :)

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • 1 User Currently Viewing
    0 members, 0 Anonymous, 1 Guest

×
×
  • Create New...

Important Information

By using GTAForums.com, you agree to our Terms of Use and Privacy Policy.