Skip to content

Instantly share code, notes, and snippets.

@commy2
Last active March 19, 2018 10:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save commy2/4f24be8714f2f998b60f208f916d40ea to your computer and use it in GitHub Desktop.
Save commy2/4f24be8714f2f998b60f208f916d40ea to your computer and use it in GitHub Desktop.
_this spawn {
params [
["_mortar", objNull, [objNull]],
["_allSpotters", [], [[]]]
];
private _fnc_enemiesKnownByAnySpotter = {
private _enemies = allUnits select {side group _x == west};
// all enemies that are ...
_enemies select {
private _enemy = _x;
// ... known by any spotter
selectMax (_allSpotters apply {_x knowsAbout _enemy}) > 0.9
} // return
};
// wait for at least one spotted target
private _targets = [];
waitUntil {
sleep 10;
_targets = call _fnc_enemiesKnownByAnySpotter;
!(_targets isEqualTo [])
};
private _target = selectRandom _targets;
//@todo fire _mortar at _target
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment