LineOfSightVector(vector, vector)

From NWN Lexicon
Jump to navigationJump to search

Returns whether there's a direct line between two positions.

int LineOfSightVector(
    vector vSource,
    vector vTarget
);

Parameters

vSource
Source position
vTarget
Target position

Description

Returns whether or not there is a direct line of sight between the two vectors. (Not blocked by any geometry).

This function must be run on a valid object in the area it will not work on the module or area.

PLEASE NOTE: This is an expensive function and may degrade performance if used frequently.

Remarks

Vectors are location markers - being a set of 3 co-ordinates (X, Y, Z), and so this can be used instead of LineOfSightObject() if the 2 objects just had their vector got by GetPosition(). Note that the Z position should be ground height + 1.0 if you wish to fully mimic LineOfSightObject.

The note about "run on a valid object in the area" is akin to it running GetArea(OBJECT_SELF) on the calling script. Why there isn't a parameter for an area to be passed in is anyones guess.

Version

1.61

See Also

functions: 

LineOfSightObject



 author: Lilac Soul, editor: Jasperre