GetCreatureHomeWaypoint

From NWN Lexicon


Contents

[edit] GetCreatureHomeWaypoint()

Get a creature's home waypoint; returns OBJECT_INVALID if none set.

[edit] Description

Get a creature's home waypoint; returns OBJECT_INVALID if none set.



[edit] Remarks

Checks the calling object for the animation condition flag "NW_ANIM_FLAG_HAS_HOME". If the flag is found, then this function returns the local object stored in "NW_ANIM_HOME".

Returns the object stored in "NW_ANIM_HOME" on success and OBJECT_INVALID on failure.

[edit] Requirements

#include " x0_i0_anims "


[edit] Version

???

[edit] Example

// Checks the calling critter for a home waypoint.  If one is found, move the
// critter to it.
#include "x0_i0_anims"
 
void main()
{
    // Check the critter for a home waypoint.
    object oHomeWP = GetCreatureHomeWaypoint();
 
    // Verify we have a good waypoint to jump to then move 'em.
    if(GetIsObjectValid(oHomeWP))
    {
        AssignCommand(OBJECT_SELF, ActionJumpToObject(oHomeWP));
    }
}

[edit] See Also

functions: 

SetCreatureHomeWaypoint



author: Baragg, editor: Mistress, contributor: Kookoo

Personal tools
Categories