Jump to content

Hall of Fame in gen 3


Recommended Posts

Hi there,

 

I'm having troubles with parsing Hall of Fame in gen 3 games, namely with level/species bitfield. Save I'm using is Twitch plays Pokemon Fire Red

Steps to reproduce (assume that the sections are ordered correctly already):

 

1. from the savefile, extract HoF sections, from 0x1C000 to 0x1E000 (8192, section footers doesn't matter in this case)

2. knowing there's only one entry, grab first pokemon from the team, so from the array from previous point extract 20 bytes

3. from the array from previous post, extract 2-byte array from 0x08 to 0x0A to retrieve species/level bitfield

 

and the value is 28007. According to Bulbapedia and decompiled Fire Red game, "species" part is 9-bit long, so 28007 & 0x1FF it is. But instead of getting 334, I'm getting 359, which is not Altaria dex number whatsoever. But the level part of the bitfield seems correct (28007 >> 9 = 54), at last for Altaria. What am I missing? This was cracked already as there's gen 3 HoF extractor (https://projectpokemon.org/home/files/file/1127-hall-of-fame-extractor/, no source code published unfortunately) which gets dex number correctly and there's also a HoF implementation in PkHeX (Saves/Substructures/Gen3/HallFame3.cs) but unfortunately unused so I cannot add a breakpoint there to see whats happening. Can you spot what am I doing wrong?

Link to comment
Share on other sites

359 is Altarias internal species ID. The internal order does not match the national dex order as you can see in this table: https://bulbapedia.bulbagarden.net/wiki/List_of_Pokémon_by_index_number_in_Generation_III

You could do what PKHeX does and add/subtract the difference between the internal and actual IDs: https://github.com/kwsch/PKHeX/blob/27b552db134b93015b1641ecdca3bc111b7d0016/PKHeX.Core/PKM/Util/Conversion/SpeciesConverter.cs#L30

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