• 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.

Problems with volume options in the options screen

Savordez

It's time to end fangames.
  • 115
    Posts
    10
    Years
    Code:
           NumberOption.new(_INTL("Music Volume"),_INTL("%d\%"),0,100,
              proc { $PokemonSystem.bgmvolume },
              proc {|value|  $PokemonSystem.bgmvolume=value
                             if $game_system.playing_bgm != nil
                                $game_system.playing_bgm.volume=value
                                $game_system.bgm_memorize
                                $game_system.bgm_stop
                                $game_system.bgm_restore
                              end
                             if $game_system.playing_bgs != nil
                                $game_system.playing_bgm.volume=value
                                $game_system.bgs_memorize
                                $game_system.bgs_stop
                                $game_system.bgs_restore
                              end}
           ),
           NumberOption.new(_INTL("Sound Effect Volume"),_INTL("%d\%"),0,100,
              proc { $PokemonSystem.sevolume },
              proc {|value|  $PokemonSystem.sevolume=value}
           ),

    As you can see, the background music is memorized and restored in the script, but the problem is that it does that every time I change any setting in the options and close the menu. If I change the screen size or text speed, the music stops and then starts again. I'd like to know if there's a way to fix this.
     
    Maybe make it a separate option? i.e. Music Volume: Press Enter/Z, prompt the options, done. I know it's more tedious, but if you never find out what's the matter with it, maybe it's a decent workaround. I think the Jukebox would be a easy place to copy the code to do it.
     
    Try more like this

    Code:
    NumberOption.new(_INTL("BG Volume"),_INTL("%d\%"),0,100,
             proc { $PokemonSystem.bg_volume },
             proc {|value|
              $PokemonSystem.bg_volume=value
              if $scene.is_a?(Scene_Map)
                if $game_system.playing_bgm != nil
                  $game_system.playing_bgm.volume=value
                  $game_system.bgm_pause
                  $game_system.bgm_resume($game_system.playing_bgm)
                end
              end
              }
          ),
     
    Back
    Top