Jump to content

Sign in to follow this  
BEAKSBY

How to show enemy units on map

Recommended Posts

Hi All,

I can't find this in the search.

I'm looking for a funtion that will display the enemy units on the map. I don't want the military symbols module. I would like to place the icons "picture" and "displayname" of each enemy unit on the map, as I've done with the 3D screen.

fn_Draw3D = {
   {
	private "_private, _displayName, _picure, _unitPos, _text, _distance, _sandGlass";
	_unit = _x; //typeOf cursorTarget;
	_distance = round (_x distance player);
	_displayName = getText (configfile >> "CfgVehicles" >> typeOf _x >> "displayName");
	_text = format ["%1   %2m", _displayName, (str _distance)];
	_picure = getText (configfile >> "CfgVehicles" >> typeOf _x  >> "picture");
	if (_picture == "") then {_picture = "pictures\Soldier_CA.paa"}; 
	_unitPos = getPosATL _x;
   drawIcon3D [
       _picure,
	[1,0,0,0.75],
       [(visiblePosition _x) select 0,(visiblePosition _x) select 1,((visiblePosition _x) select 2) + 10],
	0.8,
	0.5,
	0,
	_text,
	0,
	0.03,
	"PuristaMedium"
   ];
} forEach vehicles+allUnitsUAV ; 
};
private ["_addNew"];
_addNew = ["BIS_id", "onEachFrame", "fn_Draw3D"] call BIS_fnc_addStackedEventHandler;
sleep 5;
["BIS_id", "onEachFrame", "fn_Draw3D"] call BIS_fnc_removeStackedEventHandler;

Share this post


Link to post
Share on other sites

You could use markers and adjust there position to the enemy units position. I am new to arma modding myself and can't give much other advice.

Share this post


Link to post
Share on other sites
  Grumpy Old Man said:
http://killzonekid.com/arma-scripting-tutorials-how-to-draw-icon-on-map/

I'm using this for all units on map for debugging purposes.

Thanks GOM,

Does it slow down you system? I've incorportated inside of my fn_Draw3D and when I call it through BIS_fnc_addStackedEventHandler my system chugs.

I's like to add custom text too but don't want to have to setVariables and getVariables...so I went with player reveal _x inside the function above.

Edited by BEAKSBY

Share this post


Link to post
Share on other sites

Well I'm checking a lot of stuff with it, like group morale, group health, vehicle stats (like which wheel got damaged etc.) where does the group suspect enemies etc, so it's really hard on the system if there's a lot going on (100+ units)

If you only use it to display an icon on the units location you shouldn't notice any performance drop.

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×