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.

[XP] Change battle BGM to ME. No more restarting BGM after battle!

Introduction: In default, after battle, BGM will restart. Now we can "pause" BGM (not pause but as pause) and play at position after battle. Change battle BGM to ME, a simple way. I'm a stupid.

Demo: http://sites.makegameviet.com/002/scrip ... _to_ME.zip (please copy a game.exe into project to play).

Script: In class Scene_Map find:
Code:
  def call_battle
    # Clear battle calling flag
    $game_temp.battle_calling = false
    # Clear menu calling flag
    $game_temp.menu_calling = false
    $game_temp.menu_beep = false
    # Make encounter count
    $game_player.make_encounter_count
    # Memorize map BGM and stop BGM
    $game_temp.map_bgm = $game_system.playing_bgm
    $game_system.bgm_stop
    # Play battle start SE
    $game_system.se_play($data_system.battle_start_se)
    # Play battle BGM
    $game_system.bgm_play($game_system.battle_bgm)
    # Straighten player position
    $game_player.straighten
    # Switch to battle screen
    $scene = Scene_Battle.new
  end
Then relace with:
Code:
  def call_battle
    # Clear battle calling flag
    $game_temp.battle_calling = false
    # Clear menu calling flag
    $game_temp.menu_calling = false
    $game_temp.menu_beep = false
    # Make encounter count
    $game_player.make_encounter_count
    # Memorize map BGM
    $game_temp.map_bgm = $game_system.playing_bgm
    # Play battle start SE
    $game_system.se_play($data_system.battle_start_se)
    # Play Battle BGM as ME
    Audio.me_play("Audio/BGM/" + $game_system.battle_bgm.name, $game_system.battle_bgm.volume, $game_system.battle_bgm.pitch)
    # Straighten player position
    $game_player.straighten
    # Switch to battle screen
    $scene = Scene_Battle.new
  end

FAQ: You must have ME long enough to play in battle because ME doesn't loop.
 

Atoa

Member

Well, theres better ways to do that.

There's the FMOD Ex Audio Module Rewrite (No more restarting BGM after battle!) from Cowlol.

And there's the script i've made using Poccil's Audio module (from pokemon starter kit).
This is the topic where i posted it.
Resume Map Music after Battle
(i hope it not considered a spam '-')

It's on Brazillian portuguese, but since it's just a copy/paste (paste both scripts right bellow Scene Debug) script there's no problem whit that.
Note that it won't work with .ogg bgms.

you will need the audio.dll on the folder of your project.
Audio.rar
 

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