• 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] Removing the mail bag option

AskipLudo

The Masked Guy
159
Posts
7
Years
  • Hello, I would like to remove everything related to mail from my project how could I do that without having any error?

    Because yeah I tried to remove everything with the word "mail" with ctrl + shift + f and now I'm getting a error in the PokemonBag script line 185 (the one to rearrange items)

    If anyone could help me a little with that,

    Thanks :P
     
    104
    Posts
    2
    Years
    • Seen Mar 12, 2024
    Does it crash on startup or when you open the bag? What version of essentials are you in, and can you post the error?

    The fact that you removed every instance of the word mail means theres alot of places where there could be a problem, so it'd be best to try to narrow down where the issue is.
     

    AskipLudo

    The Masked Guy
    159
    Posts
    7
    Years
  • Does it crash on startup or when you open the bag? What version of essentials are you in, and can you post the error?

    The fact that you removed every instance of the word mail means theres alot of places where there could be a problem, so it'd be best to try to narrow down where the issue is.

    It crash when opening the bag and I'm in the last version v20.1
     
    104
    Posts
    2
    Years
    • Seen Mar 12, 2024
    Alright, I've found the issue, which is the that Essentials expects a minimum number of bag slots. To be honest, I'm not sure where that number is stored, but when ever you go below 8 pockets, the Bag no longer works. (This might be because items in the PBS are labeled 8, so it expects 8, but I'm not sure no willing to change them all to 7 to find out.)

    However, there is still a way to reduce your pockets. On the script page "PokemonBag", go to line 14 and change it to look like this
    Code:
      def self.pocket_count
        return self.pocket_names.length+1
      end
    This will stop it from crashing when you go to the Bag Menu. But you are not done.

    On script page "UI_Bag", go to line 386 and change it to this:
    Code:
    newpocket = (newpocket == 1) ? PokemonBag.pocket_count - 1 : newpocket - 1
    And then line 404 and change that to this:
    Code:
     newpocket = (newpocket == PokemonBag.pocket_count-1) ? 1 : newpocket + 1

    That fixes all crashes. Functionally, your bag UI will look kinda gross, since it will have an unused slot. I'd recommend editing that to fit your new layout.

    Finally, you will have to change every item in the PBS that is above slot 6 to 1 lower (6 was mail, so you have to change Battle Items from 7 to 6, and Key items for 8 to 7). Otherwise you won't be able to reach your Key Items as they are in slot 8 when you only have 7 slots. Changing your PBS does not auto update items already on your character, so you will have to start a new game if you already have key or battle items.
     
    53
    Posts
    11
    Years
  • This would be cool so instead having a Megastone slot in place of mail since I never used that even in the main games but also Z-Crystals with their own pocket I did one but I got always an Syntax error. If I go and test it when the cmd text shows the text shows it goes in to the Items which is not where I want that to go.
     
    Back
    Top