Quantcast

Jump to content

» «
Photo

[Native Research] : AI Blips

3 replies to this topic
ins1de
  • ins1de

    Vi Veri Veniversum Vivus Vici

  • Members
  • Joined: 23 Apr 2016
  • Antarctica

#1

Posted 30 March 2017 - 08:58 PM

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!

  • MrGTAmodsgerman, GAMELASTER and BiiXteR like this

Tarackgame
  • Tarackgame

    Crackhead

  • Members
  • Joined: 26 Apr 2016
  • Hungary

#2

Posted 06 April 2017 - 07:20 PM

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


ins1de
  • ins1de

    Vi Veri Veniversum Vivus Vici

  • Members
  • Joined: 23 Apr 2016
  • Antarctica

#3

Posted 07 April 2017 - 08:54 AM

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


Tarackgame
  • Tarackgame

    Crackhead

  • Members
  • Joined: 26 Apr 2016
  • Hungary

#4

Posted 08 April 2017 - 08:43 AM

Oh. It is working but just when i aim to the peds. :)





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users