Menu Music for Mog's CBS?

I've tried using many scripts that changes the BGM once the player has entered the menu system.

But when I try it with MogHunter's CBS, nothing seems to happen (I guess it's a compatibility problem?)

So on the other hand, I've decided to create the command on my own.

 alias mog_menu_monogatari_call_menu call_menu
 def call_menu
     $game_temp.menu_index = 0     
     mog_menu_monogatari_call_menu
 end

This is the method for calling the menu- I presumed.

So I added

Audio.bgm_play("Audio/BGM/MenuMusic", 100, 100)

Right beneath "def call_menu"

Now I'm wondering how I can replay the original map bgm when the player exits the menu?
Bump
You need to save the map music before changing your music, and then recall it afterwards.


Look at how the battle manager saves the map music.
Have you tried placing these:

def

     self.save_bgm_and_bgs

     @map_bgm = RPG::BGM.last

     @map_bgs = RPG::BGS.last

end

---------------------------------------------------------

def

      self.replay_bgm_and_bgs

      @map_bgm.replay

      @map_bgs.replay

end

 

in the right places? It's what the battle manager uses.

Be sure to post your solution script here once you find it!
No, I've been getting such an error "undefined method 'replay' for nil:NilClass" when I return back to the map.

I'm just a beginner scripter so I don't even know what I'm doing LOL.. But I'm pretty sure I've played the commands & the methods to do so between the 'call menu' and the 'return map' scenes.
bumb

Original thread: https://forums.rpgmakerweb.com/threads/menu-music-for-mogs-cbs.20508/