Callbacks for Animation Frames (Anim Notify)
- Anim Notify is a callback system triggered when playing animations. It allows actions to be attached to specific bones of the model during certain animation frames. For example, if an NPC has a sneezing animation and does it several times, anim notify allows you to tie a separate callback to each sneezing frame so the mouth bone plays the sound of the NPC sneezing.
- You can attach the following actions to animation frames:
- Give info portion
- Remove info portion
- Call Lua function
- Play particle on bone
- Play sound on bone
Creating a callback
The callback field appears as a tree with 3 levels of rows:
- All callbacks in the animation
- All callbacks on a bone
- Group of callbacks on a bone
- Level 3 is for cases where two or more callbacks need to be attached to the same bone at the same or close frames. Only level 3 tags are interactive.
Adding a callback
- In AE, open the KeyForm window, expand the
Notifiesfield, and pressAdd. - In the popup window, select the desired bone where callbacks are added. A row will appear with notifies corresponding to the selected bone.
- Expand the field with the bone and press the
Addbutton. This creates a row of notifies where callbacks can be placed.
- Alternatively, move the animation playback slider to the desired frame and press
Current keyframeto the right of the target row.
Removing a callback
- To remove a callback, choose one of two actions:
- Hover over the Notify tag and right-click.
- In the settings field, press the
Delbutton.
- To remove an entire row, press the corresponding row
sDel` button.
Clearing a bone`s callbacks
- To clear all callbacks from a bone, press
Remove Bonein the relevant bone field.
Callback settings window
- Callback info is stored in a separate config. Hover on the desired callback and left-click to open a settings field below all rows. Enter the section name the callback will point to in the configs into
External ref.
Storing info in the config
- Callback names are used as identifiers in configs. Multiple callbacks can have the same name.
- Callback names are case-insensitive. For example,
Callback_Nameandcallback_nameare considered the same. - In
gamedata/configs/misccreate a folderanim_notifyand add a file with the following section:
[callback_name]
type = callback_type ; options: `give_info`, `disable_info`, `lua_functor`, `play_sound`, or `play_particle`
Info = info_portion_name ; only for `give_info` or `disable_info`
Func = script_filename.function_name ; only for `lua_functor`
particle = path\to\particle\particle_name ; only for `play_particle`
sound = path\to\sound\sound_name ; only for `play_sound`