findNearestEnemy works off the knowsAbout rating, which apparently only works if both units are local, so in a SP mission this would probably work, but in multiplayer I think you’re going to run into a lot of problems.
This seems to work at first blush for Single Player at least:
In your OPFOR group leaders put this:
Code:
{_x disableAI "TARGET"; _x disableAI "AUTOTARGET"; _x setBehaviour "CARELESS"} foreach units group this;
Then in a trigger put this:
Condition:
Code:
(player findNearestEnemy position player) distance player < 30
OnAct:
Code:
op = (player findNearestEnemy position player);{_x enableAI "TARGET"; _x enableAI "AUTOTARGET"; _x setBehaviour "COMBAT"} forEach units group op;
You’ll be able to walk around and be ignored till you get within 30m of a target, at which point their group will give you the whatfor.