lightspeed_aust 681 Posted July 28, 2016 Is anyone far smarter than I able to produce a script which enables user of drone to see and mark targets. A ghost recon style of play to allow for recon and target marking prior to engaging. Share this post Link to post Share on other sites
theend3r 83 Posted July 28, 2016 I use this to draw 3D icons (Ã la Ghost Recon): _unit = _this select 0; call compile format[" ['Target%1', 'onEachFrame', {drawIcon3D ['\A3\ui_f\data\map\groupicons\selector_selectable_ca.paa', [1,0,0,(0 max (1 - ((player distance %1)/300)^0.387))], [(%1 selectionPosition 'pelvis' select 0) + (getpos %1 select 0), (%1 selectionPosition 'pelvis' select 1) + (getpos %1 select 1), (%1 selectionPosition 'pelvis' select 2) + (getpos %1 select 2)], 1, 1, 0, 'Target', 0, 0.03, 'TahomaB']}] call BIS_fnc_addStackedEventHandler; %1 addEventHandler ['Killed',{['Target%1', 'onEachFrame'] call BIS_fnc_removeStackedEventHandler;}]; ",[ _unit ] call BIS_fnc_objectVar]; Note the I have some pretty deliberate distance fade in there - (0 max (1 - ((player distance %1)/300)^0.387)) - which can be substituted for 0.5, and memPoint selection so the target isn't on ground but this wouldn't work on e.g. tanks, so if you want that to be universal then change [(%1 selectionPosition 'pelvis' select 0) + (getpos %1 select 0), (%1 selectionPosition 'pelvis' select 1) + (getpos %1 select 1), (%1 selectionPosition 'pelvis' select 2) + (getpos %1 select 2)] for getPos %1. Writing a spotting function should be easy. Use AddEventHandler to check for player pressing T which would then execute this: if (side cursorTarget == east) then {[cursorTarget] execVM "drawIcon.sqf"}; You'd also need to store the targets in an array and check if they're already targeted (allowing you to limit the number of targets, untarget them and prevent you from targeting them multiple times). Share this post Link to post Share on other sites
lightspeed_aust 681 Posted July 28, 2016 so how would i set this up then plz - id like to test it out. Share this post Link to post Share on other sites
theend3r 83 Posted July 28, 2016 (edited) I wrote how. If you want me to do everything then sorry, but I won't. For starters, try saving this updated code: _unit = _this select 0; call compile format[" ['Target%1', 'onEachFrame', {drawIcon3D ['\A3\ui_f\data\map\markers\nato\o_unknown.paa', [1,0,0,0.5], %1 modelToWorld [0,0,1.3], 1, 1, 0, '', 0, 0.03, 'TahomaB']}] call BIS_fnc_addStackedEventHandler; %1 addEventHandler ['Killed',{['Target%1', 'onEachFrame'] call BIS_fnc_removeStackedEventHandler;}]; ",[ _unit ] call BIS_fnc_objectVar]; as drawIcon.sqf in your mission folder and put _nul = [this] execVM "drawIcon.sqf" in the enemy's init to see if it works at all. Writing the drawIcon3D mess is the worst part of the whole task, you should be able to figure out the rest. Edit: This should enable the player to mark enemies marking = (findDisplay 46) displayAddEventHandler["KeyDown","if ((_this select 1 == 20) and (side cursorTarget == east)) then {_nul = [cursorTarget] execVM 'drawIcon.sqf'}"]; and this would disable it (findDisplay 46) displayRemoveEventHandler ["KeyDown", marking]; but you still need to keep an array of the targets and add some condition if you want to limit the number or duration of the targets, which is really recommended. Edited July 28, 2016 by theend3r Share this post Link to post Share on other sites
lightspeed_aust 681 Posted July 30, 2016 I'll give it a go thanks Share this post Link to post Share on other sites
cyborg111 32 Posted March 13, 2019 _trg = createTrigger ["EmptyDetector",[worldsize,worldsize],false]; _trg setTriggerActivation ["ANY","PRESENT",true]; _trg setTriggerTimeout [0,0,0,true]; _trg setTriggerStatements ["!isNull getConnectedUAV player && UAVControl getConnectedUAV player isEqualTo [player,'GUNNER'] && (!isNull cursorObject) && (getConnectedUAV player distance2d cursorObject < 2000) && isNil {getConnectedUAV player getVariable 'ccg_spot_action'}","getConnectedUAV player setVariable ['ccg_spot_action',(getConnectedUAV player) addAction [format ['<t size=%1 font=%4 shadow=%2 color=%3>Spot Target</t>',str '1.1',str '1.5',str '#EEEEEE',str 'PuristaBold'],{['NONAME',cursorObject,1] call CCG_fnc_makeUserMarker;hintSilent 'Target is marked on map'},[],50000,true,true,'','_this == gunner _target && side cursorObject in [west,east,resistance]']]",""];CCG_fnc_makeUserMarker = { params [["_name","NONAME",[""]],["_pos",[0,0],[[],objNull]],["_channel",3,[0]],["_global",true,[true]],["_color","ColorRed",[""]],["_alpha",1,[0]],["_shape","ICON",[""]],["_type","hd_dot",[""]],["_text","NOTEXT",[""]],["_size",[1,1],[[]]],["_dir",0,[0]],["_brush","Solid",[""]]]; private ["_dest","_mkr"]; if (typeName _pos == "OBJECT") then {_type = (format ["%1%2",(switch (side _pos) do { case WEST:{"b_"}; case EAST:{"o_"}; default {"n_"}; }), (switch (true) do { case (_pos iskindof "Ship"): {"naval"}; case (_pos iskindof "Plane"): {"plane"}; case (_pos iskindof "Helicopter"): {"air"}; case ((tolower (gettext (configfile >> "CfgVehicles" >> (typeof _pos) >> "vehicleClass"))) == "menrecon"): {"recon"}; case (_pos iskindof "CAManBase"): {"inf"}; case ({tolower typeof _pos find _x != -1} count ["aa","radar"] > 0): {"antiair"}; case ({tolower typeof _pos find _x != -1} count ["arty","mlr","mrl"] > 0): {"art"}; case ({tolower typeof _pos find _x != -1} count ["med"] > 0): {"med"}; case ((tolower (gettext (configfile >> "CfgVehicles" >> (typeof _pos) >> "vehicleClass"))) == "support"): {"support"}; case (_pos iskindof "Car"): {"motor_inf"}; case (_pos iskindof "Tank"): {"armor"}; case (_pos iskindof "StaticMortar"): {"mortar"}; case (_pos iskindof "Static"): {"installation"}; default {"unknown"}; })]); _color = (switch (side _pos) do { case WEST:{"ColorWEST"}; case EAST:{"ColorEAST"}; case CIVILIAN:{"ColorCIV"}; default {"ColorGUER"}; }); private _time = (daytime call BIS_fnc_timeToString) splitString ":"; _text = (_time # 0 + ":" + _time # 1); private _bear = getdir _pos; private _speed = speed _pos; if (speed _pos > 3) then {_text = _text + (switch (true) do { case (_speed > 50): {" fast "}; case (_speed > 10): {" slow "}; default {" walk "}; }) + (switch (true) do { case (_bear > 22.5 && _bear < 67.5): {"NE"}; case (_bear > 67.5 && _bear < 112.5): {"E"}; case (_bear > 112.5 && _bear < 157.5): {"SE"}; case (_bear > 157.5 && _bear < 202.5): {"S"}; case (_bear > 202.5 && _bear < 247.5): {"SW"}; case (_bear > 247.5 && _bear < 292.5): {"W"}; case (_bear > 292.5 && _bear < 337.5): {"NW"}; default {"N"}; })}; }; _global = (if (_global) then {""} else {"Local"}); _pos = (if (typeName _pos == "ARRAY") then {if (count _pos > 2) then {[_pos select 0,_pos select 1]} else {_pos}} else {[(position _pos) select 0,(position _pos) select 1]}); _name = (if (_name == "NONAME") then {format ["_USER_DEFINED #%1/%2/%3",clientOwner,(selectMin ([0] + (allmapmarkers select {_x find (format ["#%1/",clientowner]) != -1} apply {parsenumber ((_x splitString "/") # 1)})) - 1),_channel]} else {_name}); _dest = [_name,_pos]; call compile format [" _mkr = createMarker%1 %2; _mkr setMarkerSize%1 %6; _mkr setMarkerShape%1 '%3'; if ('%3' in ['RECTANGLE','ELLIPSE']) then {_mkr setMarkerBrush%1 '%4'}; if ('%3' == 'ICON') then {_mkr setMarkerType%1 '%5'}; _mkr setMarkerColor%1 '%7'; _mkr setMarkerAlpha%1 %8; if ('%9' != 'NOTEXT') then {_mkr setMarkerText%1 '%9'}",_global,_dest,_shape,_brush,_type,_size,_color,_alpha,_text]; if (_dir != 0) then {if (count toArray _global > 0) then {_mkr setMarkerDirLocal _dir} else {_mkr setMarkerDir _dir}}; _mkr; }; 2 Share this post Link to post Share on other sites