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

Disable pathing for NPC


PlayPrey
 Share

Recommended Posts

Sorry for asking a question without any reference code, but I just want to know if this is possible?

 

Can I disable the pathing for a NPC? The results being that for example a driver will drive in a straight line to its goal, even if there is another NPC in the way, or a building.

 

Anything about my question you don't understand, just ask :)

 

Thank you :p

Link to comment
Share on other sites

No, if I were to tell him to go to the other side of a building with only 1 'destination', the driver would ram the building.

 

I want to make my own kind of pathing if that makes sence, it will take time, but it is time Im willing to spend, lol.

Link to comment
Share on other sites

I believe there is a way. I can't exactly look at the natives for you, since I'm on my phone.

Look at the parameters for Task.DriveTo (using IntelliSense or ILSpy), there should be a "follow paths" variable.

Link to comment
Share on other sites

Task.DriveTo is using TASK_CAR_MISSION[...] natives. In your case

TASK_CAR_DRIVE_TO_COORD(Ped, Car, X, Y, Z, Speed, 0, Model, DrivingStyle, 18, 45000); // 45000 => OffRoad

is the better choice.

  • Like 2
Link to comment
Share on other sites

I have never used natives like that before, and I cant find anything about it trough googling o.o (Im not a pro searcher, lol)

 

Could you please provide an example on how to use it?

Link to comment
Share on other sites

I have never used natives like that before, and I cant find anything about it trough googling o.o (Im not a pro searcher, lol)

 

Could you please provide an example on how to use it?

This is how ScriptHookDotNet does it...

//how it's calledint num2 = ObeyTrafficLaws ? 1 : 2;TaskCarMissionCoorsTarget(this.ped.Handle, Vehicle.Handle, Target.X, Target.Y, Target.Z, 4u, SpeedMph, (uint)num2, 5u, 10u);//the function and parametersstatic void TaskCarMissionCoorsTarget(Ped ped, Vehicle vehicle, f32 x, f32 y, f32 z, u32 unknown0_4, f32 speed, u32 ObeyTrafficLaws, u32 unknown3_5, u32 unknown4_10) { NativeInvoke::Invoke<ScriptVoid>("TASK_CAR_MISSION_COORS_TARGET", ped, vehicle, x, y, z, unknown0_4, speed, ObeyTrafficLaws, unknown3_5, unknown4_10); }
Edited by LetsPlayOrDy
Link to comment
Share on other sites

Task.DriveTo is using TASK_CAR_MISSION[...] natives. In your case

TASK_CAR_DRIVE_TO_COORD(Ped, Car, X, Y, Z, Speed, 0, Model, DrivingStyle, 18, 45000); // 45000 => OffRoad

is the better choice.

Why would TASK_CAR_DRIVE_TO_COORD require a model?

Link to comment
Share on other sites

Why would TASK_CAR_DRIVE_TO_COORD require a model?

in case you'd want to use another CVehicleModelInfo's handling configuration?

SsZgxdL.png

Inactive in GTA/R* title modification indefinitely pursuant to a court order obtained by TTWO. Good job acting against modding!

Link to comment
Share on other sites

 

Why would TASK_CAR_DRIVE_TO_COORD require a model?

in case you'd want to use another CVehicleModelInfo's handling configuration?

 

I guess that makes sense.

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.