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 menue Script

I have looked every where and i just can't find a script that will change the bgm when you enter your menu, and change back when you exit.

Like Legend of the Dragoon for example

Can anyone help? thank you.
 
I've been tenkering around with the script and made up a in-menu music mini script.

Ok ok it's more like a mod to it, just add this in lines 19 & 20
# Play 001-Battle01 BGM
$game_system.bgm_play($data_system.battle_bgm)

and it'll play that BGM but if you don't want to listen to the battle01 BGM you can change it up to what ever you want to listen to.
Oh and btw i'm still working on how to stop it once you leave the menu.
So bare with me on this.
 
Sorry for 2nd post.
But I found one thing this:
$game_system.bgm_play($data_system.title_bgm) - will play what you set the title music to
$game_system.bgm_play($data_system.battle_bgm) - will play what you set the battle music to
$game_system.bgm_play($data_system.battle end_bgm) - will play what you set the battle end music to
$game_system.bgm_play($data_system.gameover_bgm) - will play what you set the gameover music to

So set one of these to what you want to hear in the menu, sorry the 2nd post agian.
 

arev

Sponsor

no need to use one of these. you can simply define which file you'd like to play.
Code:
Audio.bgm_play("Audio/BGM/filename", 100, 100)
will play a file from the BGM folder, with 100 volume and 100 pitch.
 
Just put this in a new script above main:
Code:
class Scene_Menu
  
  BGM = "001-Battle01" # <--- Change this for the name of the bgm you want to play.
  
  alias raz_music_menu_main main
  alias raz_music_menu_uc update_command
  
  def main
    $game_temp.map_bgm = $game_system.playing_bgm
    Audio.bgm_play("Audio/BGM/" + BGM, 100, 100)
    raz_music_menu_main
  end
  
  def update_command
    if Input.trigger?(Input::B)
      $game_system.se_play($data_system.cancel_se)
      $scene = Scene_Map.new
      Audio.bgm_stop
      $game_system.bgm_play($game_temp.map_bgm)
      return
    end
    raz_music_menu_uc
  end
  
end
 

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