These functions determines whether the calling object has line-of-sight to the referenced object. It does not seem to work for non-Actor type objects, as far as I could determine. It does not take facing into account, so don't take the "sight" part too literally. (See "Is she looking at me?" in the Tips and Tricks section.)
Note: GetLOS is a very slow function, don't let the script call it every frame.
Sample Script:
Begin balynScript
float timer
short doOnce
[…]; references to journal settings
Set timer to ( timer + GetSecondsPassed )
if ( timer < 5 ); A timer to avoid testing to often (avoids performance problems)
Return
endif
Set timer to 0
if ( doOnce == 0 )
if ( GetDistance Player <= 1024 )
if ( player->GetDistance "hlaalu_loaddoor_ 02_balyn" <= 256 )
if ( GetLOS Player == 1 )
ForceGreeting
Journal DA_Mephala 55
set doOnce to -1
endif
endif
endif
endif
End
Note:
getLOS and getLineOfSight suffer from the same problem with generic NPCs as getDetected (see below)