The PokéCommunity Forums  

Go Back   The PokéCommunity Forums > Creative Discussions > Game Development > Pokémon Essentials
Sign Up Rules/FAQ Live Battle Blogs Mark Forums Read

Notices

Pokémon Essentials All questions and discussion about Pokémon Essentials, the Pokémon game kit for RPG Maker XP, go in here. Also contains links to the latest downloads and the Essentials Wiki.


Advertise here

Reply
 
Thread Tools
  #1    
Old July 19th, 2012, 05:02 PM
Pia Carrot's Avatar
Pia Carrot
Gen II Hacker | PHO Enthusiast
 
Join Date: Aug 2010
Age: 19
Gender: Male
Nature: Adamant

Advertise here
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
__________________



Reply With Quote
  #2    
Old July 20th, 2012, 02:32 AM
Maruno's Avatar
Maruno
Lead Dev of Pokémon Essentials
 
Join Date: Jan 2008
Location: England
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.
__________________
Reply With Quote
  #3    
Old July 20th, 2012, 05:25 AM
Pia Carrot's Avatar
Pia Carrot
Gen II Hacker | PHO Enthusiast
 
Join Date: Aug 2010
Age: 19
Gender: Male
Nature: Adamant
Quote:
Originally Posted by Maruno View Post
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.
__________________



Reply With Quote
  #4    
Old July 20th, 2012, 05:42 AM
Maruno's Avatar
Maruno
Lead Dev of Pokémon Essentials
 
Join Date: Jan 2008
Location: England
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.
__________________
Reply With Quote
  #5    
Old July 20th, 2012, 06:04 AM
Pia Carrot's Avatar
Pia Carrot
Gen II Hacker | PHO Enthusiast
 
Join Date: Aug 2010
Age: 19
Gender: Male
Nature: Adamant
Quote:
Originally Posted by Maruno View Post
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.
__________________



Reply With Quote
  #6    
Old July 21st, 2012, 09:45 AM
IceGod64's Avatar
IceGod64
My imagination.
 
Join Date: Oct 2008
Location: Castelia City
Age: 26
Gender: Male
Nature: Naive
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.
__________________

Reply With Quote
  #7    
Old July 21st, 2012, 10:31 AM
Maruno's Avatar
Maruno
Lead Dev of Pokémon Essentials
 
Join Date: Jan 2008
Location: England
Quote:
Originally Posted by IceGod64 View Post
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.


Quote:
Originally Posted by IceGod64 View Post
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]
        items.sort! if pbIsMachine?(item)
        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.
__________________
Reply With Quote
  #8    
Old July 21st, 2012, 02:56 PM
IceGod64's Avatar
IceGod64
My imagination.
 
Join Date: Oct 2008
Location: Castelia City
Age: 26
Gender: Male
Nature: Naive
Quote:
Originally Posted by Maruno View Post
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]
        items.sort! if pbIsMachine?(item)
        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.
__________________

Reply With Quote
  #9    
Old July 21st, 2012, 03:56 PM
Maruno's Avatar
Maruno
Lead Dev of Pokémon Essentials
 
Join Date: Jan 2008
Location: England
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).
__________________
Reply With Quote
  #10    
Old July 21st, 2012, 09:49 PM
IceGod64's Avatar
IceGod64
My imagination.
 
Join Date: Oct 2008
Location: Castelia City
Age: 26
Gender: Male
Nature: Naive
Quote:
Originally Posted by Maruno View Post
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).
__________________

Reply With Quote
  #11    
Old July 22nd, 2012, 04:37 AM
Maruno's Avatar
Maruno
Lead Dev of Pokémon Essentials
 
Join Date: Jan 2008
Location: England
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.
__________________
Reply With Quote
Reply
Quick Reply

Sponsored Links


Advertise here
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Minimum Characters Per Post: 25



All times are UTC -8. The time now is 10:16 AM.


Style by Nymphadora, artwork by Sa-Dui.
Like our Facebook Page Follow us on Twitter © 2002 - 2014 The PokéCommunity™, pokecommunity.com.
Pokémon characters and images belong to The Pokémon Company International and Nintendo. This website is in no way affiliated with or endorsed by Nintendo, Creatures, GAMEFREAK, The Pokémon Company or The Pokémon Company International. We just love Pokémon.
All forum styles, their images (unless noted otherwise) and site designs are © 2002 - 2014 The PokéCommunity / PokéCommunity.com.
PokéCommunity™ is a trademark of The PokéCommunity. All rights reserved. Sponsor advertisements do not imply our endorsement of that product or service. User generated content remains the property of its creator.