Rev Help - Player Colored Icons have Disappeared now showing Vanilla Hexagons

  • Offline Antman
  • Fresh Spawn
  • *
  • Posts: 12
Hey folks I am trying to find out where the break is that keeps showing the vanilla team player hexagons and not the standard Wasteland colored team icons. The major problem is that the Hexagons disappear after certain amount of distance and are causing a lot of team killing incidents.
 
The standard team colored  icons above players heads to include  the names above the players heads appear to be turned off and do not show on player even when the windows key is hit.  I believe player names are triggered at onKeyPress.sqf ... On a side note the names of the players show on the map but not players heads in game. I am not sure if this is a config setting or if something is bugged.

I believe the  colored team icons are generated at
drawPlayerIcons.sqf code shown below



if (!hasInterface) exitWith {};

#define ICON_fadeDistance 1250
#define ICON_limitDistance 2000
#define ICON_sizeScale 0.75

#define MINE_ICON_MAX_DISTANCE 200 // 200 is Arma 3 default for mine detector

#define UNIT_POS(UNIT) (UNIT modelToWorldVisual (UNIT selectionPosition "spine3")) //[0, 0, 1.25]) // Torso height
#define UAV_UNIT_POS(UNIT) (((vehicle UNIT) modelToWorldVisual [0, 0, 0]) vectorAdd [0, 0, 0.5])
#define CENTER_POS(OBJ) (OBJ modelToWorldVisual [0,0,0])

if (isNil "showPlayerNames") then { showPlayerNames = false };

hudPlayerIcon_uiScale = (0.55 / (getResolution select 5)) * ICON_sizeScale; // 0.55 = Interface size "Small"
drawPlayerIcons_array = [];

drawPlayerIcons_posCode =
{
   switch (_this) do
   {
      case 1: {{ UNIT_POS(_this) }};
      case 2: {{ UAV_UNIT_POS(_this) }};
      default {{ CENTER_POS(_this) }};
   };
} call mf_compile;

if (!isNil "drawPlayerIcons_draw3D") then { removeMissionEventHandler ["Draw3D", drawPlayerIcons_draw3D] };
drawPlayerIcons_draw3D = addMissionEventHandler ["Draw3D",
{
   {
      _x params ["_drawArr", "_obj", "_posCode"];
      if (alive _obj) then { _drawArr set [2, _obj call _posCode] };
      drawIcon3D _drawArr;
   } forEach drawPlayerIcons_array;
}];

