ArmaMan360 94 Posted November 13, 2015 I need a script which I can call from Radio Alpha to see if any units are left in a town. They sometimes run to the remote corners of the marker area and you gotta spend 40 minutes finding that last guy to clear the area. I tried a lot of different approaches but they would turn the markers on permanently. I just want to have a brief idea of where they at for 5-6 seconds. I came across a script that would highlight a small block of area as enemy side colour so one can easily find guys there without exact pinpointing their location. But its code is so loooong I fear lag. Hence I want it to run only when I execute radio call. Any simpler way of revealing enemy units expected positions? to the, lets say, nearest 50 mtrs? Thank you :) Share this post Link to post Share on other sites
R3vo 2654 Posted November 13, 2015 _nearestUnits = nearestObjects [player, ["man"], 50]; for "_i" from 0 to (count _nearestUnits) - 1 do { _unit = _nearestUnits select _i; if (side _unit != playerSide) then { _marker = createMarker [format ["tempMarker_%1",_i], _unit]; (format ["tempMarker_%1",_i]) setMarkerType "o_unknown"; }; sleep 1; }; sleep (random 6) + 5; for "_i" from 0 to (count _nearestUnits) - 1 do { deleteMarker format ["tempMarker_%1",_i]; sleep 1; }; Tell me what you think about that. Share this post Link to post Share on other sites
ArmaMan360 94 Posted November 13, 2015 (edited) _nearestUnits = nearestObjects [player, ["man"], 50]; for "_i" from 0 to (count _nearestUnits) - 1 do { _unit = _nearestUnits select _i; if (side _unit != playerSide) then { _marker = createMarker [format ["tempMarker_%1",_i], _unit]; (format ["tempMarker_%1",_i]) setMarkerType "o_unknown"; }; sleep 1; }; sleep (random 6) + 5; for "_i" from 0 to (count _nearestUnits) - 1 do { deleteMarker format ["tempMarker_%1",_i]; sleep 1; }; Tell me what you think about that. Wow thank you. But, I am sorry I didnt point it correctly in my original post. I actually need a marker over the alive AI enemy units narrowed down area to know their "expected position". Excuse me for the "nearest 50 mtr confusion". Or I can increase that count "50" in your script to something like 500? And for execution, i put this code in reveal.sqf and inside trigger Alpha init: nul = [] execVM "reveal.sqf"; Right? Edited November 13, 2015 by ArmaMan360 Share this post Link to post Share on other sites
R3vo 2654 Posted November 13, 2015 Oh okey, so you want to aprox position of the enemy unit with a radius of let's say 50m? /* Author: Revo Description: Reveals units which are not on the player's side Parameter(s): 0: number - Size of the area 1: object - Center of the area to search in 2: number - Delay between creation and deletion of markers 3: number - Tolerance of positions in meters Returns: - */ _radius = param [0,50]; _center = param [1,player]; _deleteTime = param [2,10]; _posTolerance = param [3,0]; _nearestUnits = nearestObjects [_center, ["man"], _radius]; systemChat "Scanning in progress..."; for "_i" from 0 to (count _nearestUnits) - 1 do { _unit = _nearestUnits select _i; if (side _unit != playerSide) then { _marker = createMarker [format ["tempMarker_%1",_i], [_unit, _posTolerance, random(360)] call BIS_fnc_relPos]; format ["tempMarker_%1",_i] setMarkerType "o_unknown"; format ["tempMarker_%1",_i] setMarkerColor "ColorUNKNOWN"; format ["tempMarker_%1",_i] setMarkerSize [0.5, 0.5]; }; sleep 1; }; systemChat format ["%1 hostile Entities found.",count _nearestUnits]; systemChat format ["Position tolerance: %1 m",_posTolerance]; sleep _deleteTime; for "_i" from 0 to (count _nearestUnits) - 1 do { deleteMarker format ["tempMarker_%1",_i]; sleep 1; }; Here's an updated version. 2 Share this post Link to post Share on other sites
ArmaMan360 94 Posted November 14, 2015 Yes Sir. Where can I buy you a dinner now? :P Share this post Link to post Share on other sites
R3vo 2654 Posted November 14, 2015 Yes Sir. Where can I buy you a dinner now? :P No need for a dinner I am happy when you are ;) Share this post Link to post Share on other sites
ArmaMan360 94 Posted November 15, 2015 R3vo your attention is needed here too. Please. Simple waypoint question. https://forums.bistudio.com/topic/177336-create-random-waypoints-on-roads/ Share this post Link to post Share on other sites
ArmaMan360 94 Posted November 16, 2015 By the way, R3vo that reveal enemy script you showed is finding wrong entities. And I am next to those spots but no enemies. Is it because the if (side _unit != playerSide) then ... searches for everything apart from playerside? Animals? Can I safely change this line to if (side _unit = WEST) then ... so that it only reveals units on west side? Thank you. Share this post Link to post Share on other sites
R3vo 2654 Posted November 16, 2015 Sure thing, if you only want to detect units of a specific side you can do that. Share this post Link to post Share on other sites
ArmaMan360 94 Posted November 16, 2015 Thanks :) Im sure this will help a lot of others.. :D Share this post Link to post Share on other sites
ppavia 10 Posted December 28, 2017 Hi it was a few night i searching for a script to detect presence of Explosives to allow civilian to give me infos. I try to modifie the script above, but for explosive its not the same things SO.... how can i detect explosive around me . To simulate a civilian info... i need to sleep maybe loooool Share this post Link to post Share on other sites