It works with this code in the trigger (
thanks to Celery!):
To identify the trigger activator ("_x") of a certain enemy group:Condition line: true
Activation line: 0=[] spawn {while {alive Dude} do {{if (Dude knowsAbout _x > 0.0002) then {[_x] execVM "engage.sqf"}} forEach units enemygrp; sleep 1}};
To identify the trigger activator ("_x") in a trigger area that covers all possible units:Condition line: true
Activation line: 0=[] spawn {while {alive Dude} do {{if (Dude knowsAbout _x > 0.0002) then {[_x] execVM "engage.sqf"}} forEach list triggername; sleep 1}};
-> The trigger that covers all units has to be set to Activate by Anybody.
With this codes and a "engage.sqf" script which I'll post under this you can make the AI ("Dude") recognize the enemy in the dark night without having to set a trigger for every possible enemy unit...
engage.sqf
_enemy = _this select 0;
dude reveal _enemy;
dude addweapon "NVGoggles";
sleep 0.1;
dude reveal _enemy;
dude lookat _enemy;
sleep 1;
dude removeweapon "NVGoggles";
dude reveal _enemy;
sleep 5;
dude reveal _enemy;
if (true) exitWith {};
(I still didn't find another way without adding the NVGs for 1 second...)