Jump to content

Are the int values for PKHeX Held Items consistent with the bulbapedia data?


Recommended Posts

Hello,

Am an experienced user with PKHeX but an inexperienced user when it comes to using the PKHeX.core DLL. I've been making my way through it with some posts, but ran into a part of the code that's not super well documented as it related to held items.

So, if I have a PK4 pokemon object for example, it looks like there's an integer field where I can assign it a held item like in the GUI:

public override int HeldItem { get => ReadUInt16LittleEndian(Data.AsSpan(0x0A)); set => WriteUInt16LittleEndian(Data.AsSpan(0x0A), (ushort)value); }

 

For other fields (i.e. abilities), I've been able to use the enums in the DLL to decode what number value corresponds to what value. However, there doesn't seen to really be any documentation or references to figure out what means what. I did find some unrelated code in the game strings that mentions held items like max potions, etc. but I'm not sure how to get an index I could use. It also seems like the integer index may change depending on generation because I saw that gen4 mail seems to shift the indexes. Does the integer value used internally correlate with the bulpapedia integer values? ex. below for gen 4:

https://bulbapedia.bulbagarden.net/wiki/List_of_items_by_index_number_(Generation_IV)

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...