Jump to content

Recommended Posts

Posted (edited)

I've been playing HG on my phone using Drastic. I had but a simple desire: to have my Graveler evolve into a Golem. But with no trading supported on Drastic I was without hope. So, I did what any simple man would do... I got a computer science degree and become an operating systems engineer... Kidding aside, I just want to have a Golem in my HG save that I play on my Pixel 7 using Drastic. 

So, I open up PKHex on my Windows 10 PC, click, clack and my Graveler is a Golem. I export the file and put it back in the "backup" directory on my phone where I got the unedited .dsv file from in the first place. I go to launch the game and nothing--Drastic just quits back to the menu. I put the old file back--works perfectly. I did all kinds of troubleshooting. I looked at the two .dsv files in a hex diff tool. The sizes of the files don't change just some "bits in the middle", presumably the Graveler bits. 

The real kicker is that I downloaded Desume on my PC and was able to open up the edited .dsv there and see my precious newly evolved Golem following me around.

So, why, ohhhhh, why is the file not working with Drastic on my phone?

4780 - Pokemon HeartGold (U)(Xenophobia).dsv Edited-2024-11-03-4780 - Pokemon HeartGold (U)(Xenophobia).dsv

Edited by ZacHacks
Spelling
  • ZacHacks changed the title to PKHex Rendering HG Save Unplayable - Drastic Only! - Works on Desume!
Posted

Two more bits of data:

1. I took the working file and opened it in PKHex and did nothing to it and exported it and tried loading it and it DID NOT WORK.

2. I sent the working file to my PC and saved it there. I did nothing to it, didn't open it or anything. I sent it back to my phone and saved it in the backup directory and it also DID NOT WORK.

Point two makes me think that permissions might be to blame, but the file manager app on my phone was showing -rw for both of them but I am going to look into that more.

Posted

Unfortunately, that did not work, but thank you for the suggestion. It failed in the same way as before.

Given that just saving it onto my PC and then sending it back to the phone makes it unplayable, it doesn't seem to be the file contents that are the problem but rather the metadata.

Posted

So, I found a rather convoluted workaround. I edited my save on my PC as usual. I wrote a Python script that copies byte by byte from the edited file to the working file. But the key point here is that I run that Python script on my phone using PyDroid3. This proves it's metadata that's the problem and not the save file or the changes PKHex is making to it.

Another interesting note is that when I first tried to do this, I ran the script in the directory that I had explicitly set as the directory for Drastic in the Drastic General settings. When I first tried after doing it there, Drastic gave me new errors about the directory not being usable and I obviously couldn't launch then. So, I made a new dir and copied all the relevant stuff to it, and after pointing Drastic to that new dir, it worked--my beautiful Golem was alive on my phone. But I think this just points to more Android file permission/metadata issues that I don't really understand. I think PyDroid must have changed the permissions/metadata of one of the files or the parent dir when it ran. But now I just copy post-script-copied file to the newly set Drastic dir and it works... 

Convoluted but functional, the motto of all software everywhere.

The script is roughly as follows:

import os

writePath = '4780 - Pokemon HeartGold (U)(Xenophobia).dsv'
readPath = 'Edited-NotGrav-4780 - Pokemon HeartGold (U)(Xenophobia).dsv'

with open(writePath, 'wb+') as writeFile:
    with open(readPath, 'rb+') as readFile:
        writeFile.write(readFile.read())

 

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