Difference between revisions of "CHANGE BLIP DISPLAY"

From GTAMods Wiki
Jump to navigation Jump to search
m (I corrected the info on the table and adde some cosmetic changes + a new image.)
 
(2 intermediate revisions by the same user not shown)
Line 8: Line 8:
 
}}
 
}}
  
Changes how a blip is displayed in both the radar/map and the world.
+
Changes how a blip is displayed in the radar, the map and the world.
  
 
==Know values for ''blip_display''==
 
==Know values for ''blip_display''==
 
{| {{Prettytable}}
 
{| {{Prettytable}}
 
!Value
 
!Value
!Is it drawn on the radar/map?
+
!Is it drawn on the radar?
 
!Is it drawn on the world?
 
!Is it drawn on the world?
 +
!Is it drawn on the map?
 
|-
 
|-
|0 || NO || NO
+
|0 || NO || NO  || NO
 
|-
 
|-
 +
|1 || NO  || NO  || NO
 
|-
 
|-
|1 || NO || NO
+
|2 || YES || NO || YES
 
|-
 
|-
 +
|3 || NO  || NO  || YES
 
|-
 
|-
|2 || YES || YES
+
|4 || YES || YES || YES
 
|-
 
|-
 +
|5 || YES || NO  || NO
 
|-
 
|-
|3 || NO || NO
 
|-
 
|4 || YES || YES
 
|-
 
|5 || YES || NO
 
|-
 
 
|}
 
|}
  
These values were infered doing in-game tests. Pay attention to the ''blip_display'' value used for each blip (shown in the radar) and how the blips are displayed on the second image relative to the first one.
+
{| style="float: right;"
 +
|[[File:Radar VS Map.png|thumb|200px|center]]
 +
|}
 +
 
 +
These values were infered doing in-game tests. The image to the right shows how some blips are drawn only on the radar vs the radar AND the map, while the images below show how some blips are drawn on the radar vs the radar AND the world. Pay attention to the numbers shown in the radar next to the ''contact_blips'' (colored in dark yellow). On the first image these numbers represent the index of each blip in ''blip_array[]'' and their ''blip_display'' value. On the second image those numbers represent only their index in ''blip_array[]'' while their ''blip_display'' value is always equal to 4. Note how the blips are displayed on the second image relative to the first one.
 +
 
 +
 
 +
{| style="margin: auto;"
 +
|[[File:Blip_display_test_1.png|thumb|300px|center|Depending on their ''blip_display'' value blips are drawn on the world or not.]]
 +
|[[File:Blip_display_test_2.png|thumb|300px|center|Blips with a ''blip_display'' value of 4 are always drawn on the map, the world and the radar.]]
 +
|}
  
[[File:Blip_display_test_1.png|600px]]
 
[[File:Blip_display_test_2.png|600px]]
 
  
 
The blips were created in a for loop that also changed their ''blip_display'' value:
 
The blips were created in a for loop that also changed their ''blip_display'' value:
  
 
<source lang="cpp">
 
<source lang="cpp">
 
+
/*
 +
While you may see 7 blips here this code is responsible for creating
 +
only the "contact blips" (the ones in the background).
 +
*/
 +
 
//The display values were defined in an enum.
 
//The display values were defined in an enum.
 
//They vary from 0 to 5 with BLIP_DISPLAY_0 being 0 and BLIP_DISPLAY_5 being 5
 
//They vary from 0 to 5 with BLIP_DISPLAY_0 being 0 and BLIP_DISPLAY_5 being 5
 
+
 
Blip blip_array[6];
 
Blip blip_array[6];
 +
Blip control_blip_array[6];
 
eBlipDisplay display_array[] = {BLIP_DISPLAY_0, BLIP_DISPLAY_1, BLIP_DISPLAY_2, BLIP_DISPLAY_3, BLIP_DISPLAY_4, BLIP_DISPLAY_5};
 
eBlipDisplay display_array[] = {BLIP_DISPLAY_0, BLIP_DISPLAY_1, BLIP_DISPLAY_2, BLIP_DISPLAY_3, BLIP_DISPLAY_4, BLIP_DISPLAY_5};
 +
 +
for(int i = 0; i < 6; i++)
 +
{
 +
f32 offset = -15.0 * float(i);
  
for(int i = 0; i < 6; i++)
+
//For some reason "contact blips" and "coord blips" (light yellow, on the foreground) are gigantic
{
+
AddBlipForContact(952.727, -508.730 + offset, 20.0, &blip_array[i]);
f32 offset = -8.0 * float(i);
+
ChangeBlipDisplay(blip_array[i], display_array[i]);
AddBlipForContact(952.727, -508.730 + offset, 20.0, &blip_array[i]); //For some reason "contact_blips" are gigantic
+
ChangeBlipDisplay(blip_array[i], display_array[i]);
+
//"Control group"
}
+
AddBlipForContact(932.727, -508.730 + offset, 20.0, &control_blip_array[i]);
 +
}
 
</source>
 
</source>

Latest revision as of 04:36, 10 January 2015

CHANGE_BLIP_DISPLAY
Number of parameters: 2
Parameter #TypeDescription
1.integerblip_handle
2.integerblip_display
Return value:
TypeDescription
None

Changes how a blip is displayed in the radar, the map and the world.

Know values for blip_display

Value Is it drawn on the radar? Is it drawn on the world? Is it drawn on the map?
0 NO NO NO
1 NO NO NO
2 YES NO YES
3 NO NO YES
4 YES YES YES
5 YES NO NO
Radar VS Map.png

These values were infered doing in-game tests. The image to the right shows how some blips are drawn only on the radar vs the radar AND the map, while the images below show how some blips are drawn on the radar vs the radar AND the world. Pay attention to the numbers shown in the radar next to the contact_blips (colored in dark yellow). On the first image these numbers represent the index of each blip in blip_array[] and their blip_display value. On the second image those numbers represent only their index in blip_array[] while their blip_display value is always equal to 4. Note how the blips are displayed on the second image relative to the first one.


Depending on their blip_display value blips are drawn on the world or not.
Blips with a blip_display value of 4 are always drawn on the map, the world and the radar.


The blips were created in a for loop that also changed their blip_display value:

/*
While you may see 7 blips here this code is responsible for creating
only the "contact blips" (the ones in the background).
*/
 
//The display values were defined in an enum.
//They vary from 0 to 5 with BLIP_DISPLAY_0 being 0 and BLIP_DISPLAY_5 being 5
 
Blip blip_array[6];
Blip control_blip_array[6];
eBlipDisplay display_array[] = {BLIP_DISPLAY_0, BLIP_DISPLAY_1, BLIP_DISPLAY_2, BLIP_DISPLAY_3, BLIP_DISPLAY_4, BLIP_DISPLAY_5};
 
for(int i = 0; i < 6; i++)
	{
		f32 offset = -15.0 * float(i);

		//For some reason "contact blips" and "coord blips" (light yellow, on the foreground) are gigantic
		AddBlipForContact(952.727, -508.730 + offset, 20.0, &blip_array[i]);
		ChangeBlipDisplay(blip_array[i], display_array[i]);
		
		//"Control group"
		AddBlipForContact(932.727, -508.730 + offset, 20.0, &control_blip_array[i]);		
	}