That all makes me curious, though - Does the textparser still look for those original text files when the client launches? If someone was able to recreate a developer working directory, could you load your own versions of those text files?
It's complicated. I'll try to answer this as well as the follow-up question about Paragon Chat that I remember seeing, but I think got lost in your edits.
The client has a fully functional textparser. It can load any file from either text or binary form, *if* the functions are called with the right parameters. It can even *save* any file back into text form, though for things like powers.bin, a lot of the enums get screwed up because there's a giant shared table for them. You end up with nonsensical names for certain values in the Scale field, for instance.
You can't just go overriding files from the piggs with text files willy-nilly. The way it's supposed to work in development mode is this:
- No pigg files at all
- All of the data in text form
- If a bin file is missing or the text version is newer (per the filelist), data is loaded from the text version and persisted in the bin file
- Otherwise, load the bin
The release client doesn't have all of the code paths for this. Some of it is there, but is 'dead code' and unreachable in normal execution. The client is locked in 'production mode', likely by a compile-time flag or preprocessor definition, and there's no simple way to modify that.
Production mode looks like this (I'm simplifying a bit since the first two are handled by the VFS system and the last one is handled by textparser):
- If the bin file exists in data/, and isn't in the 'overrides prohibited' list, load it from there.
- If the bin file exists in a pigg, load it from there.
- Nothing else worked, if there's a text version in data/, might as well try and load it.
So the only way to get the production client to load text files -- aside from calling the functions directly with the aid of a debugger or the dynamic code rewriting engine that I use for ParagonChatClient -- is if no corresponding .bin file exists. That's why people are able to load custom maps in text format, because of course new maps have no .bin in data/geobin/.
That means if you want to load text files for bins that already exist, you have to:
- Extract *everything* from the pigg files into data/.
- DELETE all pigg files.
- Patch the client to remove the override list (see the forum thread about map editing)
- DELETE the bin file corresponding to what you want load from a text version.
I honestly don't remember if the automatic bin-generation code will work in that circumstance. It might be completely disabled in production mode, or it might recompile a bin which you have to delete if you want to change the text file(s) again. The code *exists* and I can call it manually (and have done that to generate some of the bin data for PChat), I just don't remember if it's in the normal execution path or not.
As for Paragon Chat's imitation textparser -- unfortunately none of this will work for that. The 'server' piece knows enough to read bin files, but for most of the parse formats it doesn't know the field names for the text form, or even what file to try to load it from. Costume files are the obvious exception since it needs to be able to read those in both text and binary format, but it can't even load maps in text format. I compiled the modified Pocket D to bin format in order to bundle it.