Idle Animations: Difference between revisions

From The DarkMod Wiki
Jump to navigationJump to search
No edit summary
No edit summary
Line 9: Line 9:
Take a look at '''tdm_ai_base.def''':
Take a look at '''tdm_ai_base.def''':


  "idle_animations"          "Itch,SniffArm,Cough"
  "idle_animations"          "itch,idle_arm_scratch,idle_sneeze"
  "idle_animations_torso"    "Itch,SniffArm,Cough"
  "idle_animations_torso"    "Itch,idle_arm_scratch,idle_cough"
  "idle_animations_interval"  "25" // seconds
  "idle_animations_interval"  "25" // seconds


The '''animation list''' is comma- or space-separated and can be any length. Note that the actual names (e.g. '''Itch''') refer to the AnimState script functions defined in ai_darkmod_base.script, not the actual animation names. The prefix "Torso_" and "Legs_" is automatically appended to the names in the list: '''Itch''' is becoming '''Torso_Itch'''.
The '''animation list''' is comma- or space-separated and can be any length. The names refer to the "anim" names in the AI's modelDef, e.g.:
 
anim idle                  models/md5/chars/guards/proguard/idle.md5anim
anim idle_armwipe          models/md5/chars/guards/proguard/idle_armwipe.md5anim
anim idle_arm_scratch      models/md5/chars/guards/proguard/idle_arm_scratch.md5anim
anim idle_torch            models/md5/chars/guards/proguard/idle_torch.md5anim
anim idle_sneeze            models/md5/chars/guards/proguard/idle_sneeze.md5anim


The '''interval''' is measured in seconds and an uncertainty of plus/minus 20% is automatically applied by the SDK code. Set this to zero or negative values disables the idle animations on this AI.
The '''interval''' is measured in seconds and an uncertainty of plus/minus 20% is automatically applied by the SDK code. Set this to zero or negative values disables the idle animations on this AI.


{{editing}}
{{editing}}

Revision as of 07:20, 16 May 2009

In Idle State, our AI can randomly choose between any number of idle animations.

There are two lists of possible idle anims stored in the AI's DEF file, which can easily be overridden in the editor.

One list is containing the animations played on the ANIMCHANNEL_TORSO only. These are suitable for all kinds of idling AI (sitting, walking, whatever).

The second list is containing the animation statenames of anims playing on TORSO and LEGS channel. These are activated when the AI's LEGS channel is playing the Idle animation (which is true for a standing guard, but not for a patrolling one).

Take a look at tdm_ai_base.def:

"idle_animations"           "itch,idle_arm_scratch,idle_sneeze"
"idle_animations_torso"     "Itch,idle_arm_scratch,idle_cough"
"idle_animations_interval"  "25" // seconds

The animation list is comma- or space-separated and can be any length. The names refer to the "anim" names in the AI's modelDef, e.g.:

anim idle                   models/md5/chars/guards/proguard/idle.md5anim
anim idle_armwipe           models/md5/chars/guards/proguard/idle_armwipe.md5anim
anim idle_arm_scratch       models/md5/chars/guards/proguard/idle_arm_scratch.md5anim
anim idle_torch             models/md5/chars/guards/proguard/idle_torch.md5anim
anim idle_sneeze            models/md5/chars/guards/proguard/idle_sneeze.md5anim

The interval is measured in seconds and an uncertainty of plus/minus 20% is automatically applied by the SDK code. Set this to zero or negative values disables the idle animations on this AI.