Jump to content
Sign in to follow this  
celludriel

AI debug: show all of them on map

Recommended Posts

Hey,

 

I'm spawning a bunch of ai random on the map, but I like to debug this.  Is there an addon or script that will show all alive ai on the map ?  I've found a few hits on google but nothing concrete.  The best hit was something called devcon but I'm not sure about that one.

Share this post


Link to post
Share on other sites

Stick this in the init of your player.

 

player addaction ["eyeon", "eye.sqf"]; player addaction ["eyeoff", "EYE_run = false;"];

 

Save a file in your mission folder called eye.sqf then put this lot in it.

 

 
/*


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
Green: Independent
Black: civilian OR damaged in movement thus left vehicle


Orange: 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 "hd_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 "ColorOPFOR";};
                    if (side _x == west) then {_m setMarkerColor "ColorBLUFOR";};
           if (side _x == Independent) then {_m setMarkerColor "ColorIndependent";};
           //if (side _x == Civilian) then {_m setMarkerColor "ColorCivilian";};
                   


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


                    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

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×