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

Combining Bag pockets

PiaCRT

Orange Dev
938
Posts
13
Years
  • Hello, PC. It's been a bit since I posted a question here. I was wondering if it was possible to combine bag pockets, such as berries and battle items with the normal "Items" slot.

    The style game I'm going for does not have these slots and I was wondering:
    1) how to get rid of them.
    2) how to make the battle items/berries/etc think they belong in the "items" slot.

    Thanks alot,
    Pia Carrot
     

    Maruno

    Lead Dev of Pokémon Essentials
    5,286
    Posts
    16
    Years
    • Seen May 3, 2024
    One would think that editing items.txt to put all the appropriate items in the same pocket would be the first step. You can then edit the POCKETNAMES array in the Settings to rename the pockets and change the number of them. Then edit the graphics.

    There's no "easy" way of combining pockets, and any attempt to create such a way would just take longer than simply editing items.txt.
     

    PiaCRT

    Orange Dev
    938
    Posts
    13
    Years
  • One would think that editing items.txt to put all the appropriate items in the same pocket would be the first step. You can then edit the POCKETNAMES array in the Settings to rename the pockets and change the number of them. Then edit the graphics.

    There's no "easy" way of combining pockets, and any attempt to create such a way would just take longer than simply editing items.txt.

    However, using the easy way out would result in several nulled pockets that are unused. I will continue researching.
     

    Maruno

    Lead Dev of Pokémon Essentials
    5,286
    Posts
    16
    Years
    • Seen May 3, 2024
    I gave you the answer, though. Put the items into different pockets by editing items.txt, and then edit the array so that it only contains the desired pockets. That's what it does.
     

    PiaCRT

    Orange Dev
    938
    Posts
    13
    Years
  • I gave you the answer, though. Put the items into different pockets by editing items.txt, and then edit the array so that it only contains the desired pockets. That's what it does.

    D'oh. I read your response slightly wrong. Thank you, I should be able to figure it out now.
     

    IceGod64

    In the Lost & Found bin!
    624
    Posts
    15
    Years
  • Actually, related question: What about making no items at all be differentiated by pocket? Is that possible?

    Also, unrelated, but how can I force items to be sorted automatically alphabetically? I've tried .sort! all over the place and it's made no difference.
     

    Maruno

    Lead Dev of Pokémon Essentials
    5,286
    Posts
    16
    Years
    • Seen May 3, 2024
    Actually, related question: What about making no items at all be differentiated by pocket? Is that possible?
    You mean, put every item into the same pocket a la Gen 1? I'm sure that's possible - just have 1 pocket.


    Also, unrelated, but how can I force items to be sorted automatically alphabetically? I've tried .sort! all over the place and it's made no difference.
    Find yourself the module ItemStorageHelper (PokemonUtilities), and go to def self.pbStoreItem. This is the method that actually puts items into the Bag pockets. It's also used to add Triple Triad cards, which can cause a problem (see below).

    Do something like the following:
    Code:
        for i in 0...maxsize
          itemslot=items[i]
          if !itemslot
            items[i]=[item,[qty,maxPerSlot].min]
            qty-=items[i][1]
            [COLOR=Red]items.sort! if pbIsMachine?(item)[/COLOR]
            return true if qty==0
          elsif itemslot[0]==item && itemslot[1]<maxPerSlot
    The pocket only needs to be sorted after filling up an empty slot with the new item(s). This particular example will sort the TMs & HMs pocket - you need to check the item's details, because this method doesn't know which pocket it's looking at (it's only told "here's an array, put this new item into it"). Note that this particular example sorts the pocket by ID number, NOT alphabetically.

    Now, this will cause a problem if you also want to use the Triple Triad minigame. This method can't tell whether the added item is an actual item going into the Bag, or a Pokémon species ID number representing a TT card being added to the Library. Using the above example, the TMs/HMs have ID numbers of 288 to 388 inclusive. So do Vigoroth to Grotle. If you add a Groudon TT card (383), the above code looks for item data for the item of the same number (HM01), and will sort the TT library because it's a machine item.

    You'll need to either differentiate the two things (Bag pocket or TT library) somehow in this method, or just not use the Triple Triad minigame.
     

    IceGod64

    In the Lost & Found bin!
    624
    Posts
    15
    Years
  • You mean, put every item into the same pocket a la Gen 1? I'm sure that's possible - just have 1 pocket.



    Find yourself the module ItemStorageHelper (PokemonUtilities), and go to def self.pbStoreItem. This is the method that actually puts items into the Bag pockets. It's also used to add Triple Triad cards, which can cause a problem (see below).

    Do something like the following:
    Code:
        for i in 0...maxsize
          itemslot=items[i]
          if !itemslot
            items[i]=[item,[qty,maxPerSlot].min]
            qty-=items[i][1]
            [COLOR=Red]items.sort! if pbIsMachine?(item)[/COLOR]
            return true if qty==0
          elsif itemslot[0]==item && itemslot[1]<maxPerSlot
    The pocket only needs to be sorted after filling up an empty slot with the new item(s). This particular example will sort the TMs & HMs pocket - you need to check the item's details, because this method doesn't know which pocket it's looking at (it's only told "here's an array, put this new item into it"). Note that this particular example sorts the pocket by ID number, NOT alphabetically.

    Now, this will cause a problem if you also want to use the Triple Triad minigame. This method can't tell whether the added item is an actual item going into the Bag, or a Pokémon species ID number representing a TT card being added to the Library. Using the above example, the TMs/HMs have ID numbers of 288 to 388 inclusive. So do Vigoroth to Grotle. If you add a Groudon TT card (383), the above code looks for item data for the item of the same number (HM01), and will sort the TT library because it's a machine item.

    You'll need to either differentiate the two things (Bag pocket or TT library) somehow in this method, or just not use the Triple Triad minigame.

    Though I don't plan on using the Triple Triad anyway, wouldn't it be possible (And not a bad idea)to give Triple Triad cards a pocket of their own assuming I were to use it? That in itself could be the difference.
     

    Maruno

    Lead Dev of Pokémon Essentials
    5,286
    Posts
    16
    Years
    • Seen May 3, 2024
    It also affects the item storage in the player's PC (i.e. storing a TM will auto-sort all the stored contents). I'll fix that in the next version of Essentials (and probably just include the auto-sorting feature anyway while I'm at it).

    Triple Triad cards aren't actually items. They're Pokémon species numbers which are then interpreted to be cards. It would be quite a bit of hassle to make them able to be shown in the Bag along with real items, not to mention completely unnecessary as the TT library really should be its own unique thing (for several practical reasons).
     

    IceGod64

    In the Lost & Found bin!
    624
    Posts
    15
    Years
  • It also affects the item storage in the player's PC (i.e. storing a TM will auto-sort all the stored contents). I'll fix that in the next version of Essentials (and probably just include the auto-sorting feature anyway while I'm at it).

    Triple Triad cards aren't actually items. They're Pokémon species numbers which are then interpreted to be cards. It would be quite a bit of hassle to make them able to be shown in the Bag along with real items, not to mention completely unnecessary as the TT library really should be its own unique thing (for several practical reasons).
    I agree with this statement.. The method you explained here you've explained here reminds me of the ... Dirty methods (Storing the players name in the Wild Encounter data for instance).
     

    Maruno

    Lead Dev of Pokémon Essentials
    5,286
    Posts
    16
    Years
    • Seen May 3, 2024
    Not really. It is absolutely not a problem if you don't want auto-sorting. It's actually a very convenient way of dealing with three separate thing-storing facets (Bag, PC item storage and TT library) using the same one script.

    Besides, adapting it to allow auto-sorting for just one of those facets is quite easy.

    In any case, auto-sorting the Triple Triad library doesn't tend to lead to Missingno. :P
     
    Back
    Top