Game Maker Studio: possible to detect that an event has played from a track? (Command Instrument, nested event...)

Hi there,

Game Maker project. I’m trying to place events along side a music track, and have the game react to them (to have specific eye candy happen on certain beats, etc.). So far, using Studio::EventDescription::getInstanceCount, we’ve tried detecting that an event was played from within a music event (either by a Command Instrument, or a nested event). Both failed. Is there a proper way to do this?

However by using “Set Parameter” in a Command Instrument, we got GameMaker to successfully detect that a parameter had changed value, so there’s that, but it feels that there might be a better way.

Any help greatly appreciated, thanks!

Bump, because Easter weekend. :slight_smile:

Hi,

Apologies for the delayed response.

An option could be using the FMOD_STUDIO_EVENT_CALLBACK_START_EVENT_COMMAND with the FMOD Engine | Studio Api Eventinstance - Studio::Eventinstance::Setcallback. This will return the event instance triggered by the Start Event command instrument.

An example of how to use callbacks in C# can be found here: Unity Integration | Examples Timeline Callbacks

Hope this helps!