Making the AI Perform Animations

From FleshWorks

Jump to: navigation, search

by Ziemanskye

This assumes some knowledge on how to build AI patrols and add properties and actors to the world, and the goal is to make the an NPC stop at a point on their patrol, look in a certain direction, and play an animation.

The effect of this is to bring the AI a little more to life, making NPCs shiver at open windows, warm their hands at a fire, wipe the table in front of them or whatever else you can think of.

  • Start by building your world as normal, and place the AI patrol paths as you normally would.
  • Place an Actor>Marker>AIPathPoint>*LookPoint>*PlayAnimPoint at the point you want the NPC to look at when they perform the animation.
  • Select the PlayAnimPoint and add the properties:
    • LookPoint>LookDurationMax (set to a time in seconds)
    • LookPoint>LookDurationMin (set to a time in seconds)
    • LookPoint>OrderInSequence (set if using more than one animtion is wanted at that location)
    • PlayAnimPoint>NumTimesToPlay (set to a number of repetitions, or to -1 to make the animation loop until the LookDuration time is up)
    • PlayAnimPoint>AnimName
  • Open the Skeleton Browser from the menu commnad View>Show Skeleton Browser, then navigate to the animation you want to use. *Hint: Most of the best animations are under the cityguard heading.
  • Highlight the animation you want (you can Right-Click the name to find a menu wih the Play command if you want to preview it first), then return to the PlayAnimPoint properties, and click the Use button beside the AnimName property.
  • Connect the PlayAnimPoint to the AI patrol route in the same way you would connect a path marker, except that this should create a different coloured line and have a number above it (the number corresponds to the OrderInSequence property).
  • Test it out, and play with the values - any NPCs on that route should stop and play the animation at the patrol point, while facing the PlayAnimPoint.



Back to Mission Design: AI Tutorials Page

Back to Mission Design Tutorials Page

Back to Main Tutorials Page

Personal tools