GetDistanceToObject(object, object)

From NWN Lexicon
Jump to navigationJump to search

The distance from one object to another object in meters.

float GetDistanceToObject(
    object oObject,
    object oFrom = OBJECT_SELF
);

Parameters

oObject
A valid object variable describing the object you wish to measure the distance to.
oFrom
A valid object variable describing the object you wish to measure the distance from (default: OBJECT_SELF).

Description

Returns the distance from the caller of the script to the object in meters. Return value is a float of -1.0 if the object to measure to is INVALID.


Remarks

The measurement taken will be from whatever in game object is calling this script.

Note that it of course can be invalid (-1.0) if they are in different areas, one object is not something that has a distance (Area's, module's), although items probably return the distance to the person that possess it (if it is possessed by a creature).


Version

This function was updated in 1.89.8193.37 of NWN:EE. VM: Added oFrom parameter to GetDistanceToObject().


See Also

functions: 

GetDistanceBetweenLocations



 author: John Shuell, editor: Jasperre