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.

Changing the map default music

Status
Not open for further replies.
Howdy, it's me again...

How can I change the map default music in RGSS?

For example, Map005's music is set to "001-battle01".

I talk to someone and something big happens, so the map music changes to "002-battle02".

But then when I come back to the map it should still be "002-battle02".

Memorize map bgm is no good because this'll be on several maps, so one would overwrite the other saved one, etc.
 
Ok. So above Main, add this:

Code:
class Interpreter
  def change_map_bgm(map_id, filename)
    map = $game_virtualdb.data_map(map_id)
    map.bgm = RPG::AudioFile.new(filename)
    maps = $game_vritualdb.data_maps
    maps[map_id] = map
    $game_vritualdb.data_maps = maps
    return
  end
end

Now in your call script, use:
Code:
change_map_bgm(map_id, filename)
 
Status
Not open for further replies.

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