Main Menu

How do you make it play music when you open the menu?

Started by Jouninwolf, September 29, 2006, 07:41:35 PM

0 Members and 1 Guest are viewing this topic.

Jouninwolf

How can I make it so that everytime I open the menu it plays music, and when I close the menu the music changes back to the map's music? Thanks in advance, I appreciate your help.

Blizzard

I'm not at home right now, so I can't give you an exact code. Can you bump this topic tomorrow? I'll tell you what to do with the script I'm gonna give to you.
Get King of Booze for Android, for iOS, for OUYA or for Windows!
Visit our website.
You can also love/hate us on Facebook or the game itself.



Get DropBox, the best free file syncing service there is!

Jouninwolf


Blizzard

Here you go. Don“t forget to set it up. Share this script and post it anywhere if you like.

#==============================================================================
# Menu BGM player by Blizzard
#
# Instructions:
# Just set up the part below. This script comes over main and UNDER any CMS.
#
# Compatibility
# 100% compatible with anything except completely changed basic scripts
#==============================================================================

MENU_BGM = "001-Battle01" # name of the BGM
VOL = 100 # volume of the BGM
PITCH = 100 # pitch of the BGM

#==============================================================================
# Scene_Map
#==============================================================================

class Scene_Map
 
  alias call_menu_bgm_later call_menu
  def call_menu
    call_menu_bgm_later
    $game_temp.map_bgm = $game_system.playing_bgm
    $game_system.bgm_stop
    Audio.bgm_play("Audio/BGM/" + MENU_BGM, VOL, PITCH)
  end
 
end

#==============================================================================
# Scene_Menu
#==============================================================================

class Scene_Menu
 
  alias main_bgm_later main
  def main
    main_bgm_later
    $game_system.bgm_stop
    $game_system.bgm_play($game_temp.map_bgm)
  end
 
end
Get King of Booze for Android, for iOS, for OUYA or for Windows!
Visit our website.
You can also love/hate us on Facebook or the game itself.



Get DropBox, the best free file syncing service there is!