MV Yanfly Event Chase Player plugin - chase music

Can I set BGM to start when the event starts chasing me and end when the event stops? The plugin does not have such an option built-in, and it would be very useful to me.
Moved to: Plugin Support
Hey there! There is a way that I can think of, but it's pretty limited. First of all, make a common event that plays a BGM and turns on a switch.

1641705098096.png


and then go to your plugin parameter, and set the Alert Common Event option with the common event you just set up.

1641704887687.png


Now, if you want to stop the BGM, you need to set the "See Player" option in the plugin parameters to true. This is because of the "Sight Lock" option. The Sight Lock option makes the event stop following you after an x amount of frames. Copy the value in the Sight Lock option, and go back to your common events.

Last but not least, go make a new common event, set the trigger to Parallel, and set the condition so it only activates if we've turned on the Switch from the previous common event. In it, insert a wait command with the number of frames you've copied before from the Sight Lock parameter, and a Fadeout BGM.

1641705479494.png


This way, when an event sees a player, the first common event will start which will play music, and it will stop after the event gives up searching for you after an x amount of time.

The only limitation here is that the song will still play even after you enter a safe zone and the event stops chasing you. Basically, the song doesn't end when the event stops chasing you, it ends after the event's Sight Lock timer ends.

That's as far as my ideas go

EDIT: I almost forgot, make sure you also turn off the switch in the 2nd common event so nothing goes wrong.
Thank you so much! I'll try it out soon!
Hey there! There is a way that I can think of, but it's pretty limited. First of all, make a common event that plays a BGM and turns on a switch.

View attachment 212188

and then go to your plugin parameter, and set the Alert Common Event option with the common event you just set up.

View attachment 212187

Now, if you want to stop the BGM, you need to set the "See Player" option in the plugin parameters to true. This is because of the "Sight Lock" option. The Sight Lock option makes the event stop following you after an x amount of frames. Copy the value in the Sight Lock option, and go back to your common events.

Last but not least, go make a new common event, set the trigger to Parallel, and set the condition so it only activates if we've turned on the Switch from the previous common event. In it, insert a wait command with the number of frames you've copied before from the Sight Lock parameter, and a Fadeout BGM.

View attachment 212189

This way, when an event sees a player, the first common event will start which will play music, and it will stop after the event gives up searching for you after an x amount of time.

The only limitation here is that the song will still play even after you enter a safe zone and the event stops chasing you. Basically, the song doesn't end when the event stops chasing you, it ends after the event's Sight Lock timer ends.

That's as far as my ideas go

EDIT: I almost forgot, make sure you also turn off the switch in the 2nd common event so nothing goes wrong.

Original thread: https://forums.rpgmakerweb.com/threads/yanfly-event-chase-player-plugin-chase-music.143746/