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 |
---|---|
Challenges a PC from an NPC if they have not yet been challenged. | |
Causes an NPC to close a nearby open door. | |
Causes an NPC to find a friend and engage in conversation with them. | |
Find a placeable within the given distance and interact with it. | |
Get up from a chair if we're sitting. | |
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. | |
Go through a nearby door if appropriate. | |
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. |
Go to a nearby waypoint or placeable marked with the tag "NW_STOP". | |
If it is day, leave our home area, if we have one. This is only meaningful for mobile NPCs. | |
Play animation of looking around to left and right. | |
Play a random animation. | |
Play a random animation that all creatures should have. | |
Perform a random close-range action. | |
Play a random farewell animation and possibly voicechat. | |
Play a greeting animation and possibly voicechat. | |
Perform a strictly immobile action. | |
Interact with a placeable object. | |
Perform a mobile action. | |
Play a random talk gesture animation. | |
Perform a mobile action for an uncivilized creature. | |
Randomly move away from an object the specified distance. | |
If injured find the best place to rest, based on the mobility setting, and go rest there. | |
Play animation of shaking head "no" to left and right. | |
Sit in a random nearby chair if available. | |
Start interacting with a placeable object. | |
Start talking with a friend. | |
Stop interacting with a placeable object. | |
Stop talking to the given friend. | |
Turn around to face a random direction. NOTE: The contents of this function have been commented out. So it will do nothing when called. | |
Debugging function. NOTE: The contents of this function have been commented out. So it will do nothing when called. | |
General initialization for animations. | |
Check to see if we're in the middle of some action so we do not interrupt or pile actions onto the queue. | |
Check to see if we should switch on or off the detect or stealth modes. | |
Turns off the calling object's NW_ANIM_FLAG_IS_ACTIVE animation condition if there are no players in the same area. | |
Marks the caller as civilized based on its racialtype. | |
Returns TRUE if the given creature has the given condition set. | |
Get a creature's home waypoint; returns OBJECT_INVALID if none set. | |
Get the caller's current friend. | |
Get the caller's current interaction target. | |
Returns TRUE if the creature is busy talking or interacting with a placeable or GetCurrentAction does not return ACTION_INVALID. | |
Get a random nearby friend within the specified distance limit, that isn't busy doing something else. | |
Get a random nearby object within the specified distance with the specified tag. | |
Get a random nearby object within the specified distance with the specified type. | |
Returns a randomly selected object with the tag "NW_STOP" that is within the area of the calling object. | |
Makes a creature act out some animations where they stand to look more lifelike. | |
Avian creatures will fly around randomly. | |
Used for mobile NPCs and monsters other than avian ones. | |
Mark that the given creature has the given condition set. | |
Check for a waypoint marked NW_HOME in the area; if it exists, mark it as the caller's home waypoint. | |
Set a specific creature as the caller's friend. | |
Set an object as the caller's interactive target. |
author: Charles Feduke, editor: Mistress, Baragg, contributor: Kookoo