X0 i0 anims

From NWN Lexicon



[edit] x0_i0_anims

Library for playing random animations.<br /><br />NOTE: This file includes x0_i0_walkway.

[edit] Constants

Name Value Brief Description
ANIM_CONVERSATION x0_npc_homeconv Conversation file that holds the random one-liners for NPCs to speak when a PC comes into their home.
ANIM_LOOPING_LENGTH 4.0
ANIM_LOOPING_SPEED 1.0
NW_ANIM_FLAG_CHATTER 0x00000004 If set, the NPC will use voicechats.
NW_ANIM_FLAG_CONSTANT 0x00000002 If set, the NPC will animate on every OnHeartbeat event. Otherwise, the NPC will animate only on every OnPerception event.
NW_ANIM_FLAG_CLOSE_DOORS 0x00001000 If set, the NPC will close doors
NW_ANIM_FLAG_HAS_HOME 0x00000040 If set, the NPC has a home waypoint
NW_ANIM_FLAG_INITIALIZED 0x00000001 If set, the NPC has been initialized.
NW_ANIM_FLAG_IS_ACTIVE 0x00000008 If set, the NPC has been triggered and should be animating.
NW_ANIM_FLAG_IS_CIVILIZED 0x00000400 If set, the NPC is civilized
NW_ANIM_FLAG_IS_INSIDE 0x00000020 If set, the NPC has gone inside an interior area.
NW_ANIM_FLAG_IS_INTERACTING 0x00000010 If set, the NPC is currently interacting with a placeable
NW_ANIM_FLAG_IS_MOBILE 0x00000100 If set, the NPC is mobile
NW_ANIM_FLAG_IS_MOBILE_CLOSE_RANGE 0x00000200 If set, the NPC is mobile in a close-range
NW_ANIM_FLAG_IS_TALKING 0x00000080 If set, the NPC is currently talking
sAnimCondVarname NW_ANIM_CONDITION Variable that holds the animation flags.



[edit] Functions

Name Brief Description

AnimActionChallengeIntruder

Challenges a PC from an NPC if they have not yet been challenged.

AnimActionCloseRandomDoor

Causes an NPC to close a nearby open door.

AnimActionFindFriend

Causes an NPC to find a friend and engage in conversation with them.

AnimActionFindPlaceable

Find a placeable within the given distance and interact with it.

AnimActionGetUpFromChair

Get up from a chair if we're sitting.

AnimActionGoHome

If 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.

AnimActionGoInside

Go through a nearby door if appropriate.

AnimActionGoOutside

Leave area if appropriate.
AnimActionGoThroughDoor Internal function. Go through a door and close it behind you, then walk a short distance away.

This assumes the door exists, is unlocked, etc.

AnimActionGoToStop

Go to a nearby waypoint or placeable marked with the tag "NW_STOP".

AnimActionLeaveHome

If it is day, leave our home area, if we have one. This is only meaningful for mobile NPCs.

AnimActionLookAround

Play animation of looking around to left and right.

AnimActionPlayRandomAnimation

Play a random animation.

AnimActionPlayRandomBasicAnimation

Play a random animation that all creatures should have.

AnimActionPlayRandomCloseRange

Perform a random close-range action.

AnimActionPlayRandomGoodbye

Play a random farewell animation and possibly voicechat.

AnimActionPlayRandomGreeting

Play a greeting animation and possibly voicechat.

AnimActionPlayRandomImmobile

Perform a strictly immobile action.

AnimActionPlayRandomInteractAnimation

Interact with a placeable object.

AnimActionPlayRandomMobile

Perform a mobile action.

AnimActionPlayRandomTalkAnimation

Play a random talk gesture animation.

AnimActionPlayRandomUncivilized

Perform a mobile action for an uncivilized creature.

AnimActionRandomMoveAway

Randomly move away from an object the specified distance.

AnimActionRest

If injured find the best place to rest, based on the mobility setting, and go rest there.

AnimActionShakeHead

Play animation of shaking head "no" to left and right.

AnimActionSitInChair

Sit in a random nearby chair if available.

AnimActionStartInteracting

Start interacting with a placeable object.

AnimActionStartTalking

Start talking with a friend.

AnimActionStopInteracting

Stop interacting with a placeable object.

AnimActionStopTalking

Stop talking to the given friend.

AnimActionTurnAround

Turn around to face a random direction.

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

AnimDebug

Debugging function.

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

AnimInitialization

General initialization for animations.

CheckCurrentAction

Check to see if we're in the middle of some action so we do not interrupt or pile actions onto the queue.

CheckCurrentModes

Check to see if we should switch on or off the detect or stealth modes.

CheckIsAnimActive

Turns off the calling object's NW_ANIM_FLAG_IS_ACTIVE animation condition if there are no players in the same area.

CheckIsCivilized

Marks the caller as civilized based on its racialtype.

GetAnimationCondition

Returns TRUE if the given creature has the given condition set.

GetCreatureHomeWaypoint

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

GetCurrentFriend

Get the caller's current friend.

GetCurrentInteractionTarget

Get the caller's current interaction target.

GetIsBusyWithAnimation

Returns TRUE if the creature is busy talking or interacting with a placeable or GetCurrentAction does not return ACTION_INVALID.

GetRandomFriend

Get a random nearby friend within the specified distance limit, that isn't busy doing something else.

GetRandomObjectByTag

Get a random nearby object within the specified distance with the specified tag.

GetRandomObjectByType

Get a random nearby object within the specified distance with the specified type.

GetRandomStop

Returns a randomly selected object with the tag "NW_STOP" that is within the area of the calling object.

PlayImmobileAmbientAnimations

Makes a creature act out some animations where they stand to look more lifelike.

PlayMobileAmbientAnimations_Avian

Avian creatures will fly around randomly.

PlayMobileAmbientAnimations_NonAvian

Used for mobile NPCs and monsters other than avian ones.

SetAnimationCondition

Mark that the given creature has the given condition set.

SetCreatureHomeWaypoint

Check for a waypoint marked NW_HOME in the area; if it exists, mark it as the caller's home waypoint.

SetCurrentFriend

Set a specific creature as the caller's friend.

SetCurrentInteractionTarget

Set an object as the caller's interactive target.



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

Personal tools
Categories