LineOfSightObject
From NWN Lexicon
Contents |
[edit] LineOfSightObject(object, object)
Is there a line of sight between two objects
int LineOfSightObject( object oSource, object oTarget );
[edit] Parameters
oSource
Source object
oTarget
Target object
[edit] Description
Returns whether or not there is a direct line of sight between the two objects. (Not blocked by any geometry).
PLEASE NOTE: This is an expensive function and may degrade performance if used frequently.
[edit] Remarks
With this function came a fix to GetFirst/NextObjectInShape, and makes sure fireballs do not go through walls or doors.
This is hardly ever needed practically - for spell scripts, it is not required unless an area-of-effect spell doesn't use GetFirst/NextObjectInShape, because the game already has internal restraints on Line-Of-Sight checks.
[edit] Version
1.61
[edit] Example
//Can I see bob? void main() { object oTarget=GetObjectByTag("bob"); int bCanISee=LineOfSightObject(OBJECT_SELF, oTarget); }
[edit] See Also
functions: |
author: Lilac Soul, editor: Jasperre