To build an 'invisible detector' or 'line of sight', your enemys need 2 pieces of information ( theese parameters determine the shape of the detector, and should be stored in Enemies Alterable Values ):
1 - ViewRadius_ ( A view radius )
2 - ViewAngle_ ( A view angle )

...
Your enemies need to allways remember 2 things ( theese 'must' be stored in enemys Alterable Values ):
1 - DistToPlayer_ ( How far away in pixels they are from the player )
2 - DirDiffToPlayer_ ( The 'absolute' ( possitive numbers only ) difference between 2 angles, ( 1 ) Enemies current facing angle/ direction, and ( 2 ) the angle between Enemies position and the Players position )
The Advanced Direction Object can do theese calcuations using the functions:
Dist
DirDiffAbs
...
Now lets say your Enemies should have a 'View Radius' of 150 pixels
and a 'View Angle' of 90 degrees, you only need to do 2 thing ( Event Editor ) :
( 1 )
Allways
- Enemy set Flag0 OFF
( 2 )
If DistToPlayer_ is lower or equal ViewRadius_
+ If DirDifToPlayer_ is lower or equal ViewAngle_
- Enemy set Flag0 ON
When Flag0 is OFF the enemy is not seeing the Player, if Flag0 is ON the enemy is seeing the player