• Our software update is now concluded. You will need to reset your password to log in. In order to do this, you will have to click "Log in" in the top right corner and then "Forgot your password?".
  • 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
    9
    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:
  • 296
    Posts
    9
    Years
    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)
     
  • 11
    Posts
    9
    Years
    • Seen May 25, 2021
    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:
     
  • 296
    Posts
    9
    Years
    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
     
  • 296
    Posts
    9
    Years
    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