Jump to content

Emerald trainer name


Xibei

Recommended Posts

I have a Pokémon Emerald save that after using PKSM on it some data got corrupted somehow: it took a long time to load, and when it did the trainer name had been replaced with gibberish. So i opened it on PKHeX hoping to fix it, and when I try to edit the name I can write on the name field, but after clicking "Save" and opening the "Trainer Info" tab again, the name will always appear blank and won't update to whatever I write on it. I've tried running the save file and it seems to work fine, but the trainer name is blank. My old Pokémon correctly state my previous name as their OT's, but they behave like traded Pokémon since my current trainer name doesn't line up. New Pokémon will list a blank space on their OT field. The save file is in the format .gbavc.sav and it only appears to happen with this save, I tried editing a Pokémon Yellow trainer's name and it worked correctly.

 

Does anyone have any idea how to fix it? :/

trainernameemerald.png

Edited by Xibei
Link to comment
Share on other sites

1 hour ago, Kaphotics said:

PKHeX is assuming your save file is Japanese, and every character in the trainer name is probably 0x00.

You can fix it with a hex editor after specifying a new OT name and then with the hex editor ensuring all 7 trainer name bytes are set (or 0xFF). OR just revert to a backup save file.

Would you mind narrowing down a bit how to do that? I'm struggling to understand if I'm looking at the right places. As for the extra backup save file, it's not an option unfortunately...

Link to comment
Share on other sites

https://github.com/kwsch/PKHeX/blob/5708310f6f075dd29b9b28e5131c2b9a676cb881/PKHeX.Core/Saves/SAV3.cs#L51-L54

https://github.com/kwsch/PKHeX/blob/5708310f6f075dd29b9b28e5131c2b9a676cb881/PKHeX.Core/Saves/SAV3.cs#L304-L354

1. Download a hex editor (ex. HxD)

2. Based on the structure of Gen3 save files, you need to locate where the Trainer Name is stored. Referring to PKHeX's code, the OT Name is stored at the start of the Small structure block, occupies 8 bytes, and is immediately followed by [byte Gender, byte Padding, uint TIDSID]. If you can find your Trainer ID at any offset (0x*00A), with data roughly matching the playtime, try changing the first 6 bytes (0x*000 - 0x*006) to be 0xFF. Do this for the backup save as well, so it'll need to be done at another offset with the same style.

3. Load in pkhex, should load as SAV3EU, export. Should be fixed.

Link to comment
Share on other sites

Thanks for the explanation, but I think it's way too much for me, I cannot find my way around it at all. That said, your pointer about it recognizing it as Japanese came in handy: I've input the name as full-width characters (within the 5 character limit restraint) and I'll just call it a day.

Link to comment
Share on other sites

Hey! The same thing just happened to me today. I didnt use pksm untill i caught a Trapinch, and the only thing i did was change its nature. I went back into the game and the game timer went to 00:00 and trainer name was changed to CE (can barely see the E). And when i opened the box its just freezes out, and when i open the "Trainer" id section it blacks out. -.- Did u find a solution?

Link to comment
Share on other sites

4 hours ago, ALP96 said:

Hey! The same thing just happened to me today. I didnt use pksm untill i caught a Trapinch, and the only thing i did was change its nature. I went back into the game and the game timer went to 00:00 and trainer name was changed to CE (can barely see the E). And when i opened the box its just freezes out, and when i open the "Trainer" id section it blacks out. -.- Did u find a solution?

I solved my issue with PKHeX on my PC, so if you haven't already you can export the save file as described here: https://digiex.net/threads/3ds-gba-save-backup-and-restore-with-godmode9.15395/

In my case I had to fix the data within "Trainer Info" in the "SAV" tab, in your case maybe the name and time played will have to be corrected, possibly even "Clock (RTC)". Make small adjustments and import the game and see what works. I hope you can figure it out :)

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...