Jump to content

[Native Research] : AI Blips


ins1de

Recommended Posts

Introduction

 

AI Blips are special blips for peds that are handled by the game scripts. They fade out from a certain distance, switch automatically to a vehicle blip if the ped is in a car and disappear when the entity doesn't exist or is dead. The default blips' natives can not get, modify nor handle AI Blips. Actually, they have nothing in common :

  • Only one color (red)
  • Scale can not be modified
  • Blip reacts to the player's view angle
  • Game uses those blips for enemies

To create an AI Blip you have two options :

  1. Ped myPed is persistent and not MarkedAsNoLongerNeed() ( = MISSION_TYPE, can't be deleted by the game memory)
  2. Ped myPed is not persistent and is MarkedAsNoLongerNeeded()

This is important because the native will react differently depending on whether your ped is mission type or not.

Let's see the natives needed for AI Blips (code below is written in C#, but it can easily be converted to C++)

 

 

Code in action

 

Check if the current ped has already an AI BLIP :

 if(!Function.Call<bool>(Hash.DOES_PED_HAVE_AI_BLIP, dummy)) {}

To create an AI BLIP, _0xD30C50DF888D58B5 is needed with the following parameters :

  • int pedHandle, example : 987007
  • bool showViewCones, example : false
 Function.Call(Hash._0xD30C50DF888D58B5, dummy.Handle, false);

If the ped is not MISSION_TYPE, then using bool showViewCones = true; will work and draw the blue cones. However, if the ped is MISSION_TYPE, then showViewCones must be set to true, and it won't enable the view cones for some unknown reason but it will allow to draw AI Blips for persistent peds.

 

To set the fade out distance - blip max distance, _0x97C65887D4B37FA9 will be used with the following parameters :

  • int pedHandle
  • float range, example : 40F
 Function.Call(Hash._0x97C65887D4B37FA9, dummy.Handle, 40F);

Final result :

613781blip.png

 

These were the base natives to manage AI Blips, of course there are a few more but they have to be research a bit further, when that happens, this topic will be updated.

Enjoy blips!

  • Like 3
Link to comment
Share on other sites

It's doesn't working. :( I have to add manually blips to Pedestrians.

 

This post is as useful as trying to push on a rope.

At least send us your code..

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.