Jump to content
GODSPEEDSNAKE

Arma 3 - APEX - 3DIcon Markers

Recommended Posts

Hey guys,

              Played some of the campain and really like their 3D Icon markers attached to players curious if anyone knows how to do that? I have the following in use and working however very obvious and white not as clean and green and subtle as the campaign.

onEachFrame

{

	private["_vis","_pos"];

	{

		if(player distance _x < 100 && isPlayer _x && _x != player && side _x == playerSide) then

		{

			_vis = lineIntersects [eyePos player, eyePos _x,player, _x];

            if(!_vis) then

            {

                _pos = visiblePosition _x;

                _pos set[2,(getPosATL _x select 2) + 2.2];

                drawIcon3D ["\a3\ui_f\data\map\Markers\military\box_CA.paa",[1,1,1,1],_pos,1,1,0,name _x,0,0.04];

            };

		};

	} foreach playableUnits;

};

Now how can I improve on this and also change the colors of the name and icon and for it to be much smaller?

 

Warm Regards,

RH

Share this post


Link to post
Share on other sites

First, I found a problem with the code.

onEachFrame {
	private["_vis","_pos"];
	{
		if(player distance _x < 100 && !isPlayer _x && _x != player && side _x == playerSide) then
		{
			_vis = lineIntersects [eyePos player, eyePos _x,player, _x];
			if(!_vis) then {
				_pos = visiblePosition _x;
				_pos set[2,(getPosATL _x select 2) + 2.2];
				drawIcon3D ["\a3\ui_f\data\map\Markers\military\box_CA.paa",[1,1,1,1],_pos,1,1,0,name _x,0,0.04];
			};
		};
	} foreach playableUnits;
};

&& isPlayer _x should be && !isPlayer _x.

 

And to improve:

drawIcon3D ["\a3\ui_f\data\map\Markers\military\box_CA.paa",<Color>,_pos,<X Size of Icon>,<Y Size of Icon>,0,name _x,0,<Size of Text>];

Example:

drawIcon3D ["\a3\ui_f\data\map\Markers\military\box_CA.paa",[1,0,0,1],_pos,2,2,0,name _x,0,0.02];

Red, Big Icon, Small Text.

 

And more speed:

_pos = getPosATLVisual _x vectorAdd [0,0,2.2];

This is better than now.

 

Aaaand here is my edition.

onEachFrame {
	private["_vis","_pos"];
	{
		if (player distance _x < 100 && !isPlayer _x && _x != player && side _x == playerSide) then {
			_vis = lineIntersects [AGLToASL positionCameraToWorld [0,0,0], eyePos _x,player, _x];
			if(!_vis) then {
				_pos = (ASLToAGL eyePos _x vectorAdd [0,0,0.35]) ;
				drawIcon3D ["\a3\ui_f\data\map\Markers\military\box_CA.paa",[1,1,1,1],_pos,1,1,0,name _x,0,0.04];
			};
		};
	} foreach playableUnits;
};

Share this post


Link to post
Share on other sites

polpox, I believe the OP wants the icon to display for human players. Therefore, his original use of isPlayer was correct.

Share this post


Link to post
Share on other sites

polpox, I believe the OP wants the icon to display for human players. Therefore, his original use of isPlayer was correct.

Oh no yeah no god please no

 

whatta freakin miss... scripting with AI should cause this...

Share this post


Link to post
Share on other sites

Kylania posted an example of this in another thread a week ago ish

 

 

It's as simple as putting this in your init.sqf,

"tom, dick, harry" being your unit's variable names, you should be able to have as many as you want that way - if it's a player their profile names show up by the hexagon icon, if it's an AI their identity names show up

[[tom, dick, harry]] call BIS_fnc_EXP_camp_IFF;

Last I tried it it seems a bit glitchy if you do it with group member units, so I think BIS just intended this to be used on non-group units to know where they are

Share this post


Link to post
Share on other sites
[[tom, dick, harry]] call BIS_fnc_EXP_camp_IFF;

That works fantastic... However is there a way to make it run for which ever players join the server? so instead of manually adding each person that's labeled all playable players, cause what i found is butting all the player names in causes an error when joining server because one or two might not be avail cause of say 5 player co-op but 3 play.

 

eg: and sorry for being noob.

[[_player]] call BIS_fnc_EXP_camp_IFF;

Share this post


Link to post
Share on other sites

Always consider using BIS_fnc_addStackedEventhandler instead of onEachFrame, if you're using other scripts or functions that are utilizing the stacked eventhandler your onEachFrame will be overwritten like a tiny helpless puppy being devoured by an ancient god.

 

Cheers

No need for stacked scripted EH any more. We already have engine alternative "EachFrame" and for drawing icons there is even better one - "Draw3D"

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

×