GetEnteringObject

From NWN Lexicon
Revision as of 10:12, 21 August 2012 by Dood (talk | contribs) (Created page with "=GetEnteringObject()= Gets the object that last opened or entered the calling object. object  GetEnteringObject(); ====Description==== Returns the o...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

GetEnteringObject()

Gets the object that last opened or entered the calling object.

 object  GetEnteringObject();

Description

Returns the object that last opened or entered the calling object.
The value returned by this function depends on the object type of the caller: (1) If the caller is a door or placeable it returns the object that last triggered it. (2) If the caller is a trigger, area of effect, module, area or encounter it returns the object that last entered it.
Return value on error: OBJECT_INVALID.



Version

1.22

Example

// Greet any Players that come into a trigger set around a drunk in a tavern.

void main()
{
    if(GetIsPC(GetEnteringObject()))
    {
        AssignCommand(GetNearestObjectByTag("TavernPatron"),SpeakOneLinerConversation("DrunkGreeting"));
        AssignCommand(GetNearestObjectByTag("TavernPatron"),ActionPlayAnimation(ANIMATION_LOOPING_PAUSE_DRUNK));
    }
}

See Also

functions: 

GetExitingObject

events: 

OnUsed Event



 author: John Shuell, editor: Kristian Markon