• Just a reminder that providing specifics on, sharing links to, or naming websites where ROMs can be accessed is against the rules. If your post has any of this information it will be removed.
  • Our friends from the Johto Times are hosting a favorite Pokémon poll - and we'd love for you to participate! Click here for information on how to vote for your favorites!
  • Cyndy, May, Hero (Conquest), or Wes - which Pokémon protagonist is your favorite? Let us know by voting in our poll!
  • Welcome to PokéCommunity! Register now and join one of the best fan communities on the 'net to talk Pokémon and more! We are not affiliated with The Pokémon Company or Nintendo.

[Scripting Question] Pause BGM in pause menu?

  • 11
    Posts
    10
    Years
    • Seen May 25, 2021
    All I want is that the background music is paused when I enter the pause menu. (Pressing ESC I mean, you know xD). I would like that when you leave the menu music continues where it was paused too.

    I have tried many things but none worked. I tried pbBGMFade for example, but nooope.

    Someone help me?
     
    Last edited by a moderator:
    In your menu script, you have to add this (when you enter in pause menu):
    Code:
    @playingBGM=$game_system.getPlayingBGM
    $game_system.bgm_pause

    Finally, you have to add this when you close your menu:
    Code:
    $game_system.bgm_resume(@playingBGM)
     
    In your menu script, you have to add this (when you enter in pause menu):
    Code:
    @playingBGM=$game_system.getPlayingBGM
    $game_system.bgm_pause

    Finally, you have to add this when you close your menu:
    Code:
    $game_system.bgm_resume(@playingBGM)

    Thanks bro, where should I put that? Im using shiney script, I tried to put your code in ''starting the scene'' and ''closing the scene'' section but nothing happens.

    Here is my ''virgin'' pause menu script: (I know
    Spoiler:
     
    You can put the first part of code after this line:
    Code:
    @viewport=Viewport.new(0,0,Graphics.width,Graphics.height)

    The second one after these lines:
    Code:
    pbDisposeSpriteHash(@sprites)
    @viewport.dispose
     
    I made a double check of my code and i didn't found anything wrong. Anyways, i discovered a malfunctioning in "bgm_pause" function and this is the cause of your problem (MIDI files too). We need to report it to Maruno.
     
    Back
    Top