From c0cec7adf2943db06c0639e8f1269ed64a03a5fd Mon Sep 17 00:00:00 2001 From: Timi007 Date: Fri, 18 Feb 2022 17:52:02 +0100 Subject: [PATCH] Add player height and dynamic scaling to zeus uncon icons (#74) * Add player height to zeus uncon icons * Use correct position commands * Scale icon with distance --- addons/zeus/functions/fnc_initDrawIconEH.sqf | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/addons/zeus/functions/fnc_initDrawIconEH.sqf b/addons/zeus/functions/fnc_initDrawIconEH.sqf index 593c06f..63fdfff 100644 --- a/addons/zeus/functions/fnc_initDrawIconEH.sqf +++ b/addons/zeus/functions/fnc_initDrawIconEH.sqf @@ -38,14 +38,21 @@ CHECK(!isNil {(_curatorModule getVariable QGVAR(unconsciousPlayers))}); private _unconsciousPlayers = _curatorModule getVariable [QGVAR(unconsciousPlayers), []]; { - private _pos = getPos _x; + private _pos = ASLToAGL (getPosASLVisual _x); + private _camPos = ASLToAGL (getPosASLVisual curatorCamera); + private _d = _pos distance _camPos; + private _scale = linearConversion [300, 730, _d, 1.5, 0, true]; // 300m => 1.5, 730m => 0 + + if (_scale < 0.01) then { + continue; + }; drawIcon3D [ "z\ace\addons\zeus\ui\Icon_Module_Zeus_Unconscious_ca.paa", [0.9, 0, 0, 1], - [_pos select 0, _pos select 1, 2], - 1.5, // Width - 1.5, // Height + [_pos select 0, _pos select 1, (_pos select 2) + 2], + _scale, // Width + _scale, // Height 0, // Angle "", // Text 1 // Shadow