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:
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:
在动画过程中的特定时间内可标记 CryENGINE 中的动画以发送自定义事件。例如此标记可用来协调校准时间以与动画中的 footplants 匹配。事件的另一应用是在适当时刻出生粒子效果。这些事件也可应用于各种需要接收关于动画何时达到某个时点信息的系统。例如与近战武器系统相结合等。
动画事件保存在基于 xml 的可加载到角色载体之上的文件中。若要自动完成此过程，chrparams 文件中需包含该数据库。请参阅此文档中关于如何创建该数据库和事件的信息：
关于该函数请参阅 Actor.cpp 或 Player.cpp：