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

Disabling Bag Temporarily

94
Posts
11
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.
     

    thor348

    That's Oak to You
    137
    Posts
    11
    Years
  • 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