Dad_Shoes Posted October 21 Share Posted October 21 Hello, I have been trying to find if a tool exists that will allow me to obtain the Pokémon from trainers that I have mixed records with, specifically ones that appear in the Battle Tower. I have attempted to use various programs such as PKHex, PKX Extraction, and an old one I found called Trigger's PC. The Pokémon in question belong to my sister's Ruby save file that she lost the cartridge to over 20 years ago; I do not have her Secret Base (I may have deleted it as a kid) however I found out that I still have access to a very limited amount of trainer data whenever I challenge the Level 50 Battle Tower. I attempted to use the method used at this link here, however PKX Extraction insists that 0 Pokémon were found when reading the dump. I'm assuming the memory address and size that is recommended is not the same when using the Battle Tower. I even tried just loading the entire save into PKX Extraction, but they weren't there either. I am using VisualBoyAdvance 2.1.11. I have access to my save file and I can gladly upload it for others to check, alongside her trainer's name, Pokémon name and level, etc. Is there a way for me to access her party data after all this time? I would love to be able to finally give her just *some* of the Pokémon she lost. Thank you for any potential help. Link to comment Share on other sites More sharing options...
theSLAYER Posted October 21 Share Posted October 21 @Dad_Shoes it probably wasn’t full pk3 data; I imagine it used truncated data, that can be used for a functional battle but not for full legality, with the data being like Hall of Fame records. Maybe share save, the trainer name you want to find (exact, with or without capitalisation), notable species and moves. Maybe from there can try to jump into the save and take a look. Link to comment Share on other sites More sharing options...
Dad_Shoes Posted October 23 Author Share Posted October 23 On 10/21/2024 at 4:36 PM, theSLAYER said: @Dad_Shoes it probably wasn’t full pk3 data; I imagine it used truncated data, that can be used for a functional battle but not for full legality, with the data being like Hall of Fame records. Maybe share save, the trainer name you want to find (exact, with or without capitalisation), notable species and moves. Maybe from there can try to jump into the save and take a look. Sorry for the delay. Thank you, I'll attach the file here. Please let me know when you download it so I can remove anyone else downloading and copying my Pokémon data. I have the save file and the savestate if you need both. My sister's save file name was "AMANDA" and the Battle Tower trainer data is "PSYCHIC AMANDA". There is a Level 49 Walrein, 46 Pikachu named "THUNDER", and 25 Tropius. I'd love to see if any other Pokémon is there. Link to comment Share on other sites More sharing options...
theSLAYER Posted October 24 Share Posted October 24 15 hours ago, Dad_Shoes said: Sorry for the delay. Thank you, I'll attach the file here. Please let me know when you download it so I can remove anyone else downloading and copying my Pokémon data. I have the save file and the savestate if you need both. My sister's save file name was "AMANDA" and the Battle Tower trainer data is "PSYCHIC AMANDA". There is a Level 49 Walrein, 46 Pikachu named "THUNDER", and 25 Tropius. I'd love to see if any other Pokémon is there. I'm getting 4 hits for AMANDA (in Gen 3 encoding), 2 per save block. Will review the data. Edit: So, I cannot open your state save. States saves usually don't end up usable if the settings different or something. In any case, I am making *some* progress with your save. I am not fully confident on where the breaks for each mon are, but at least I do see the data for AMANDA. There's only three mons for her. Also, if you can provide me specifics such as TID or moves of one of the mons, it'll help me identify the corresponding spots. It appears to be a very stripped down format, different from the other ones I know. 1 Link to comment Share on other sites More sharing options...
Dad_Shoes Posted October 25 Author Share Posted October 25 (edited) 18 hours ago, theSLAYER said: I'm getting 4 hits for AMANDA (in Gen 3 encoding), 2 per save block. Will review the data. Edit: So, I cannot open your state save. States saves usually don't end up usable if the settings different or something. In any case, I am making *some* progress with your save. I am not fully confident on where the breaks for each mon are, but at least I do see the data for AMANDA. There's only three mons for her. Also, if you can provide me specifics such as TID or moves of one of the mons, it'll help me identify the corresponding spots. It appears to be a very stripped down format, different from the other ones I know. Hey, thank you for the start. I'm currently in the Battle Tower battling her team and trying to learn the attacks everything has. ________Starting the Battle Tower________ Okay, this took just around 5 or so minutes, this was surprisingly cooperative: The Walrein has Rock Smash, Body Slam, Waterfall, and Aurora Beam. THUNDER (Pikachu) has Shock Wave, Thunder Bolt, Thunder, and Dig. Tropius has Stomp, Sweet Scent, Growth, and Razor Leaf. I vaguely remember the team she would have had. I don't know if these were on her team, but I do know that she had a high-level Mudkip that she never evolved, a Groudon that I think had Solar Beam, and she might have just captured Latios (I think that was one of the last things she did before the game was lost forever) but I might not remember that properly. I want to say that she traded me a Golduck and/or Dodrio, but I traded them to her Diamond in ~2011ish and she may have restarted her save without realizing they were in there. If possible, the Mudkip is the most important one of the Pokémon that don't show up in the Battle Tower. I'm not sure if her whole team exists or just the trimmed down 3-Pokémon team for the Tower, but that's one that I'm hoping for. I'm going to try to use Hall of Fame Extractor to see if I have any of those in the Hall of Fame with a Trainer ID that isn't mine. There are up to 50 total Hall of Fame entries that are recorded in Gen 3, so I'm going through each slot. ________Checking all 50 slots________ In the application, the Golduck in the Hall of Fame has an ID of 30171 and Secret ID of 28575, Level 44. I'm not positive that this is from her save file but it's the only Golduck with an ID that doesn't appear anywhere. If you're using Hall of Fame Extractor it will appear as Entry #27. In game, it will appear as HALL OF FAME No. 44. Again, I'm not sure if that ID is hers but it's probably the best clue I have. If there's anything else I can possibly provide, I will gladly share more. Edited October 25 by Dad_Shoes Clarification on what I mean by "50 slots" Link to comment Share on other sites More sharing options...
theSLAYER Posted October 25 Share Posted October 25 On 10/25/2024 at 12:53 PM, Dad_Shoes said: Hey, thank you for the start. I'm currently in the Battle Tower battling her team and trying to learn the attacks everything has. ________Starting the Battle Tower________ Okay, this took just around 5 or so minutes, this was surprisingly cooperative: The Walrein has Rock Smash, Body Slam, Waterfall, and Aurora Beam. THUNDER (Pikachu) has Shock Wave, Thunder Bolt, Thunder, and Dig. Tropius has Stomp, Sweet Scent, Growth, and Razor Leaf. I vaguely remember the team she would have had. I don't know if these were on her team, but I do know that she had a high-level Mudkip that she never evolved, a Groudon that I think had Solar Beam, and she might have just captured Latios (I think that was one of the last things she did before the game was lost forever) but I might not remember that properly. I want to say that she traded me a Golduck and/or Dodrio, but I traded them to her Diamond in ~2011ish and she may have restarted her save without realizing they were in there. If possible, the Mudkip is the most important one of the Pokémon that don't show up in the Battle Tower. I'm not sure if her whole team exists or just the trimmed down 3-Pokémon team for the Tower, but that's one that I'm hoping for. I'm going to try to use Hall of Fame Extractor to see if I have any of those in the Hall of Fame with a Trainer ID that isn't mine. There are up to 50 total Hall of Fame entries that are recorded in Gen 3, so I'm going through each slot. ________Checking all 50 slots________ In the application, the Golduck in the Hall of Fame has an ID of 30171 and Secret ID of 28575, Level 44. I'm not positive that this is from her save file but it's the only Golduck with an ID that doesn't appear anywhere. If you're using Hall of Fame Extractor it will appear as Entry #27. In game, it will appear as HALL OF FAME No. 44. Again, I'm not sure if that ID is hers but it's probably the best clue I have. If there's anything else I can possibly provide, I will gladly share more. Using your Blaziken as a reference, I was able to dissect the data and determine what they correspond too: Not gonna lie, it is a bit more than what I thought it would have been, but most of them (such as relevant stats) being there makes sense, since those are needed for battle. It would have been nice if Origin Data and Met location was there (needed for legality), but we could always make educated guesses for those. With this I can go ahead and extract the 3 mons of hers (as far as I can tell, only 3 mons per mixed trainer are stored). Probably may make a PKHeX plugin down the road so we can see the other mons of mixed trainers. So notably, the stuff that is missing from the data structure are: Language, misc flags, markings, PP bonuses, friendship, contest stats, pokerus, met location, origin info (location, ball caught in), ribbons, fateful encounter flag. Edit again: I’ve made good progress with my building my plugin. I’m able to send all the data available for the Mon to PKHeX ‘s viewer. It’s technically workable as it is but I’ll like to see if I can bake in PKHeX legality features. 1 Link to comment Share on other sites More sharing options...
theSLAYER Posted October 29 Share Posted October 29 @Dad_Shoes I believe I am done with my plugin, including getting it to legalize different common mons. I can't seem to find out how the gender of the player is stored, but it is fine, since we can easily swap genders in my plugin. BattleTower.dll 1 Link to comment Share on other sites More sharing options...
BlackShark Posted October 29 Share Posted October 29 54 minutes ago, theSLAYER said: I can't seem to find out how the gender of the player is stored It's not stored directly, but there is a trainer class stored at the offset right before the streak. From the list of possible classes for each gender you could determine what the player gender was https://github.com/pret/pokeemerald/blob/master/src/battle_tower.c#L153 Link to comment Share on other sites More sharing options...
theSLAYER Posted October 29 Share Posted October 29 6 hours ago, BlackShark said: It's not stored directly, but there is a trainer class stored at the offset right before the streak. From the list of possible classes for each gender you could determine what the player gender was https://github.com/pret/pokeemerald/blob/master/src/battle_tower.c#L153 Thanks, that’s what I needed! I assumed the game used the TID/SID of the trainer to generate the trainer class. I saw figures in front, but when I modified them I couldn’t get the trainer to show up so I gave up which ones am I looking at? >< Link to comment Share on other sites More sharing options...
BlackShark Posted October 29 Share Posted October 29 2 hours ago, theSLAYER said: which ones am I looking at? >< The linked array was for the males, the females are right below. Here are both arrays with actual values instead of constants. private static readonly byte[] MaleTrainerTowerClasses = [ 0x0E, // FACILITY_CLASS_RUIN_MANIAC 0x11, // FACILITY_CLASS_TUBER_M 0x03, // FACILITY_CLASS_COOLTRAINER_M 0x15, // FACILITY_CLASS_RICH_BOY 0x17, // FACILITY_CLASS_POKEMANIAC 0x07, // FACILITY_CLASS_SWIMMER_M 0x0A, // FACILITY_CLASS_BLACK_BELT 0x19, // FACILITY_CLASS_GUITARIST 0x1A, // FACILITY_CLASS_KINDLER 0x1B, // FACILITY_CLASS_CAMPER 0x1D, // FACILITY_CLASS_BUG_MANIAC 0x1E, // FACILITY_CLASS_PSYCHIC_M 0x20, // FACILITY_CLASS_GENTLEMAN 0x26, // FACILITY_CLASS_SCHOOL_KID_M 0x29, // FACILITY_CLASS_POKEFAN_M 0x09, // FACILITY_CLASS_EXPERT_M 0x2B, // FACILITY_CLASS_YOUNGSTER 0x2D, // FACILITY_CLASS_FISHERMAN 0x2E, // FACILITY_CLASS_CYCLING_TRIATHLETE_M 0x30, // FACILITY_CLASS_RUNNING_TRIATHLETE_M 0x32, // FACILITY_CLASS_SWIMMING_TRIATHLETE_M 0x34, // FACILITY_CLASS_DRAGON_TAMER 0x04, // FACILITY_CLASS_BIRD_KEEPER 0x35, // FACILITY_CLASS_NINJA_BOY 0x3A, // FACILITY_CLASS_SAILOR 0x05, // FACILITY_CLASS_COLLECTOR 0x42, // FACILITY_CLASS_PKMN_BREEDER_M 0x44, // FACILITY_CLASS_PKMN_RANGER_M 0x43, // FACILITY_CLASS_BUG_CATCHER 0x00 // FACILITY_CLASS_HIKER ]; private static readonly byte[] FemaleTrainerTowerClasses = [ 0x0D, // FACILITY_CLASS_AROMA_LADY 0x10, // FACILITY_CLASS_TUBER_F 0x12, // FACILITY_CLASS_COOLTRAINER_F 0x0C, // FACILITY_CLASS_HEX_MANIAC 0x13, // FACILITY_CLASS_LADY 0x14, // FACILITY_CLASS_BEAUTY 0x1F, // FACILITY_CLASS_PSYCHIC_F 0x27, // FACILITY_CLASS_SCHOOL_KID_F 0x2A, // FACILITY_CLASS_POKEFAN_F 0x16, // FACILITY_CLASS_EXPERT_F 0x2F, // FACILITY_CLASS_CYCLING_TRIATHLETE_F 0x31, // FACILITY_CLASS_RUNNING_TRIATHLETE_F 0x33, // FACILITY_CLASS_SWIMMING_TRIATHLETE_F 0x36, // FACILITY_CLASS_BATTLE_GIRL 0x37, // FACILITY_CLASS_PARASOL_LADY 0x38, // FACILITY_CLASS_SWIMMER_F 0x1C, // FACILITY_CLASS_PICNICKER 0x02, // FACILITY_CLASS_PKMN_BREEDER_F 0x45, // FACILITY_CLASS_PKMN_RANGER_F 0x47 // FACILITY_CLASS_LASS ]; 1 Link to comment Share on other sites More sharing options...
theSLAYER Posted October 30 Share Posted October 30 @BlackShark the facility classes ID differs between Emerald and RS, so once I accounted for that it looks correct now @Dad_Shoes I don't have the images set up for Emerald yet, but shouldn't affect functionality for exporting mons BattleTower.dll 1 1 Link to comment Share on other sites More sharing options...
Dad_Shoes Posted October 30 Author Share Posted October 30 (edited) 7 hours ago, theSLAYER said: @BlackShark the facility classes ID differs between Emerald and RS, so once I accounted for that it looks correct now @Dad_Shoes I don't have the images set up for Emerald yet, but shouldn't affect functionality for exporting mons BattleTower.dll Thank you, this is great. One thing I noticed looking at the picture, the ID and Secret ID appear to be swapped. 30171 is the Trainer ID and should come first while 28575 is the Secret ID. Other than that, I can't thank you enough. EDIT: I already sent you a message with the details but I received an Error Exception and the plugin cannot open. I have the latest version of PKHex. Edited October 30 by Dad_Shoes Problem with plugin Link to comment Share on other sites More sharing options...
theSLAYER Posted October 31 Share Posted October 31 5 hours ago, Dad_Shoes said: Thank you, this is great. One thing I noticed looking at the picture, the ID and Secret ID appear to be swapped. 30171 is the Trainer ID and should come first while 28575 is the Secret ID. Other than that, I can't thank you enough. EDIT: I already sent you a message with the details but I received an Error Exception and the plugin cannot open. I have the latest version of PKHex. I probably just switched the text boxes for display, I think extracting the Mon has it correct. Also, is the error only when you try to extract a Mon, or flipping through entries, etc. how and when did the error occur? Helps me to narrow down the issue. I can probably look at it when I get home (at work rn) Link to comment Share on other sites More sharing options...
Dad_Shoes Posted October 31 Author Share Posted October 31 1 minute ago, theSLAYER said: I probably just switched the text boxes for display, I think extracting the Mon has it correct. Also, is the error only when you try to extract a Mon, or flipping through entries, etc. how and when did the error occur? Helps me to narrow down the issue. I can probably look at it when I get home (at work rn) The error occurs when I click on the plugin from the Tools drop-down menu. I just clicked it and it gives me the error code and I'm unable to even use it. Link to comment Share on other sites More sharing options...
theSLAYER Posted October 31 Share Posted October 31 10 hours ago, Dad_Shoes said: The error occurs when I click on the plugin from the Tools drop-down menu. I just clicked it and it gives me the error code and I'm unable to even use it. Okay, I’ll look into it! Edit @Dad_Shoes after an hour of head scratching, I have fixed it. Tried it on latest regular PKHeX, and it works. Also fixed up Emerald's trainer sprites cause why not. BattleTower.dll Link to comment Share on other sites More sharing options...
Dad_Shoes Posted October 31 Author Share Posted October 31 (edited) 19 hours ago, theSLAYER said: Okay, I’ll look into it! Edit @Dad_Shoes after an hour of head scratching, I have fixed it. Tried it on latest regular PKHeX, and it works. Also fixed up Emerald's trainer sprites cause why not. BattleTower.dll 233.5 kB · 2 downloads The plugin works! The only thing I have a question with is how it determines the caught location of each Pokemon. Is it just guessing or does it actually know? I'm asking since it claims her Pikachu was caught at Level 3 in FireRed's Viridian Forest; meanwhile I'm almost positive she lost her game before FireRed and LeafGreen came out and she had LeafGreen when she did get one of them, not FireRed. I thought it was just guessing so I changed the capture location and ball it was caught in, but it insists that it's invalid now. I'm not sure how it claims it's a "Fateful Encounter" when it's not checked as one, nor how it can't match the encounter with Ruby Version. (Hehe, I learned how to insert a picture) The Pikachu that's to the right of the highlighted one is before I changed the Origin Game, Ball, and Met Level. If it's actually from Kanto instead, that would be a bit confusing as I'm sure she got LeafGreen after losing her Ruby. Edit: I tried looking through other Trainers' data from the plugin and it changes the OT and ID/SID for Pokemon that weren't native to that save (I'm looking at #0, being my save's trainer). Her Pikachu has the same ID/SID as the others, so it should indeed be from Ruby and not Kanto. Edited October 31 by Dad_Shoes Clarifying the source of Pikachu Link to comment Share on other sites More sharing options...
theSLAYER Posted November 1 Share Posted November 1 8 hours ago, Dad_Shoes said: The plugin works! The only thing I have a question with is how it determines the caught location of each Pokemon. Is it just guessing or does it actually know? I'm asking since it claims her Pikachu was caught at Level 3 in FireRed's Viridian Forest; meanwhile I'm almost positive she lost her game before FireRed and LeafGreen came out and she had LeafGreen when she did get one of them, not FireRed. Given the PIDIV is Method_4, there's a few possibilities, ranging from event to a static encounter. If I was doing it by hand, I would compared the PID and encounter slots, we can derive/educated guess met level and met location. For the plugin, I am using PKHeX's suggest feature, and in the plugin I have code to loop through various games and return the first possible legal match. So this is what it would have looked like if locked to Ruby: In the above scenario, PKHeX reckons it was an Event Pichu Egg (hence Met level being 0). As for what you have tried to change it to, RS Safari Zone Pikachu can only be Level 25 or level 27. It appears illegal for you as 26 is the wrong level. This is what it would have looked like with the correct encounter details: 8 hours ago, Dad_Shoes said: Edit: I tried looking through other Trainers' data from the plugin and it changes the OT and ID/SID for Pokemon that weren't native to that save (I'm looking at #0, being my save's trainer). Her Pikachu has the same ID/SID as the others, so it should indeed be from Ruby and not Kanto. I probably mentioned a while back, but origin game (and other met details) were not part of the data that is stored in Battle Tower Mixed Records. The plugin also doesn't compare all the mons to try to determine the likely game. If there's no override, it would cycle through games to try to get to the first legal match. There can be more than one legal match. 1 Link to comment Share on other sites More sharing options...
Dad_Shoes Posted November 1 Author Share Posted November 1 13 hours ago, theSLAYER said: Given the PIDIV is Method_4, there's a few possibilities, ranging from event to a static encounter. If I was doing it by hand, I would compared the PID and encounter slots, we can derive/educated guess met level and met location. For the plugin, I am using PKHeX's suggest feature, and in the plugin I have code to loop through various games and return the first possible legal match. So this is what it would have looked like if locked to Ruby: In the above scenario, PKHeX reckons it was an Event Pichu Egg (hence Met level being 0). As for what you have tried to change it to, RS Safari Zone Pikachu can only be Level 25 or level 27. It appears illegal for you as 26 is the wrong level. This is what it would have looked like with the correct encounter details: I probably mentioned a while back, but origin game (and other met details) were not part of the data that is stored in Battle Tower Mixed Records. The plugin also doesn't compare all the mons to try to determine the likely game. If there's no override, it would cycle through games to try to get to the first legal match. There can be more than one legal match. Ah, of course I chose the single level that wouldn't work. I misread Serebii's encounter table and thought it is found between Levels 25 *and* 27, not or. That's completely on me. I think that's everything I needed to ask and accomplish. I appreciate you making this plugin just because of my single question. Thank you for everything. Link to comment Share on other sites More sharing options...
theSLAYER Posted November 2 Share Posted November 2 4 hours ago, Dad_Shoes said: Ah, of course I chose the single level that wouldn't work. I misread Serebii's encounter table and thought it is found between Levels 25 *and* 27, not or. That's completely on me. I think that's everything I needed to ask and accomplish. I appreciate you making this plugin just because of my single question. Thank you for everything. No worries, personally I thought it was interesting and a fun exercise. Glad you got what you needed out of it Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now