Jump to content
Sign in to follow this  
Solores

How to make all AI in your faction or player seen on the map

Recommended Posts

How to make all AI in your faction or player seen on the map?

Share this post


Link to post
Share on other sites

Put this in your init.sqf file

nul = [] execVM "PlayerMarkers.sqf";

And this is the PlayerMarkers.sqf

// Put this in your init.sqf
// nul = [] execVM "PlayerMarkers.sqf";

[] spawn { 

while {true} do {


 _unitNumber = 0; 
 {
   private ["_marker"];

   _unitNumber = _unitNumber + 1;
   _marker = format["um%1",_unitNumber];    
   if((getMarkerType _marker) == "") then {
   	createMarkerLocal[_marker,getPos (vehicle _x)];
   } else {
     _marker setMarkerPosLocal (getPos (vehicle _x));
   };

   if(alive _x) then {
    	_marker setMarkerColorLocal "ColorGreen";
    	_marker setMarkerTypeLocal "mil_triangle";
    	_marker setMarkerSizeLocal [0.5,1];
   } else {      
    	_marker setMarkerColorLocal "ColorRed";
    	_marker setMarkerTypeLocal "DestroyedVehicle";
    	_marker setMarkerSizeLocal [0.7,0.7];  
   };

 	//_marker setMarkerTextLocal parseText format["<t size='0.7'>%1</t>",(name _x)];
   _marker setMarkerTextLocal (name _x);
   _marker setMarkerDirLocal (getDir (vehicle _x));

 } forEach playableUnits;

 _unitNumber = _unitNumber + 1;
 _marker = format["um%1",_unitNumber];

 /*while {(getMarkerType _marker) == ""} do {
   deleteMarkerLocal _marker;
   _unitNumber = _unitNumber + 1;
   _marker = format["um%1",_unitNumber];
 }; */



 sleep 0.5;

}; 
};

N.B. Not my script, but there was no credits in it.

Share this post


Link to post
Share on other sites

This one shows all friendly units (including AI) in blue and squad mates in green.

Also fixed marker removal, so unused markers are removed.

[] spawn { 
 private ["_marker", "_unitNumber"];  
 while {true} do {


   _unitNumber = 0; 
   {
     if(side _x == playerSide) then {

       _unitNumber = _unitNumber + 1;
       _marker = format["um%1",_unitNumber];    
       if((getMarkerType _marker) == "") then {
       	createMarkerLocal[_marker,getPos (vehicle _x)];
       } else {
         _marker setMarkerPosLocal (getPos (vehicle _x));
       };

       if(alive _x) then {
         if(group _x == group player) then {
           _marker setMarkerColorLocal "ColorGreen";
         } else {
           _marker setMarkerColorLocal "ColorBlue";
         };
         _marker setMarkerTypeLocal "mil_triangle";
         if(_x == player) then {
           _marker setMarkerSizeLocal [0.8,1];
         } else {
           _marker setMarkerSizeLocal [0.5,0.7];
         };
       } else {      
         _marker setMarkerColorLocal "ColorRed";
         _marker setMarkerTypeLocal "DestroyedVehicle";
         _marker setMarkerSizeLocal [0.7,0.7];  
       };
       if(vehicle _x == _x) then {
         _marker setMarkerTextLocal (name _x);
       } else {
         _marker setMarkerTextLocal format["%1 (%2)", name _x, getText(configFile>>"CfgVehicles">>(typeOf(vehicle _x))>>"DisplayName")];
       };
       _marker setMarkerDirLocal (getDir (vehicle _x));
     }; 
   } forEach playableUnits;

   _unitNumber = _unitNumber + 1;
   _marker = format["um%1",_unitNumber];

   while {(getMarkerType _marker) != ""} do {
     deleteMarkerLocal _marker;
     _unitNumber = _unitNumber + 1;
     _marker = format["um%1",_unitNumber];
   };


   sleep 0.5;

 }; 
};

Edited by aeroson

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  

×