Author: punkatux
Author Website:

Requirements: No addons required

Version: 0.1

Short description: This script allows to track unit on map easily for debug purposes.

Date: 2012-08-12 18:59

Comments: (0)


Unit tracking script


This is simple "unitTrack.sqf" script which has 2 parameters - unit and delay. Script will show passed unit on the map in the color of unit's side. The information will be updated every delay count of seconds. After the unit dies, it changes color of its marker to black and ends the script.

_unit = _this select 0;
_delay = _this select 1;

_marker = createMarker[str _unit, getPos _unit];
_marker setMarkerShape "ICON";
_marker setMarkerType "DOT";

_color = switch (side _unit) do {
	case west : 		{"ColorBlue"};
	case east : 	  	{"ColorRed"};
	case resistance : 	{"ColorGreen"};
	default 		{"ColorPink";}

_marker setMarkerColor _color;

while {alive _unit} do {
	_marker setMarkerPos getPos _unit;
	sleep _delay;

_marker setMarkerColor "ColorBlack";

For updating some unit's position every 1 second type this in its init field:
nil = [this, 1.0] execVM "unitTrack.sqf"
For tracking an entire group type this in the leader's init field:
{nil = [_x, 1.0] execVM "unitTrack.sqf"} forEach units group this;

Enable javascript to be able to download from Armaholic please!

Tags: Tracking