Page 2 of 2

Re: Map #Include Automation

Posted: Mon Feb 02, 2009 3:05 am
by Skyfaller
Rather than creating a scripting language for patching, it might be easier to use the batch processing capabilities offered by cmd.exe (batch files). So, all we need is a PRJ patch processor that understands the following commands, the rest can be done by adding commands to a script file:
  • PRJPP extract <MW2.PRJ> <dir> <file> <output>
    extract <file> from <dir> and produce <output> in <MW2.PRJ>
  • PRJPP diff <file1> <file2> <diff>
    compare <file1>, <file2> and produce <diff>
  • PRJPP patch <diff> <file>
    Apply changes from previously produced <diff> to <file>
  • PRJPP replace <MW2.PRJ> <dir> <oldFile> <newFile>
    Replace <oldFile> in <dir> with <newFile>
  • PRJPP add <MW2.PRJ> <dir> <newFile>
    Add <newFile> to <dir>, maintaining its 8.3 name
Rather than replace a byte somewhere in the PRJ, I would prefer seeing the file containing it extracted, patched, then replace the old version of the file with the new one. This would make any changes more portable.

Re: MW2.PRJ patching

Posted: Mon Feb 02, 2009 2:42 pm
by Skyfaller
OK, typed most of that into the nearest laptop, will begin testing tomorrow. Fixed a bug in replacing with larger files, but the cost ... well, MechVM will no longer skip displaying empty files. Adding files is still missing from MechVM and PRJPP.

Re: MW2.PRJ patching

Posted: Tue Feb 03, 2009 3:12 pm
by Skyfaller
OK, all commands except "add" seem to work. As a demonstration, I have written a patcher that will increase the viewing distance for the first Falcon mission to 8km using the method proposed here. This is done by invoking PRJPP using the batch file patch.bat. Just extract the appended .ZIP in your MW2:31stCC folder and run the batch file.

I hope to see many patches that use this tool. Several evenings went into it.

(Edit: removed the old version, find the current one in a separate thread.)

Re: MW2.PRJ patching

Posted: Tue Feb 03, 2009 6:55 pm
by quota4stupid
Nice :-) Have you had a chance to look at the TBL files in the TABL directory yet? I think they need to be updated if you add a file, but I haven't had a chance to test this theory out yet :-P

Re: MW2.PRJ patching

Posted: Wed Feb 04, 2009 1:23 am
by Skyfaller
quota4stupid wrote:Nice :-)
Thanks.
quota4stupid wrote:Have you had a chance to look at the TBL files in the TABL directory yet? I think they need to be updated if you add a file, but I haven't had a chance to test this theory out yet :-P
ATM, I don't expect to find anything interesting in the TABL directory. Also, Kell seems to have found ways to circumvent the requirement for adding files, and I'd like stop developing that, if it's not needed.

Kell, do you still need the ability to add files to the PRJ, or can you get along without it?

Re: MW2.PRJ patching

Posted: Wed Feb 04, 2009 7:15 am
by Col.Kell
Skyfaller wrote:Kell, do you still need the ability to add files to the PRJ, or can you get along without it?
I don't exactly need to have it, with some carful planning you can replace files without adding any bytes and still get a good outcome. The ability to add files would be a nice luxury, because you could add/replace whatever without second thought or worries that you might mess something up. ;)

Re: MW2.PRJ patching

Posted: Wed Feb 04, 2009 9:10 am
by Sir MMPD Radick
just been wanting to say good job Skyfaller!
I will probably use it myself if i can ever get back to working on a modded map...

(clarification just mean lack of time).

Re: MW2.PRJ patching

Posted: Wed Feb 04, 2009 1:14 pm
by Skyfaller
Sir MMPD Radick wrote:just been wanting to say good job Skyfaller!
Thanks, nice to hear it.