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

Disabling Bag Temporarily

  • 93
    Posts
    12
    Years
    • Seen May 4, 2018
    Hello everyone. I've been trying to disable the Bag to prevent using items in certain battles but without any progress. Can anyone help me do this? Preferably using a switch.
     
    Go to PokeBattle_ActualScene. Then scroll to about line 2206.
    Just add the highlighted text:

    Code:
      def pbItemMenu(index)
        [COLOR="red"]if $game_switches[86]==true[/COLOR]
        ret=0
        emptyspot=-1
        pkmnid=-1
        endscene=true
        oldsprites=pbFadeOutAndHide(@sprites)
        itemscene=PokemonBag_Scene.new
        itemscene.pbStartScene($PokemonBag)
        loop do
          item=itemscene.pbChooseItem
          break if item==0
          usetype=$ItemData[item][ITEMBATTLEUSE]
          cmdUse=-1
          commands=[]
          if usetype==0
            commands[commands.length]=_INTL("Cancel")
          else
            commands[cmdUse=commands.length]=_INTL("Use")
            commands[commands.length]=_INTL("Cancel")
          end
          itemname=PBItems.getName(item)
          command=itemscene.pbShowCommands(_INTL("{1} is selected.",itemname),commands)
          if cmdUse>=0 && command==cmdUse
            if usetype==1 || usetype==3
              pkmnlist=PokemonScreen_Scene.new
              pkmnscreen=PokemonScreen.new(pkmnlist,@battle.party1)
              itemscene.pbEndScene
              pkmnscreen.pbStartScene(_INTL("Use on which Pokémon?"),@battle.doublebattle)
              pkmnid=pkmnscreen.pbChoosePokemon
              emptyspot=0 if @battle.doublebattle && @battle.battlers[0].hp<=0
              emptyspot=2 if @battle.doublebattle && @battle.battlers[2].hp<=0
              if pkmnid>=0 && @battle.pbUseItemOnPokemon(item,pkmnid,pkmnscreen)
                pkmnscreen.pbRefresh
                pkmnlist.pbEndScene
                ret=item
                endscene=false
                break
              end
              pkmnlist.pbEndScene
              itemscene.pbStartScene($PokemonBag)
            elsif usetype==2 || usetype==4
              if @battle.pbUseItemOnBattler(item,index,itemscene)
                ret=item
                break
               [COLOR="Red"] end[/COLOR]
              end
            end
          end
        end

    Switch 86 can be anything... I tested this and it works for me!
     
    Back
    Top