Ambient ai.xls
Ambient Behaviour System
Ambient behaviour begins when the player moves within 50m of a creature and ceases when the player remains more than 50m away for at least 40s. Ambient behaviour alternates between a movement phase and an animation phase, simulating a bubble of activity around the player. In a movement phase, the creature (optionally) moves to a new waypoint or location. In an animation phase, the creature (optionally) performs one or more animations either in sequence or at random. Exact behaviour is controlled by local variables set on either the creature instance or template (see table below). All other local variables with the prefix AMBIENT_* are used internally by the ambient behaviour system (see script sys_ambient_h.nss) and should not be manually modified. Never directly modify AMBIENT_* local variables at run time using SetLocalInteger() - always use the functions Ambient_Start(), Ambient_Stop(), Ambient_OverrideBehaviour(), and Ambient_RestoreBehaviour() instead.
The actions used in an animation phase are listed in the ambient_anim_patterns worksheet of ambient_ai.xls. Each row defines a series actions, each composed of an animation (left of the decimal) and a loop count (right of decimal). For example, 619.02 will play a sleeping animation for 2 loops and 619.99 will play an infinitely looping sleeping animation. Non-looping animations require no looping (i.e. decimal) component. The list of all available animations is located in ANIM_base.xls.
Local Variable Name | Type | Default | Description |
---|---|---|---|
AMBIENT_SYSTEM_STATE | int | 0 | Bitmask controlling ambient system operation (ergo, values below are in hexadecimal).
|
AMBIENT_MOVE_PATTERN | int | 0 | Dictates how the creature moves. Add 100 to values below make creature run instead of walk.
|
AMBIENT_MOVE_PREFIX | string | ap_<tag> | The prefix used to determine the waypoints the creature travels to. Note that '<tag>' is a placeholder filled in at run-time with the tag of the creature. Hence, if a creature has the tag 'dog' and AMBIENT_MOVE_PREFIX is set to 'ap_<tag>', the system will first look for waypoints with tags corresponding to; ap_dog_01, ap_dog_02, etc. If no such waypoints are found, it will attempt to look for waypoints with the tag 'ap_dog'. |
AMBIENT_ANIM_PATTERN | int | 0 | Index into ambient_ai.xls specifiying list of possible actions to perform during an animation phase. |
AMBIENT_ANIM_FREQ | float | -1.0 | Animation frequency. The portion left of decimal specifies the minimum and the portion right of the decimal specifies the maximum number of animations to play during an animation phase (e.g. 2.4 will play between 2 and 4 animations randomly selected from the appropriate animation pattern). A value of -1.0 causes all animations for an animation pattern to play in the order listed in ambient_ai.xls. Animation pattens that are highlighted in green on the worksheeet should always be played in order (i.e. AMBIENT_ANIM_FREQ = -1.0). |
AMBIENT_COMMAND | int | 0 | If non-zero, this value forces the creature to perform a specific command (instead of moving and animating).
|
Column | Type | Description |
---|---|---|
ID | int | A number that uniquely identifies the entry (unless creating an M2DA override). ID numbers are listed from smallest to highest within a given file but do not need to be consecutive. |
Label | string | Anything in green MUST be played in order. |
NoPlayNext | int | Sets bPlayNext parameter used with CommandPlayAnimation() function to FALSE. |
ActionTotal | int | |
Action0 | float | Format: Animation.Loops |
Action1 | float | |
Action2 | float | |
Action3 | float | |
Action4 | float | |
Action5 | float | |
Action6 | float | |
Action7 | float | |
Action8 | float | |
Action9 | float | |
Action10 | float | |
Action11 | float | |
Action12 | float |