GetCreatureHomeWaypoint
From NWN Lexicon
Jump to navigationJump to search
GetCreatureHomeWaypoint()
Get a creature's home waypoint; returns OBJECT_INVALID if none set.
Description
Get a creature's home waypoint; returns OBJECT_INVALID if none set.
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.
Requirements
#include " x0_i0_anims "
Version
???
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));
}
}
// 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));
}
}
See Also
functions: |
author: Baragg, editor: Mistress, contributor: Kookoo