Library for playing random animations.

NOTE: This file includes x0_i0_modes, x0_i0_position, x0_i0_voice, and x0_i0_walkway.


NameValueBrief Description
ANIM_CONVERSATIONx0_npc_homeconvConversation file that holds the random one-liners for NPCs to speak when a PC comes into their home.
NW_ANIM_FLAG_CHATTER0x00000004If set, the NPC will use voicechats.
NW_ANIM_FLAG_CONSTANT0x00000002If set, the NPC will animate on every OnHeartbeat event. Otherwise, the NPC will animate only on every OnPerception event.
NW_ANIM_FLAG_CLOSE_DOORS0x00001000If set, the NPC will close doors
NW_ANIM_FLAG_HAS_HOME0x00000040If set, the NPC has a home waypoint
NW_ANIM_FLAG_INITIALIZED0x00000001If set, the NPC has been initialized.
NW_ANIM_FLAG_IS_ACTIVE0x00000008If set, the NPC has been triggered and should be animating.
NW_ANIM_FLAG_IS_CIVILIZED0x00000400If set, the NPC is civilized
NW_ANIM_FLAG_IS_INSIDE0x00000020If set, the NPC has gone inside an interior area.
NW_ANIM_FLAG_IS_INTERACTING0x00000010If set, the NPC is currently interacting with a placeable
NW_ANIM_FLAG_IS_MOBILE0x00000100If set, the NPC is mobile
NW_ANIM_FLAG_IS_MOBILE_CLOSE_RANGE0x00000200If set, the NPC is mobile in a close-range
NW_ANIM_FLAG_IS_TALKING0x00000080If set, the NPC is currently talking
sAnimCondVarnameNW_ANIM_CONDITIONVariable that holds the animation flags.


NameBrief Description
AnimActionChallengeIntruderChallenges a PC from an NPC if they have not yet been challenged.
AnimActionCloseRandomDoorCauses an NPC to close a nearby open door.
AnimActionFindFriendCauses an NPC to find a friend and engage in conversation with them.
AnimActionFindPlaceableFind a placeable within the given distance and interact with it.
AnimActionGetUpFromChairGet up from a chair if we're sitting.
AnimActionGoHomeIf it is night, go back to our home waypoint, if we have one. This is only meaningful for mobile NPCs who would have left their homes during the day.
AnimActionGoInsideGo through a nearby door if appropriate.
AnimActionGoOutsideLeave area if appropriate.
AnimActionGoThroughDoorInternal function. Go through a door and close it behind you, then walk a short distance away.

This assumes the door exists, is unlocked, etc.
AnimActionGoToStopGo to a nearby waypoint or placeable marked with the tag "NW_STOP".
AnimActionLeaveHomeIf it is day, leave our home area, if we have one. This is only meaningful for mobile NPCs.
AnimActionLookAroundPlay animation of looking around to left and right.
AnimActionPlayRandomAnimationPlay a random animation.
AnimActionPlayRandomBasicAnimationPlay a random animation that all creatures should have.
AnimActionPlayRandomCloseRangePerform a random close-range action.
AnimActionPlayRandomGoodbyePlay a random farewell animation and possibly voicechat.
AnimActionPlayRandomGreetingPlay a greeting animation and possibly voicechat.
AnimActionPlayRandomImmobilePerform a strictly immobile action.
AnimActionPlayRandomInteractAnimationInteract with a placeable object.
AnimActionPlayRandomMobilePerform a mobile action.
AnimActionPlayRandomTalkAnimationPlay a random talk gesture animation.
AnimActionPlayRandomUncivilizedPerform a mobile action for an uncivilized creature.
AnimActionRandomMoveAwayRandomly move away from an object the specified distance.
AnimActionRestIf injured find the best place to rest, based on the mobility setting, and go rest there.
AnimActionShakeHeadPlay animation of shaking head "no" to left and right.
AnimActionSitInChairSit in a random nearby chair if available.
AnimActionStartInteractingStart interacting with a placeable object.
AnimActionStartTalkingStart talking with a friend.
AnimActionStopInteractingStop interacting with a placeable object.
AnimActionStopTalkingStop talking to the given friend.
AnimActionTurnAroundTurn around to face a random direction.

NOTE: The contents of this function have been commented out. So it will do nothing when called.
AnimDebugDebugging function.

NOTE: The contents of this function have been commented out. So it will do nothing when called.
AnimInitializationGeneral initialization for animations.
CheckCurrentActionCheck to see if we're in the middle of some action so we do not interrupt or pile actions onto the queue.
CheckCurrentModesCheck to see if we should switch on or off the detect or stealth modes.
CheckIsAnimActiveTurns off the calling object's NW_ANIM_FLAG_IS_ACTIVE animation condition if there are no players in the same area.
CheckIsCivilizedMarks the caller as civilized based on its racialtype.
GetAnimationConditionReturns TRUE if the given creature has the given condition set.
GetCreatureHomeWaypointGet a creature's home waypoint; returns OBJECT_INVALID if none set.
GetCurrentFriendGet the caller's current friend.
GetCurrentInteractionTargetGet the caller's current interaction target.
GetIsBusyWithAnimationReturns TRUE if the creature is busy talking or interacting with a placeable or GetCurrentAction does not return ACTION_INVALID.
GetRandomFriendGet a random nearby friend within the specified distance limit, that isn't busy doing something else.
GetRandomObjectByTagGet a random nearby object within the specified distance with the specified tag.
GetRandomObjectByTypeGet a random nearby object within the specified distance with the specified type.
GetRandomStopReturns a randomly selected object with the tag "NW_STOP" that is within the area of the calling object.
PlayImmobileAmbientAnimationsMakes a creature act out some animations where they stand to look more lifelike.
PlayMobileAmbientAnimations_AvianAvian creatures will fly around randomly.
PlayMobileAmbientAnimations_NonAvianUsed for mobile NPCs and monsters other than avian ones.
SetAnimationConditionMark that the given creature has the given condition set.
SetCreatureHomeWaypointCheck for a waypoint marked NW_HOME in the area; if it exists, mark it as the caller's home waypoint.
SetCurrentFriendSet a specific creature as the caller's friend.
SetCurrentInteractionTargetSet an object as the caller's interactive target.

 author: Charles Feduke, editor: Mistress, Baragg, contributor: Kookoo