Closed narenbiardo closed 1 year ago
112 is Rhydon's species ID. The "Nickname" should be showing up between those two dashes.
Without seeing the file, the only idea is that your file has no nickname stored in the data.
In Generation 1/2, the character encoding is not able to be determined from just the data, and must be specified. It is by default assumed not Japanese.
Sorry for the confusion earlier, I didn't mean to refer to the nickname. I just noticed that the information related to Rhydon is being displayed instead.
To give you a better idea, PK1.Species always returns 112.
I'll attach a piece of hard-coded code that causes this bug, as well as the .pk1 file I'm using.
byte[] dataPK1 = File.ReadAllBytes("../Shared/063 - ABRA - 3172.pk1");
PKHeX.Core.PK1 PK1 = new PKHeX.Core.PK1(dataPK1);
Console.Write(PK1.Species);
pk1 serialized/saved files are actually PokeList1
.
Hey, thanks a lot for your extremely helpful answer!
I've only been using PKHeX.Core for about a week now, and everything I've been able to accomplish so far is thanks to reading code.
I've been looking for documentation but haven't found any. Do you have any idea if there's any documentation out there? At least to try to avoid confusion like this in the future.
There's no "examples" of how to use the nuget package besides the source code here. Most of the public API has xmldoc associated with it (besides constructors, like this case).
pk1/pk2 | pokelist1/2 is the way it is because it tries to mimic how the game stores pkm data. The IsEgg
flag is not stored with the pkm struct, and the Nick/OT strings are stored separately too.
https://github.com/kwsch/PKHeX/blob/8e177708b766f14f97091c27c55e3a53ba48f1cd/PKHeX.Core/PKM/Shared/GBPKM.cs#L27 https://github.com/kwsch/PKHeX/blob/8e177708b766f14f97091c27c55e3a53ba48f1cd/PKHeX.Core/PKM/PK1.cs#L37
Thank you so much for your help, I understand it a bit better now.
It's kinda weird how accessing the data in .pk1 and .pk2 files is different using pokelist1/2 compared to the rest of the .pk, but I guess it makes more sense than I'm realizing since I don't know how the games storage works 😓.
Anyway, I finally managed to implement what I've been trying to do for a while now, it was driving me crazy! Thanks again for your help!
Hey guys, I'm running into a really weird issue with PKHeX.Core, no matter which pk1 file I try to load, when I try to access its information, it always returns the exact same thing, regardless of the file I used.
It looks like the PK1 is Rhydon, since when I try to access it through the PK1.Species method, it always returns "112". The weirdest part is that when I try to get the file name using the PK1.FileName method, it returns "112 - - 8FE7.pk1".
I know for a fact that the .pk1 files I'm using are correct and legal, since they were extracted from my personal saves.
One interesting thing to note is that if I take that same .pk1 file and convert it to .pk7, the methods to get its information work correctly.
It's worth noting that the .pk1 files display correctly in the PKHeX graphical user interface.
Using .NET 7.0.203 and PKHeX.Core 23.4.6