Jump to content
Sign in to follow this  
zapat

EYE - script visualizing all units on map

Recommended Posts

Dunno, if someone use it useful, I made this short script, and I am using it now all the time, when testing a mission.

The script simply shows and follows all units on map as markers. Best to use for larger scale dynamic missions.

It is not tested under MP environment, but I am still releasing to anyone who would need such.

Best way to use it is to save it as sqf, then

player addaction ["eye", "saved.sqf"];

And the code:

/*
EYE 1.0
Author: Zapat

Shows all units on map in a relatively system friendly way.
Dot: infantry
Rectangle: ground vehicles
Triangle: air vehicles

Blue: west
Red: east
Black: civilian OR damaged in movement thus left vehicle

Green: player
Yellow: player's team
*/

//you can turn on and off the EYE by the following Global Variable 
EYE_run = true;


player sideChat "EYE is running";
EYE_targets_obj = [];
EYE_markers_str = [];

//data handler
[] spawn 
{
   while {EYE_run} do
   {
       sleep 2;

       EYE_targets_obj = position player nearEntities [["LandVehicle","Air","CAManBase"], 20000];

       EYE_targets_str = [];
       {
           EYE_targets_str set [count EYE_targets_str, format["%1",_x]];
       }foreach EYE_targets_obj;

       _deleted = EYE_markers_str - EYE_targets_str;

       {
           deleteMarker _x;
           EYE_markers_str = EYE_markers_str - [_x];
       }foreach _deleted;
   };

   player sideChat "EYE thread 1 finished" ;
};

//visualiser
[] spawn
{
   while {EYE_run} do
   {
       sleep 0.1;
       {
           if (!isNull _x) then
           {
               _marker = format["%1",_x];
               //create marker
               if (getMarkerType _marker == "") then
               {
                   _m = createMarker[_marker,position _x];

                   _m setMarkerShape "ICON";

                   if (_x isKindof "CAManBase") then {_m setMarkerType "DOT";};
                   if (_x isKindof "LandVehicle") then {_m setMarkerType "mil_box";};                    
                   if (_x isKindof "Air") then {_m setMarkerType "mil_triangle";};

                   if (side _x == east) then {_m setMarkerColor "ColorRed";};
                   if (side _x == west) then {_m setMarkerColor "ColorBlue";};

                   if (_x in units group player) then {_m setMarkerColor "ColorYellow";};
                   if (_x == player) then {_m setMarkerColor "ColorGreen";};

                   EYE_markers_str set [count EYE_markers_str, _marker];
               }
               //update marker
               else
               {
                   _marker setMarkerPos position _x;
                   if (getMarkerColor _marker != "ColorBlack" && (!alive _x || !canMove _x) ) then {_marker setMarkerColor "ColorBlack"};
               };
           };
       }foreach EYE_targets_obj;
   };

   {
       deleteMarker _x;
   }foreach EYE_markers_str;
   player sideChat "EYE thread 2 finished" ;
};

  • Like 2

Share this post


Link to post
Share on other sites

Very useful when I'm not using VTS to monitor units!

Here's a thing - what about IF you click on a dot (unit) then you jump to viewing that unit?

I remember seeing a script that put coloured lines above units to show their active state (careless, aware, danger, engaged etc) - that would be good for monitoring how units are reascting to their environment.

EDIT: Did you ever see SPON_MAP? That would be a superb thing to try and emulate :)

Share this post


Link to post
Share on other sites

Good ideas Kremator! I went for performance with this one: it doesn't drop an fps when I have like 300 units around, and I've had great fun with it. :)

Haven't seen SPON_MAP before, nor bumped into anything like EYE. It might be me not being around for that long though. :)

thanks for the tips! :)

Share this post


Link to post
Share on other sites

Just for anyone who comes across this for ARMA 3:

It works, but you have to change one line of code. You must go into the saved.sqf file and hit ctrl+f and type in {_m setMarkerType "dot";}; 

You need to change "DOT" to "HD_DOT". Otherwise the infantry will not show up on the map.

Otherwise very useful script!

  • Like 1

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×