GetObjectType(object)

From NWN Lexicon
Jump to: navigation, search

Determines what type the object is.

int GetObjectType(
    object oTarget
);

Parameters

oTarget
The object to find its type.

Description

Returns the object type (OBJECT_TYPE_*) of oTarget and 0 if oTarget is not a valid object.

Remarks

Returns OBJECT_TYPE_ALL or OBJECT_TYPE_INVALID (both are the same value) for sound objects.

Returns 0 for areas or modules (no constant defined/"invalid").

Known Bugs

This function doesn't return -1 on error as it claims in the function's description in the Script Editor. Nor does it return OBJECT_TYPE_INVALID for invalid objects. Return value on error is always 0.

Sound objects return OBJECT_TYPE_ALL and Area and Modules have no defined return value thus return 0.

Version

1.61

See Also

constants: 

OBJECT_TYPE_* Constants


 author: Tom Cassiotis, editor: Charles Feduke, additional contributor(s): Sunjammer