if (!isNil "drawPlayerIcons_thread") then { terminate drawPlayerIcons_thread };
drawPlayerIcons_thread = [] spawn
{
   scriptName "drawPlayerIcons";

   _uiScale = (0.55 / (getResolution select 5)) * ICON_sizeScale; // 0.55 = Interface size "Small"

   _reviveIcon = call currMissionDir + "client\icons\revive.paa";
   _teamIcon = switch (playerSide) do
   {
      case BLUFOR: { call currMissionDir + "client\icons\igui_side_blufor_ca.paa" };
      case OPFOR:  { call currMissionDir + "client\icons\igui_side_opfor_ca.paa" };
      default      { call currMissionDir + "client\icons\igui_side_indep_ca.paa" };
   };

   _bluforOpfor = playerSide in [BLUFOR,OPFOR];

   _detectedMinesDisabled = (round difficultyOption "detectedMines" < 2);
   _mineIcon = getText (configfile >> "CfgInGameUI" >> "Cursor" >> "explosive");
   _mineColor = getArray (configfile >> "CfgInGameUI" >> "Cursor" >> "explosiveColor");

   {
      if (_x isEqualType "") then
      {
         _mineColor set [_forEachIndex, call compile _x]; // explosiveColor contains an array of strings which contain profile color code...
      };
   } forEach _mineColor;

   _noBuiltInThermal = ["A3W_disableBuiltInThermal"] call isConfigOn;

   private ["_dist"];

   // Execute every frame
   waitUntil
   {
      _newArray = [];

      if (!visibleMap && isNull findDisplay 49) then
      {
         {
            _unit = _x;

            if (side group _unit isEqualTo playerSide && // "side group _unit" instead of "side _unit" is because "setCaptive true" when unconscious changes player side to civ (so AI stops shooting)
               {_dist = _unit distance positionCameraToWorld [0,0,0]; _dist < ICON_limitDistance &&
               {alive _unit &&
               (_unit != player || cameraOn != vehicle player) &&
               {!(_unit getVariable ["playerSpawning", false]) &&
               (vehicle _unit != getConnectedUAV player || cameraOn != vehicle _unit)}}}) then // do not show UAV AI icons when controlling UAV
            {
               _simulation = getText (configFile >> "CfgVehicles" >> typeOf _unit >> "simulation");
               _isUavUnit = (_simulation == "UAVPilot");

               //_dist = _unit distance positionCameraToWorld [0,0,0];
               _posCode = ([1,2] select _isUavUnit) call drawPlayerIcons_posCode;
               _pos = _unit call _posCode;

               // only draw players inside range and screen
               if !(worldToScreen _pos isEqualTo []) then
               {
                  if (_simulation == "headlessclient" || (_isUavUnit && {_unit != (crew vehicle _unit) select 0})) exitWith {}; // exclude headless clients, and allow only one AI per UAV

                  if !(_bluforOpfor || {group _unit == group player || // exclude enemy indie groups
                       (_isUavUnit && {((objectParent _unit) getVariable ["ownerUID","0"]) in ((units player) apply {getPlayerUID _x})})}) exitWith {}; // but allow friendly indie UAVs

                  _alpha = (ICON_limitDistance - _dist) / (ICON_limitDistance - ICON_fadeDistance);
                  _color = [1,1,1,_alpha];
                  _icon = _teamIcon;
                  _size = 0;
                  _shadow = [0,2] select showPlayerNames;

                  if (_unit call A3W_fnc_isUnconscious) then
                  {
                     _icon = _reviveIcon;
                     _size = (2 - ((_dist / ICON_limitDistance) * 0.8)) * _uiScale * ([0.8, 1] select showPlayerNames);

                     // Revive icon blinking code
                     if (_unit call A3W_fnc_isBleeding) then
                     {
                        _timestamp = _unit getVariable ["FAR_iconBlinkTimestamp", 0];
                        _time = time;

                        if !(_unit getVariable ["FAR_iconBlink", false]) then
                        {
                           if (_time >= _timestamp) then
                           {
                              _unit setVariable ["FAR_iconBlink", true];
                              _unit setVariable ["FAR_iconBlinkTimestamp", _time + 0.3]; // red duration
                           };
                        }
                        else
                        {
                           if (_time >= _timestamp) then
                           {
                              _unit setVariable ["FAR_iconBlink", false];
                              _unit setVariable ["FAR_iconBlinkTimestamp", _time + 1.25]; // green duration
                           };
                        };

                        if (_unit getVariable ["FAR_iconBlink", false]) then
                        {
                           _color = [1,0,0,_alpha];
                        };
                     }
                     else
                     {
                        if (!isNil {_unit getVariable "FAR_iconBlink"}) then
                        {
                           _unit setVariable ["FAR_iconBlink", nil];
                        };
                     };
                  }
                  else
                  {
                     _size = (1 - ((_dist / ICON_limitDistance) * 0.7)) * _uiScale * ([0.7, 1] select showPlayerNames);
                  };

                  _text = if (showPlayerNames) then
                  {
                     if (isPlayer _unit) then { name _unit }
                     else
                     {
                        _uavOwner = (uavControl vehicle _unit) select 0;
                        format ["[AI%1]", if (isPlayer _uavOwner) then { " - " + name _uavOwner } else { "" }]
                     };
                  } else { "" };

                  _newArray pushBack [[_icon, _color, _pos, _size, _size, 0, _text, _shadow], _unit, _posCode]; //, 0.03, "PuristaMedium"];
               };
            };
         } forEach allUnits;

         if ("MineDetector" in items player) then
         {
            // override manual mine detection
            {
               if (mineActive _x && !(_x mineDetectedBy playerSide)) then
               {
                  playerSide revealMine _x;
               };
            } forEach (player nearObjects ["MineBase", 10]);

            if (_detectedMinesDisabled) then
            {
               _posCode = 0 call drawPlayerIcons_posCode;

               {
                  if (mineActive _x && _x distance player <= MINE_ICON_MAX_DISTANCE) then
                  {
                     _newArray pushBack [[_mineIcon, _mineColor, CENTER_POS(_x), 1, 1, 0, "", 2, 0, "PuristaMedium", "", true], _x, _posCode];
                  };
               } forEach detectedMines playerSide;
            };
         };

         if (_noBuiltInThermal || (currentWeapon player) select [0,15] == "Laserdesignator") then
         {
            _thermalActive = currentVisionMode player isEqualTo 2;

            if (_thermalActive || !isNil "A3W_builtInThermalOffline") then
            {
               _weapon = currentWeapon player;
               _ownWeapon = true;

               {
                  _x params ["_unit", "","","", "_ffv"];

                  if (_unit == player) exitWith
                  {
                     _ownWeapon = _ffv;
                  };
               } forEach fullCrew [objectParent player, "", false];

               if (_thermalActive && {cameraOn == vehicle player && _weapon in weapons player && _ownWeapon &&
                  ({_x == "TI"} count getArray (configFile >> "CfgWeapons" >> _weapon >> "visionMode") > 0 ||
                   {!("{_x == 'TI'} count getArray (_x >> 'visionMode') > 0" configClasses (configFile >> "CfgWeapons" >> _weapon >> "OpticsModes") isEqualTo [])})}) then
               {
                  if (isNil "A3W_builtInThermalOffline") then
                  {
                     "A3W_thermalOffline" cutText ["THERMAL IMAGING OFFLINE", "BLACK", 0.001, false];
                     A3W_builtInThermalOffline = true;
                  };
               }
               else
               {
                  if (!isNil "A3W_builtInThermalOffline") then
                  {
                     "A3W_thermalOffline" cutText ["", "PLAIN", 0.001, false];
                     A3W_builtInThermalOffline = nil;
                  };
               };
            };
         };
      };

      drawPlayerIcons_array = _newArray;
      false
   };
};

