I'm pretty sure this has been asked, but after some extensive searching I still can't find the answer. There is a ME for trainer intros (when they first see you, before battle), but it will play through until it finishes, delaying the battle music. I tried some obvious things, like pbMEStop(), but that doesn't stop it. Any ideas?
I've had this same issue. I made a temp fix if you want to use it.
Start with this code on the event screen.
-Play the background music that is currently playing with a volume setting of 0.
-Place your ME files that are the trainer intros and place them in your SE folder.
-Play your trainer intro file directly under the previous BGM file so it reads like this.
Play BGM: 'file', 0, 100
Play SE: 'trainerintro', 80, 100
-Have the event as normal, but at the end of the event play the same BGM file with with either 80 or 100 volume, which ever you choose.
So finally you should get an event like this:
Play BGM: 'file', 0, 100
Play SE: 'trainerintro', 80, 100
Script: pbTrainerIntro(:YOUNGSTER)
Script: Kernal.pbNoticePlayer(get_character(0))
Text: Let's Fight!
Stop SE
Conditional Branch: Script:pbTrainerBattle(PBTrainers::YOUNGSTER,"Bob",_I("..."),false,0)
Control Self Switch: A=ON
Branch End
Script: pbTrainerEnd
Play BGM: 'file', 100, 100
Just note that with this, the intro will not loop. It will play once. Also, i don't know if it matters that there is a midi in the SE folder, but it shouldn't matter, just convert your file to either an mp3 or wav. I hope this helps.
Also, I noticed that when I made my credits screen that it infinitely repeats. When I make a switch to prevent it from repeating, the credits play for 0 seconds (i.e, doesn't play or wait for credits to finish), and the switch activates. How do I make it so that the switch doesn't turn on until after the credits finish?