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.

Music in Menu (VX)

Alright, I already know how to put the music in the menu but I don't know how to keep it playing instead of starting it all over again when I go into Skills or Items.

Code:
#--------------------------------------------------------------------------
  # * Start processing
  #--------------------------------------------------------------------------
  def start
    super
    create_menu_background
    create_command_window
    @gold_window = Window_Gold.new(0, 360)
    @status_window = Window_MenuStatus.new(160, 0)
    Audio.bgm_play("Audio/BGM/" + "Devil May Cry 3-Dark Choir", 100, 100)
  end
  #--------------------------------------------------------------------------
  # * Termination Processing
  #--------------------------------------------------------------------------
  def terminate
    super
    dispose_menu_background
    @command_window.dispose
    @gold_window.dispose
    @status_window.dispose
    Audio.bgm_stop
    $game_map.autoplay
  end
 
Uhhhh you your calling up a new scene which resets the music each time.  :shock: you got the menu but you got to to to the other menus to and change the music! Otherwise it will reset the music to the map music because that's what it's meant to play.
 

Atoa

Member

just change the "def terminate" to this:
Code:
  def terminate
    super
    dispose_menu_background
    @command_window.dispose
    @gold_window.dispose
    @status_window.dispose
    if $scene.is_a?(Scene_Map)    
      Audio.bgm_stop 
      $game_map.autoplay
    end
  end
this will make map bgm restart only when you leave the menu
 

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