Envision, Create, Share

Welcome to HBGames, a leading amateur game development forum and Discord server. All are welcome, and amongst our ranks you will find experts in their field from all aspects of video game design and development.

Resume Map Music After Battle

The closest mention of this elsewhere on this forum is a oddly closed post. In this post, it is suggested that in order to accomplish the following task, a script might be necessary. That seems rather irksome, because what's being accomplished is such a small, uninteresting feature, that one would wholly expect it to be simple to accomplish.

Issue:
When you enter a battle, the music which plays on the map stops for the Music Effect (ME) and to play the battle music. When you finish the battle, the map music plays again, starting over from the beginning.

Fix:
When you finish the battle, the music which was playing on the map should resume from the point at which it left off. If possible, it would be nifty to have the music "fade in" when it resumes. But remember that the focus is just to have the music resume from the point at which it left off in the first place.

That's it.
 
Well as long as it's being tinkered away on and will exist unlike Santa Claus or corporate humanity or something. Really now, this seems a bit like an oversight on Enterbrain's part! Oh wells. We can fix it.

I mean, it's just that one of the songs I'm using in my game doesn't really get going until about one minute in, and then it sounds delicious.
 
Using Hiretsukan's FMod Ex interface as a base, I was able to implement a basic version of what you're looking for. Download this demo to see how it works (check the README script section in RMXP).

This is not really the best (in particular, MEs don't work well, and there are other minor bugs), but feel free to play with it and suit it to your needs. If you want to credit anyone, credit Hiretsukan (Kevin Gadd) as all I did is little additions to his original script. Note that thanks to FMod Ex you can also play other file formats such as IT and MOD. (that was the original point of the interface)
 
Hey, this demo seems really good! Thanks a ton for sharing it! I notice that Music Effects seem to fade out, and the map music doesn't resume after random battle encounters. Any changeable options on these two details?

I am curious, what is the "serious error" with Music Effects?

Thanks again!
 
As for the music effect, it's actually a hack just to make things work. I could probably fix it later. If I understand right, music effects are essentially short music files that turn off the bgm, play to completion, then restore the bgm. I'd just have to implement something like that instead of the current fading behavior.

I'm not sure about the other problem. It does resume after random encounters for me. The problem is either related to the previously mentioned 'hack' or to a fault in the FMod Ex interface itself. Well, I'll try to look more into it but keep in mind that I don't know much about the FMod Ex part of the script. So I'm not sure if I could fix a bug caused by FMod. So no promises...
 
Ah, I understand. Though I also noticed that an MP3, when set to "50% pitch", was playing at "100% pitch" instead, as well. I just hope that I can help with these minor bug reports, since I support a simple fix for a simple oversight on RMXP's part.
 

Taylor

Sponsor

Odd... why can I memmorize BGM, play another, then return to the original position in the demo, but not in my game? The music just stops...

... maybe it's to do with Scene/class changing?

I dupicated the whole talk to events in my game and it works, but placing in a battle doesn't...

Hm. I believe it might be the scene changing. I've been experimenting and every time the music does not return after battle. Even with my Common Events that act as Battle Start/End - and the removal of $game_system.bgm_play($game_temp.map_bgm) and related lines from the scripts. When the music does not return I seem to be able to cause it to return via the talk-to event like the green haired guy.

BTW I don't like how this script seems to kill the higher quality of MIDIs under RMXP.
 

Thank you for viewing

HBGames is a leading amateur video game development forum and Discord server open to all ability levels. Feel free to have a nosey around!

Discord

Join our growing and active Discord server to discuss all aspects of game making in a relaxed environment. Join Us

Content

  • Our Games
  • Games in Development
  • Emoji by Twemoji.
    Top