I've been working on porting Sabre's Romance and Happy mod to WeiDU
and I've found many things a long the way. Some of the changes are
complex and some can't be easily implemented using
REPLACE_BCS_BLOCK.
So, I've implemented a feature for WeiDU that allows you to create and
apply patches. The patch files have the UNIX unified diff format. Here's
how it works.
You can create a patch by running:
% weidu-new.exe --bcmp-from AERI25.BCS --bcmp-to ./mysrc/AERI25.bcs [weidu-new] WeiDU version 130 [C:/.../chitin.key] 182 BIFFs, 41793 resources [C:/.../dialog.tlk] 75108 string entries [C:/.../data/25Scripts.bif] 3935784 bytes, 969 files, 0 tilesets // TP2 patch to turn AERI25.BCS into ./mysrc/AERI25.BCS. For example using: COPY_EXISTING ~AERI25.BCS~ ~override/AERI25.BCS~ APPLY_BCS_PATCH ~./mysrc/AERI25.BCS.patch~ %
The file "./mysrc/AERI25.BCS.patch" is created as a result of running
this command. As noted in the output, you can apply the patch by putting
the following command to your *.TP2 file:
COPY_EXISTING ~AERI25.BCS~ ~override/AERI25.BCS~ APPLY_BCS_PATCH ~./mysrc/AERI25.BCS.patch~
(you'd probably end up changing these paths and file names in
a real TP2 file, but you get the idea)
When the APPLY_BCS_PATCH command is run, it checks to see if any
chunks in the patch could not be applied. It then checks to see if
any of these rejected chunks have already been applied (say in a
previous patch) and a verbose warning is issued for the "already
applied" chunks. If there are any remaining rejected chunks which
have not already been applied, a verbose error message is issued and
the APPLY_BCS_PATCH fails.