In practice, I'd like to be able to trigger a sound or spawn a particle based on key points in the animation.
Let's say that I'm ripping off Plants Vs Zombies and I want to shoot a Pea out when the head cocks to a certain angle. Now in this example I can simply play the sound the same time I emit the pea particle, but there are several other instances when I want the sound generation separate from particle triggering or script triggering, etc...etc..etc..
Instead of having to create new types for sound triggers, particle triggers, script triggers, etc... All you really need to do is create a single new Timeline Type for 'trigger'.
The timeline would have a instance type, read as a string, and each frame would have a simple string. That's it.
The timeline will need to keep track of the previous frame that it executed so that we only receive the edges of the events. When an edge is encountered, then a global callback is made, similar to texture page creation, only optional, like overriding the free() and malloc() functions. Something like:
void _onTrigger(void* theId (Skeleton*? AnimationState*?), char * theTriggerType, char * theTriggerValue)
voide _setOnTrigger(func* MyCustomTriggerCallback)
In the Editor, we only need to add Trigger Types to the Root Bone. The New Trigger gets a single instance name, and we are allowed to put any text we want on a keyframe. The custom text can be anything from a single word to an entire script (e.g. lua) to execute.