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. Forum Support

    3. Suggestions

Sleepy AI


Recommended Posts

Hello. I'm trying to make a boat to patrol persistently, i marked it with SET_ENTITY_AS_MISSION_ENTITY and indeed engine did not delete it and it sails on it's mission but after some time it just falls asleep until you come really close to it. Is there any way to make vehicles alive all the time regardless of how far player is?

Link to comment
Share on other sites

this is something I would like to know as well. Really just anything about how to get distant entities to continue to behave like nearby entities.


How far away are you talking, exactly? I have noticed that airplanes that are set to AI::TASK_PLANE_CHASE the on-foot player will sometimes do such a wide loop to turn around that they will disappear from the screen entirely due to exceeding their max draw distance. However, they will come back into the picture after turning around fully, zooming towards the player again. They will also fly quite intelligently, sticking very close to the ground and dodging obstacles even at extreme ranges. Maybe it is just a thing for airplanes, though. Have you tried using AI::TASK_BOAT_MISSION() before telling the boat driver to go on patrol? Without using TASK_PLANE_MISSION, my planes used to frequently vanish forever at long range, and they would often crash into obvious obstacles (and would not fly low to the ground). I was not declaring them as mission entities, though.


Also, have you tried giving the driver a repeating-Tasksequence?

Edited by whorse
Link to comment
Share on other sites

Yes, planes tasked with TASK_PLANE_MISSION does not fall asleep regardless of how far you are (at least first plane). But my planes do crash into mountains.

I use TASK_BOAT_MISSION for boats and they fall asleep soon.


I did not tried to repeat tasks to drivers.

I'm have idea (not tried yet) of teleporting a player above vehicle for a moment to awake AI.

Link to comment
Share on other sites

Seems like repeating task does not help but you should try yourself maybe you have better luck.

Teleporting helps but obviously making game unplayable.

Link to comment
Share on other sites

Did you turn on PED::SET_BLOCKING_OF_NON_TEMPORARY_EVENTS on the driver before using TASK_BOAT_MISSION? That's what elsewhat said needed to be done before boat missions would work (see his thread a few topics down). For my planes I literally told them to go on a plane mission to their own current coordinates, and then immediately afterwards started giving them a series of PLANE_CHASE tasks. But just doing TASK_PLANE_MISSION that one time (and not even to any destination, just to their own location) seemed to change the way they flew from then on.

That's all I can think of that might help you, sorry.

Link to comment
Share on other sites



Does not help, they sail OK without this call while you are near them.

I think this is how unit scheduler works internally and we can't do much about it.

My problem is worse, game does not start vehicles (both plane and boat) processing at all if you are far away.

E.g.: when i stand on a mountain 1000m(eters?) away from the spawn point, spawn them by pressing a key and they just stand there doing nothing. If you move closer they start movement. This really sucks.

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

  • 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.