EDIT: Re-titled thread, this is
NOT for the just-released Android port of FFVII, it's for synchronizing between FPSE/epsxe and the PC version of FFVII. if you're looking for the final script, it's here:
http://forums.qhimm.com/index.php?topic=17047.msg242571#msg242571 -- if you want to see me bumble through learning little things about the FFVII save format, read on!
Hey everyone, long time lurker, finally registered an account to ask this question:
I've got a GPD XD, and I use FPSE on it to play FFVII. I also use the Steam copy of FFVII as well. Black Chocobo is currently capable of switching between these file formats with no problems.
What I did was write a PowerShell script that connects to my GPD XD and checks to see whether the .MCD file on it for FFVII is newer than the local FF7 save00.ff7 file from the Steam copy, and depending on which is newer, it attempts to convert the file formats and then replace the older one with the newer one.
It's kind of a scripted way to effectively rsync my two save files, including the conversion.
The problem is that since Black Chocobo is a GUI app, I couldn't script using it to convert my ff7_pc.mcd Memory Card format file into a PC save00.ff7 file. There is a tool that works on the pre-cloud enabled version of FFVII, and I was able to pipe input into it in order to automate the conversion -- but it doesn't generate the metadata.xml file, so FFVII's PC version just eats the save file and that's that.
So, I have two questions:
1) Is there any current command line save converter for FF7 that supports the latest release including the metadata.xml editing
OR
2) Is there a tool that will generate a working metadata.xml file if you point it at an a working save00.ff7 file that I could call from a script? Alternately, is the Metadata.xml just the product of some set of md5sums that I could programmatically do with PowerShell (which I'm using for the rest of the script)?
I got so close before realizing that the save converter tool I was using wouldn't work because of the lack of metadata.xml -- everything else about the script works, it connects to the GPD XD, checks the time/date stamp, moves the files around, and even completes the conversion process -- but the GPD XD -> PC process can't yet be automated because of the Metadata.xml requirement.
Any help would be appreciated!
EDIT: Since I'm not one to leave well enough alone, I did look and find that Black Chocobo uses the ff7tk libraries, which include the ability to convert between save file formats. I'm not much of a programmer, more of a scripter -- but I'm mucking about getting the demo app to compile to see if I can cobble together some kind of converter in case one doesn't already exist. I'm not extremely optimistic that I'll be successful, but we'll see.
2nd EDIT: From what I can tell, the Metadata.XML is just looking for the md5sum of the save file with the savegame's unique ID appended to it. Trouble is, I don't quite know precisely where to append my ID. I stumbled across this post talking about how the Metadata.xml works and how it is generated:
Where is the UserId? Look at the path of the saved game:
C:\Users\{user-name}\Documents\Square Enix\FINAL FANTASY VII\user_123456\save00.ff7
In that case, that would be 123456.
So, append the said UserId at the end of the saved game, and MD5-sum it. Voila!
But just cannot for the life of me figure out where in the file to append the unique ID. I read the documentation about the ff7 save file format and found what I thought was the end of the file, but I can't generate the md5sum that exists already in my (working) metadata.xml. I think if I could do that, I could then calculate the md5sum and stick in where it needed to go in the existing metadata.xml, but without knowing where precisely to put it (and whether to insert/overwrite), I'm kind of stuck. So, I guess I now have 3 questions -- but any one of them being answered would do
Thanks!
3rd EDIT: I'm a dumdum, I just need to append it to the actual end of the save file itself. I think I can script the rest of this from here, will update if so and remove post.
Final EDIT: Yep, I had just misunderstood. Made a file with my unique ID in it, added some code to concatenate it and the save file, generated the md5 and then wrote it to the .XML. Problem solved, one click synchronization between my gaming desktop and my portable emulation rig achieved. If anyone wants the Powershell code, let me know. It's ugly, but functional -- would work for any Android device running an FTP server and any emulator that supports .MCD format. You likely need to be rooted though for the FTP server to have write access.