Hello again everybody.
I was wondering if its possible to change battle bgm by Call Script command in a event.
The system which I'm working don't allow me to change the battle BGM, but the battle system itself is based on Call Script commands line. So I was wondering if its possible
to add a line that change Battle BGM by Call Script. I would be gratefull for any help.
Audio.bgm_play('Audio/BGM/' + "bgm_name", volume, pitch)
Quote from: soulshaker3 on February 15, 2015, 08:38:17 pm
Audio.bgm_play('Audio/BGM/' + "bgm_name", volume, pitch)
It's right but he were asking for battle bgm, Audio.bgm_play is for map right ?
$data_system.battle_bgm(blabla) +
$game_system.bgm_play($game_system.battle_bgm)
before transitionning into battle might be the thing he wants, i dunno if this work, need experts
What soulshaker posted is already fine. Audio is a module that can be accessed anywhere in the engine. Heck, look at what def bgm_play does in Game_System:
#--------------------------------------------------------------------------
# * Play Background Music
# bgm : background music to be played
#--------------------------------------------------------------------------
def bgm_play(bgm)
@playing_bgm = bgm
if bgm != nil and bgm.name != ""
Audio.bgm_play("Audio/BGM/" + bgm.name, bgm.volume, bgm.pitch) #<================ This right here
else
Audio.bgm_stop
end
Graphics.frame_reset
end
Besides, to call $game_system.bgm_play, the passed argument must be a RPG::AudioFile object. So you would have to do this:
a = RPG::AudioFile.new(FILENAME, VOLUME, PITCH) # VOLUME and PITCH can be omitted and they will default to values of 100
$game_system.bgm_play(a)
It's been almost a month and OP hasn't responded, so we can assume this is already solved.