A3W_scriptThreads pushBack drawPlayerIcons_thread;


___________________________________________________________________________________________


and triggering player names are called at onKeyPress.sqf shown below...


#define UNCONSCIOUS (player call A3W_fnc_isUnconscious)

private ["_key", "_shift", "_ctrl", "_alt", "_handled"];

_key = _this select 1;
_shift = _this select 2;
_ctrl = _this select 3;
_alt = _this select 4;

_handled = false;

// ********** Hardcoded keys **********
// keycodes are defined in client\clientEvents\customKeys.sqf
switch (true) do
{
   
        // Emergency Eject - Del Key
   case (_key == 211):
   {   
      [-9, false, true, ""] execVM "client\actions\forceEject.sqf";
   };

        // U key
   case (_key in A3W_customKeys_adminMenu):
   {
      execVM "client\systems\adminPanel\checkAdmin.sqf";
   };

   // Tilde (key above Tab)
   case (_key in A3W_customKeys_playerMenu):
   {
      if (alive player && !UNCONSCIOUS) then { [] spawn loadPlayerMenu } else { [] call A3W_fnc_killFeedMenu };
      _handled = true;
   };

   // Home & Windows keys
   case (_key in A3W_customKeys_playerNames):
   {
      showPlayerNames = if (isNil "showPlayerNames") then { true } else { !showPlayerNames };
   };

   // Earplugs - End Key
   case (_key in A3W_customKeys_earPlugs):
   {
      if (soundVolume > 0.5) then
      {
         0.5 fadeSound 0.2;
         ["You've inserted your earplugs.", 5] call mf_notify_client;
      }
      else
      {
         0.5 fadeSound 1;
         ["You've taken out your earplugs.", 5] call mf_notify_client;
      };
   };
};

