Skip to content

Instantly share code, notes, and snippets.

@Fusselwurm
Last active December 17, 2015 00:09
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Fusselwurm/9862871 to your computer and use it in GitHub Desktop.
Save Fusselwurm/9862871 to your computer and use it in GitHub Desktop.
In ArmA, set a fuzzy marker on a player's position
private ["_markerPos", "_inner_marker", "_helper_marker"];
trackingPrecision = 50; //marker precision (radius)
gpsSleepTimeMin = 120;
gpsSleepTimeMax = 300;
_markerPos = (getPos _this);
_inner_marker = createMarker ["agentmarker", _markerPos];
_inner_marker setMarkerType "mil_unknown";
_inner_marker setMarkerColor "ColorRed";
_inner_marker setMarkerShape "ELLIPSE";
_inner_marker setMarkerSize [trackingPrecision, trackingPrecision];
_inner_marker setMarkerBrush "DIAGGRID";
_helper_marker = createMarker ["agentmarker2", _markerPos];
_helper_marker setMarkerType "mil_unknown";
_helper_marker setMarkerColor "ColorRed";
_helper_marker setMarkerShape "ELLIPSE";
_helper_marker setMarkerSize [1000, 1000];
_helper_marker setMarkerBrush "Border";
gps_sleep_time = {
gpsSleepTimeMin + floor(random(gpsSleepTimeMax - gpsSleepTimeMin))
};
randomize_coord = {
_this + random(trackingPrecision * 2) - trackingPrecision
};
randomize_pos =
{
private ["_randomizedPos", "_trueX", "_trueY"];
_trueX = _this select 0;
_trueY = _this select 1;
_randomizedPos = [
_trueX call randomize_coord,
_trueY call randomize_coord,
_this select 2
];
_randomizedPos
};
while {alive _this} do {
_markerPos = (getPos _this) call randomize_pos;
_inner_marker setMarkerPos _markerPos;
_helper_marker setMarkerPos _markerPos;
sleep (call gps_sleep_time);
};
_inner_marker setMarkerColor "ColorBlack";
_inner_marker setMarkerPos (getPos _this);
@GeorgeDettmer
Copy link

Thought I'd mention that someone had asked about using this script at /r/armadev and had also asked if it would be possible for this functionality for multiple units. Here is my adaptation of this script to allow for tracking of multiple units, the full conversation is available here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment