Difference between revisions of "Ambient ai.xls"

From Dragon Age Toolset Wiki
Jump to: navigation, search
m
(Converting to new format)
 
(5 intermediate revisions by 2 users not shown)
Line 1: Line 1:
Ambient Behaviour System
+
The [[ambient_ai.xls]] file contains the [[2da]] files that define the ambient animation patterns which form part of the [[ambient behaviour]]s for non-player characters and creatures.
  
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 workbook contains the following worksheets:
  
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]].
+
* _read_me
 +
* [[ambient_anim_patterns 2da|ambient_anim_patterns]]
  
{| cellpadding="2" cellspacing="0" border="1"
+
[[Category:Ambient behaviours]]
|-
+
[[Category:XLS files]]
! Local Variable Name !! Type !! Default !! Description
+
|-
+
| AMBIENT_SYSTEM_STATE
+
| align=center | int
+
| align=center | 0
+
| Bitmask controlling ambient system operation (ergo, values below are in hexadecimal).
+
* 0x01 (AMBIENT_SYSTEM_ENABLED) = Ambient behaviour enabled.
+
* 0x02 (AMBIENT_SYSTEM_SPAWNSTART) = Begin ambient behaviour immediately after spawning.
+
* 0x04 (AMBIENT_SYSTEM_NOPLAYNEXT) = Sets PlayNext parameter to CommandPlayAnimation() to false.
+
* 0x08 (AMBIENT_SYSTEM_NOBLEND) = Sets BlendIn parameter to CommandPlayAnimation to false.
+
* 0x10 (AMBIENT_SYSTEM_ALWAYSON) = Ambient behaviour never stops, regardless of distance to player.
+
|-
+
| AMBIENT_MOVE_PATTERN
+
| align=center | int
+
| align=center | 0
+
| Dictates how the creature moves. Add 100 to values below make creature run instead of walk.
+
* 0 (AMBIENT_MOVE_NONE) = No movement
+
* 1 (AMBIENT_MOVE_PATROL) = Patrol waypoints (1, 2, 3, 2, 1, …)
+
* 2 (AMBIENT_MOVE_LOOP) = Loop through waypoints (1, 2, 3, 1, 2, 3, ...)
+
* 3 (AMBIENT_MOVE_WARP) = Jump creature from the last waypoint to the first (1, 2, 3, jump to 1, 2, 3, …)
+
* 4 (AMBIENT_MOVE_RANDOM) = Walk to random waypoints
+
* 5 (AMBIENT_MOVE_WANDER) = Walk to random location within 5m of home location
+
* 6 (AMBIENT_MOVE_WANDER_FAR) = Walk to random location within 20m of home location
+
* 7 (AMBIENT_MOVE_PATH_PATROL) = Patrol waypoints using CommandMoveToMultiLocations() (1-2-3, 1-2-3, ...)
+
* 8 (AMBIENT_MOVE_PATH_LOOP) = Loop through waypoints using CommandMoveToMultiLocations() (1-2-3, 1-2-3, ...)
+
* 9 (AMBIENT_MOVE_ONCE) = Walk through the waypoint set once (1-2-3)
+
|-
+
| AMBIENT_MOVE_PREFIX
+
| align=center | string
+
| align=center | 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
+
| align=center | int
+
| align=center | 0
+
| Index into ambient_ai.xls specifiying list of possible actions to perform during an animation phase.
+
|-
+
| AMBIENT_ANIM_FREQ
+
| align=center | float
+
| align=center | -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
+
| align=center | int
+
| align=center | 0
+
| If non-zero, this value forces the creature to perform a specific command (instead of moving and animating).
+
*1 = Attack target, waiting 1-4s between attacks. Target's tag must be: <attacker tag>_target
+
*2 = Attack a target. Target's tag must be: <attacker tag>_target
+
|}
+
 
+
{{2da start|ambient_anim_patterns}}
+
{{2da column|Label|string|Anything in green MUST be played in order.}}
+
{{2da column|NoPlayNext|int|Sets bPlayNext parameter used with CommandPlayAnimation() function to FALSE.}}
+
{{2da column|ActionTotal|int|}}
+
{{2da column|Action0|float|Format: Animation.Loops}}
+
{{2da column|Action1|float|}}
+
{{2da column|Action2|float|}}
+
{{2da column|Action3|float|}}
+
{{2da column|Action4|float|}}
+
{{2da column|Action5|float|}}
+
{{2da column|Action6|float|}}
+
{{2da column|Action7|float|}}
+
{{2da column|Action8|float|}}
+
{{2da column|Action9|float|}}
+
{{2da column|Action10|float|}}
+
{{2da column|Action11|float|}}
+
{{2da column|Action12|float|}}
+
{{2da end}}
+

Latest revision as of 15:23, 22 March 2012

The ambient_ai.xls file contains the 2da files that define the ambient animation patterns which form part of the ambient behaviours for non-player characters and creatures.

The workbook contains the following worksheets: