GetObjectSeen(object, object)

From NWN Lexicon
Jump to navigationJump to search

Determines whether an object sees another object.

int GetObjectSeen(
    object oTarget,
    object oSource = OBJECT_SELF
);

Parameters

oTarget
Object to determine if it is seen.
oSource
Object that is doing the looking. (Default: OBJECT_SELF)


Description

Determines whether oSource sees oTarget. Returns TRUE if oSource sees oTarget, FALSE otherwise. If oTarget is a placeable object, this function always returns FALSE.


Remarks

Only creatures are valid for oTarget and oSource. Any other type of object will return FALSE. The reason for this is because only creatures maintain perception lists.

LineOfSightObject can be assumed to be TRUE in the case oTarget is seen since you must have line of sight to have sight of something.

Note due to different perception ranges, invisibility, sanctuary and other effects just because oSource can or cannot see oTarget doesn't mean the opposite can be assumed.

This is also not required for OnPerception but may be useful (eg; if someone has become inaudiable due to EffectSilence, they might actually still be seen).

Version

1.64

See Also

functions:

GetObjectHeard LineOfSightObject

events: OnPerception Event



 author: Tom Cassiotis, editor: Jasperre, additional contributor(s): David Etheredge, Charles Feduke, Jasperre