• 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.
  • There is an important update regarding account security and 2FA. Please click here for more information.
  • 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.
  • Imgur has blocked certain regions from viewing any images uploaded to their site. If you use Imgur, please consider replacing any image links/embeds you may have on PokéCommunity so everyone can see your images. Click here to learn more.

Problems with volume options in the options screen

Savordez

It's time to end fangames.
  • 111
    Posts
    12
    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