Tankbuster 1747 Posted November 1, 2024 My homebrewed tactical ping has its limitations - as it's global there's only one allowed on the map at a time, but I gave up with the game's system because I found it unreliable. Anyway, where it would work best is on the artillery computer map but it doesnt show there. A decade old post came back from search, but I don't really understand displays and controls and the donated code didn't work, so I'm here again, asking for help 🙂 The ping shows on the map and UI just fine. Here's my code; _ctr1 and _atpmapip1 are the new, non working code. There's no error, apart from the _ctrl undefined from the last line of code which shows the _ctrl1 line is exitwith 'ing. /* Code written by Tankbuster */ #include "..\..\..\includes.sqf" __tky_starts scriptName "fn_showauthtacping"; private ["_atpmapip","_atpuiid"]; private _st = serverTime; private _ctrl = findDisplay 12 displayCtrl 51; _ctrl1 = ({ if !(isNull (_x displayCtrl 502)) exitWith {_x}; displayNull } forEach allDisplays) displayCtrl 500; if (((goggles player in ["G_Goggles_VR", "G_Combat_Goggles_tna_F", "G_Combat", "G_Balaclava_TI_G_tna_F","G_Balaclava_TI_G_blk_F","G_Tactical_Clear", "G_Tactical_Black"]) or shownArtilleryComputer) and ((lifeState player) in ["HEALTHY", "INJURED"])) then {// player has received a ping, has the required gear and is alive // draw ping icon on map _atpmapip = _ctrl ctrlAddEventHandler ["Draw", { _this select 0 drawIcon [ "\a3\Ui_f\data\IGUI\Cfg\TacticalPing\TacticalPingDefault_ca", // Custom images can also be used: getMissionPath "\myFolder\myIcon.paa" [0.73,0.24,0.11,1], authtacping, 64, 64, 0, "Ping", 2, 0.03, "TahomaB", "center" ]; }]; _atpmapip1 = _ctrl1 ctrlAddEventHandler ["Draw", { _this select 0 drawIcon [ "\a3\Ui_f\data\IGUI\Cfg\TacticalPing\TacticalPingDefault_ca", // Custom images can also be used: getMissionPath "\myFolder\myIcon.paa" [0.73,0.24,0.11,1], authtacping, 64, 64, 0, "Ping", 2, 0.03, "TahomaB", "center" ]; }]; // draw ping icon on game ui _atpuiid = addMissionEventHandler ["draw3D", { drawIcon3D [ "\a3\Ui_f\data\IGUI\Cfg\TacticalPing\TacticalPingDefault_ca", [0.73,0.24,0.11,1], authtacping, 1.5, 1.5, 0, "Ping", true, 0.03, "TahomaB", "center", true, 0, -0.06 ]; }]; playsound ["TacticalPing4",false]; sleep 30; removeMissionEventHandler ["draw3D", _atpuiid]; _ctrl ctrlRemoveEventHandler ["Draw", _atpmapip]; _ctr11 ctrlRemoveEventHandler ["Draw", _atpmapip1]; }; Share this post Link to post Share on other sites
pierremgi 4906 Posted November 3, 2024 Where does the position authtacping come from? Not sure it's still mandatory, as you use variables for displays and controls, you should start by disableSerialization. I think that doesn't hurt. Share this post Link to post Share on other sites
Tankbuster 1747 Posted November 4, 2024 On 11/3/2024 at 5:01 AM, pierremgi said: Where does the position authtacping come from? Not sure it's still mandatory, as you use variables for displays and controls, you should start by disableSerialization. I think that doesn't hurt. authtacping is a screenToWorld position that is publicvariabled by the client sending the ping. Share this post Link to post Share on other sites
pierremgi 4906 Posted November 5, 2024 Your code is working, step by step. The fact is you must wait for the control 500 iot display the ping on artillery computer. So, in game if your receive a ping coordinate (+ gear & alive), that doesn't mean the computer is/was displayed, so the EH can be set on controlNull instead of control 500. You can simplify your code by something like that: authtacping = .....; // make it nil after a due time execVM this sqf: private _atpuiid = addMissionEventHandler ["draw3D", { if (!isNil "authtacping") then { drawIcon3D [ "\a3\Ui_f\data\IGUI\Cfg\TacticalPing\TacticalPingDefault_ca", [0.73,0.24,0.11,1], authtacping, 1.5, 1.5, 0, "Ping", true, 0.03, "TahomaB", "center", true, 0, -0.06 ]; }; }]; [] spawn { disableSerialization; while {TRUE} do { private _ctrl1 = controlNull; waitUntil {sleep 1; _ctrl1 = findDisplay -1 displayCtrl 500; !isNull _ctrl1 && !isNil "authtacping"}; private _timer = diag_tickTime; private _atpmapip1 = _ctrl1 ctrlAddEventHandler ["Draw", { _this select 0 drawIcon [ "\a3\Ui_f\data\IGUI\Cfg\TacticalPing\TacticalPingDefault_ca", [0.73,0.24,0.11,1], authtacping, 64, 64, 0, "Ping", 2, 0.03, "TahomaB", "center" ]; }]; waitUntil {sleep 1; diag_tickTime > _timer + 30}; _ctrl1 ctrlRemoveEventHandler ["Draw", _atpmapip1]; }; }; [] spawn { params ["_ctrl","_atpmapip","_atpuiid"]; waitUntil {sleep 1; !isNull (findDisplay 12 displayCtrl 51)}; private _atpmapip = findDisplay 12 displayCtrl 51 ctrlAddEventHandler ["Draw", { if (!isNil "authtacping") then { _this select 0 drawIcon [ "\a3\Ui_f\data\IGUI\Cfg\TacticalPing\TacticalPingDefault_ca", [0.73,0.24,0.11,1], authtacping, 64, 64, 0, "Ping", 2, 0.03, "TahomaB", "center" ]; }; }]; }; No need for deleting a mission event handler or even a draw EH, you can add condition about authtacping variable (position / nil after due time) 1 1 Share this post Link to post Share on other sites
Tankbuster 1747 Posted November 23, 2024 @pierremgi That's excellent! I understand some of what you did and would never have got there on my own. Thank you so much! Now, anyone with a map can spot for arty, but also, a rangefinder user can make the ping for arty gunner to see. Awesome! Share this post Link to post Share on other sites