// ********** Action keys **********

if (!UNCONSCIOUS) then // ####################
{

// Parachute
if (!_handled && _key in actionKeys "GetOver") then
{
   if (!alive player) exitWith {};

   _veh = vehicle player;

   if (_veh == player) exitWith
   {
      // allow opening parachute only above 2.5m
      if ((getPos player) select 2 > 2.5) then
      {
         true call CR_fnc_parachute;
         _handled = true;
      };
   };

   // 1 sec cooldown after parachute is deployed so you don't start falling again if you double-tap the key
   if (_veh isKindOf "ParachuteBase" && (isNil "A3W_openParachuteTimestamp" || {diag_tickTime - A3W_openParachuteTimestamp >= 1})) then
   {
      moveOut player;
      _veh spawn
      {
         sleep 1;
         deleteVehicle _this;
      };
   };
};

// Eject
if (!_handled && _key in actionKeys "GetOut") then
{
   _veh = vehicle player;

   if (alive player && _veh != player) then
   {
      if (_ctrl && {_veh isKindOf 'Air' && !(_veh isKindOf 'ParachuteBase')}) then
      {
         [] spawn
         {
            //if !(["Are you sure you want to eject?", "Confirm", true, true] call BIS_fnc_guiMessage) exitWith {}; //CR - Removed extra confirmation
            [[], CR_fnc_eject] execFSM "call.fsm";
         };

         _handled = true;
      };
   };
};

// Override prone reload freeze (ffs BIS)
if (!_handled && _key in (actionKeys "MoveDown" + actionKeys "MoveUp")) then
{
   if ((toLower animationState player) find "reloadprone" != -1) then
   {
      [player, format ["AmovPknlMstpSrasW%1Dnon", [player, true] call getMoveWeapon]] call switchMoveGlobal;
      reload player;
   };
};

} // ####################
else // UNCONSCIOUS
{
   if (_key == 57) then // spacebar
   {
      execVM "client\functions\confirmSuicide.sqf";
      _handled = true;
   };

   if (_key == 14) then // backspace
   {
      execVM "addons\far_revive\FAR_lastResort.sqf";
      _handled = true;
   };
};

// Scoreboard
if (!_handled && _key in actionKeys "NetworkStats") then
{
   if (_key != 25 || // 25 = P
      ((!_ctrl || {!(486539289 in actionKeys "NetworkPlayers") && isNil "TFAR_fnc_TaskForceArrowheadRadioInit"}) && // 486539289 = Left Ctrl + P
      (!_shift || {!(704643042 in actionKeys "NetworkPlayers")}))) then // 704643042 = Left Shift + P
   {
      if (alive player && isNull (uiNamespace getVariable ["ScoreGUI", displayNull])) then
      {
         call loadScoreboard;
      };

      _handled = true;
   };
};

// Push-to-talk
if (!_handled && _key in call A3W_allVoiceChatKeys) then
{
   [true] call fn_voiceChatControl;
};

// UAV feed
if (!_handled && _key in (actionKeys "UavView" + actionKeys "UavViewToggle")) then
{
   if (["A3W_disableUavFeed"] call isConfigOn) then
   {
      _handled = true;
   };
};

// Block 3rd person and group cam while injured
if (!_handled && _key in (actionKeys "PersonView" + actionKeys "TacticalView")) then
{
   if (UNCONSCIOUS) then
   {
      _handled = true;
   };
};

_handled


___________________________________________________________________________________________
What am I missing here?

Any help is highly appreciated it.

Ant
  • Offline Antman
  • Fresh Spawn
  • *
  • Posts: 12

Player Colored Icons have Disappeared now showing Vanilla Hexagons

« Reply #1 posted: Jan 16, 2020, 07:58 AM »
Found my issue so disregard last post