GetCurrentInteractionTarget

From NWN Lexicon


Contents

[edit] GetCurrentInteractionTarget()

Get the caller's current interaction target.

[edit] Description

Get the caller's current interaction target.



[edit] Remarks

Returns the local object stored in "NW_ANIM_TARGET". If not found returns OBJECT_INVALID.

[edit] Requirements

#include " x0_i0_anims "


[edit] Version

???

[edit] Example

// Find out what object we are interacting with and do different things depending on the type of object it is.
#include "x0_i0_anims"
 
void main()
{
    // Get what object the caller is interacting with.
    object oThing = GetCurrentInteractionTarget();
 
    // Validate that the caller has a current interaction object.
    if(OBJECT_INVALID != oThing)
    {
        // Figure out what type of object it is.
        int nType = GetObjectType(oThing);
 
        // Do different things depending on the object's type.
        switch(nType)
        {
            case OBJECT_TYPE_CREATURE:
                // Do creature related stuff here.
                break;  
            case OBJECT_TYPE_PLACEABLE:
                // Do placeable related stuff here.
                break;
            // ...    
            // List other object types that you might want here as additional case statements.  
            // ...    
            default:
                // Generically deal with any other object types here if you want.
                break;            
        }
    }
}

[edit] See Also

functions: 

SetCurrentInteractionTarget



author: Baragg, editor: Mistress

Personal tools
Categories