Animations in CryENGINE can be marked up to send custom events at a specific time in the animations. This markup is used for time-aligned blending to match footplants in animations for example. Another application of the events is to spawn particle effects at the right moment.
These events can also be used for a variety of systems that need to receive information about when an animation has reached a certain point, for example in combination with a melee system etc.
Marking up Animations with Events
The events for animations are stored in an xml-based file which is loaded upon character loading. For this to be done automatically the database needs to be included in the chrparams file. See this documentation on how to create such a database and on how to create events:
- Specific Information about the AnimEvents Database: Animation Events (animevents).
- General ChrParams File Information: ChrParams File Reference.
- Markup specifically for blending with matching events: Footstep Markup.
Receiving Animation Events in the Game Code
The Animation Events are passed on to the GameObject once they have been triggered. The Actor and the Player implementation both handle these animation events.
See either Actor.cpp or Player.cpp for the function: