Jump to content
Sign in to follow this  
Axek/Axyl

Where's Barry?!? See names of nearby friendly units.

Recommended Posts

Since Blake's Player Radar doesn't work in A3, I made a very simple substitute...

While holding down your Commanding key (Normally the ~), any friendly unit within 75m of you, and visible to you, will have their player name shown at their character.

BkzU78Cl.jpg

No more asking which one's Barry any more...now you can determine it yourself!

Download my Recognition "Where's Barry?" addon from here. (Updated to 0.2 - 7 Nov 13)

Axyl.

---------- Post added at 00:52 ---------- Previous post was at 00:50 ----------

For reference, the actual code for this is really short, in case anyone wants to play with it.

// only works if you have a GUI silly...maybe HC check too?
if (isDedicated) exitWith {};

waituntil {!isnull player};
sleep 0.01;

addMissionEventHandler["Draw3D", {
// Key Press check...
if (inputAction "forceCommandingMode"== 1) then {
	private ["_friendlyUnits"];
	_friendlyUnits= allUnits;
	//_friendlyUnits= playableUnits;   Commented out as playableUnits doesn't include those "dead".
	{
		// Are they less than 75m away from us...and on our side...and not us?
		if ((player distance _x)< 75 && {(side _x== side player)} && {!(player== _x)}) then {

			// Can we see them?
			if (!(lineIntersects[eyepos player, visiblePositionASL _x, player, vehicle _x]) && {!(terrainIntersectASL[eyePos player, eyePos _x])}) then {
			//if !(terrainIntersectASL[eyePos player, eyePos _x]) then {
				// Are they in a vehicle?
				if ((vehicle _x)== _x) then {
					// No...
					drawIcon3D ["", [1,0,0,1], visiblePosition _x, 0, 0, 0, name _x, 1, 0.04, "PuristaMedium"];
				} else {
					// yes...
					drawIcon3D ["", [1,1,0,1], visiblePosition _x, 0, 0, 0, name _x, 1, 0.04, "PuristaMedium"];
				};
			};  // end of intersect check
		}; // end of distance/side check
	} forEach _friendlyUnits;
};
}];

Edited by Axek

Share this post


Link to post
Share on other sites

Version 0.3...

* Checks eye position against eye position, rather than your eye position to other player's feet.

* Fixed issue with height position of text when units are inside buildings.

* Font size changes depending on the distance the unit is away from you.

Download here.

Share this post


Link to post
Share on other sites

Completely love the script. My unit has been using it for a bit since we got rid of our server side name tags to reduce the load on the server. One thing that we noticed was that holding it down was a bit annoying at times and a toggle'able version would be most welcome. So I modified your script to allow for that and thought I would share it with you in-case you wanted to incorporate it.

// only works if you have a GUI silly...maybe HC check too?
if (isDedicated) exitWith {};

waitUntil {!isNull(findDisplay 46)};
waituntil {!isnull player};

missionNamespace setVariable ["axy_toggle_check",1];
missionNamespace setVariable ["axy_key_release",0];

addMissionEventHandler["Draw3D", {
// Key Press check...
if (inputAction "forceCommandingMode"== 1 && axy_key_release==0) then {
	axy_key_release=1;
	if (axy_toggle_check==1) then {
		axy_toggle_check=0;
	} else {
		axy_toggle_check=1;
	};
};
if (inputAction "forceCommandingMode"== 0) then {
	axy_key_release=0;
};
if (axy_toggle_check==1) then {
	private ["_friendlyUnits"];
	_friendlyUnits= allUnits;
	//_friendlyUnits= playableUnits;   Commented out as playableUnits doesn't include those "dead".
	{
		// Are they less than 75m away from us...and on our side...and not us?
		if ((player distance _x)< 75 && {(side _x== side player)} && {!(player== _x)}) then {

			// Can we see them?
			// if (!(lineIntersects[eyepos player, visiblePositionASL _x, player, vehicle _x]) && {!(terrainIntersectASL[eyePos player, eyePos _x])}) then {
			if (!(lineIntersects[eyePos player, eyePos _x, player, vehicle _x]) && {!(terrainIntersectASL[eyePos player, eyePos _x])}) then {
				// Font size for text...depends on how far away they are.
				private ["_fontSize"];
				_fontSize= (75- (player distance _x))/ 75* 0.05;  // Was 0.04

				// Are they in a vehicle?
				if ((vehicle _x)== _x) then {
					// No...
					drawIcon3D ["", [1,0,0,1], ASLToATL(visiblePositionASL _x), 0, 0, 0, name _x, 1, _fontSize, "PuristaMedium"];
				} else {
					// yes...
					drawIcon3D ["", [1,1,0,1], ASLToATL(visiblePositionASL _x), 0, 0, 0, name _x, 1, _fontSize, "PuristaMedium"];
				};
			};  // end of intersect check
		}; // end of distance/side check
	} forEach _friendlyUnits;
};
}];

Share this post


Link to post
Share on other sites

New mod v0.2 available at withSIX. Download now by clicking:

@axy_recognition.png

@ Axek;

Soon you will be able to manage the promo pages of your content on our web platform and publish new content yourself.

To do so, please hit 'this is me' button on the page while logged in and you will get connected to your work.

For now you can send new content or releases our way through withsix.wetransfer.com or add your notification at getsatisfaction.withsix.com.

Share this post


Link to post
Share on other sites

Hey, first post here!

I've been trying to use this code with a MP mission, but it seems to break when someone respawns, but not always, and also when someone enters a vehicle. I can't seem to find the problem.

I've been using this directly in the init file. Any help would be much appreciated!

if (isDedicated) exitWith {};

waitUntil {!isNull(findDisplay 46)};
waituntil {!isnull player};

McolorBlue = [0,0,1,1];
McolorRed = [1,0,0,1];
McolorGreen = [0,1,0,1];

sColor = switch (side player) do {
	case west: {McolorBlue};
	case east: {McolorRed};
	case guer: {McolorGreen};
};

addMissionEventHandler["Draw3D", {
	private ["_friendlyUnits"];
	_friendlyUnits= allUnits;{
		if ((player distance _x)< 2000 && {(side _x== side player)} && {!(player== _x)}) then {
			_arr = visiblePosition _x; 
			_zArr = _arr select 2;
			_arr set [2, _zArr + 2];
			if ((vehicle _x)== _x) then {
				drawIcon3D ["\A3\ui_f\data\map\markers\nato\b_inf.paa", sColor, _arr, 0.75, 0.75, 0];
			} else {
				drawIcon3D ["\A3\ui_f\data\map\markers\nato\b_inf.paa", sColor, _arr, 0.75, 0.75, 0];
			};
		};
	} forEach _friendlyUnits;
}];

Edited by AirFell

Share this post


Link to post
Share on other sites

EDIT: Eh, yeah, ended up being a bit of a facepalm. We were testing it by killing each other... friendly kills were disabling it.

Edited by AirFell
fixed

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  

×