• Hello [name]! Thanks for joining the GMC. Before making any posts in the Tech Support forum, can we suggest you read the forum rules? These are simple guidelines that we ask you to follow so that you can get the best help possible for your issue.

Discussion Animation Event example missing

Didjargo

Member
There is a flaw in the instruction manual for GMS2 (may be also be for GMS1 but I haven't checked). Under the subject "Events" the tab for "Animation Event", the text explains the event but stops after it says "for example,". Would anyone be willing to provide me an example on how to use this event?

Edit: I played around with it and it turns out that the "animation event" code just runs whenever an event is called in the Spine animation. So, okay then, new question: is there a way to distinguish between the events in an animation? Like, if I had an event called "footstep" to signal when to play the footstep sound effect and a separate event called "slice" to play the slicing sound effect and calculate damage.
 
Last edited:

Nocturne

Friendly Tyrant
Forum Staff
Admin
The manual has been updated to explain this event correctly, but I don't know if it's in the current beta build or is waiting for the next update. However, here is the text it contains:

This event is designed only for use with the Skeletal Animation Functions. This event is triggered in an object which has a skeletal animation sprite assigned to it, and where the object is using the default draw for the assigned sprite, or the sprite is being drawn via draw_self(). It currently won’t trigger on skeleton animation sprites drawn any other way. The event is designed to capture and transmit data that has been assigned to particular events in the sprite animation as defined in the editor used to make them.

When the Animation Event is triggered, a special ds_map will be created called the event_data map (much the same as we have the async_load map for an async event). This map will have all of the following key/value pairs that you can parse to get information about the event:

  • "name": the name of the event (as defined in the animation program)
  • "track": the index of the track the animation is playing on (default is 0)
  • "integer": an integer value associated with the event (as defined in the animation program, default is 0)
  • "float": a float value associated with the event (as defined in the animation program, default is 0.0)
  • "string": a string value associated with the event (as defined in the animation program, default is an empty string "")
 
Top