My general plan is this:
- Mission setup:
On init:
Code: Select all
{_x setCaptive true} forEach units group player;
EnemyWeaponSpottingDistance = 100;
- Detection trigger (one per player):
Condition:
Code: Select all
({side _x == guer} count ((position player1) nearEntities EnemyWeaponSpottingDistance)) > 0
Code: Select all
player1 setVariable ["PlayerWeaponsSpotted", true, true];
Condition:
Code: Select all
PlayerWeaponsSpotted
Code: Select all
{_x setCaptive false} forEach units group player;
This should do the trick, as far as I can tell, even in MP (with the setVariable thing, right?). The problem is, I never seem to trigger the Detection trigger, unless I remove the {side _x == guer} part. Any idea why?
Edit:
Also, is there a way to use knowsAbout without having to have the AI actually fire at me or acting as if I'm the enemy? When I've got setCaptive, knowsAbout for all enemies seems to be 0, the same goes for when I've got the two sides friendly to each other. It would be good to have the ability to check whether the AI patrols and sentries actually see and know about the players too...