I've just read my previous post again and it's confusing even for me
English is not my first language.
I will post a code to show where the problem lay, using modified Bonehill as an example:
1. I'd like to create 3 biff files with Bonehill resources that won't be edited by other mods (so things like ARE, CRE, ITM, etc. won't be biffed).
2. First of all I'm copying all the files to override in order to make a backup copies of files with conflicting names.
3. Then I'm using HANDLE_TILSETS and HANDLE_AUDIO to extract these resources to override.
4. And then I'm trying to biff some resources added by this mod. Things unpacked with external tools are moved with ACTION_FOR_EACH and things copied over with ACTION_BASH_FOR (using original folders to make a list of files to move over):
MKDIR ~Bonehill/temp/BH-TIS1~
~Bonehill/temp/BH-TIS2~
~Bonehill/temp/BH-REST~
ACTION_FOR_EACH file IN "BH0100" "BH0200" "BH0300" "BH0302" "BH0400" "BH0401" "BH0402" "BH0403" "BH0500" "BH0507" "BH0600" "BH0700" "BH1000" "BH1004" "BH1100" "BH1101" "BH1200" BEGIN
MOVE ~override/%file%.tis~ ~Bonehill/temp/BH-TIS1~
END
ACTION_FOR_EACH file IN "BH1300" "BH2000" "BH2001" "BH2002" "BH2005" "BH2006" "BH2008" "BH2010" "BH2012" "BH2018" "BH2019" "BH2020" "BH2021" "BH2022" "BH2025" "BH2100" "BH2101" "BH2102" "BH2103" "BH2104" "BH2105" "BH2106" "BH2107" "BH2108" "BH2109" "BH2110" "BH2111" "BH2200" "BH2201" "BH2202" "BH2301" BEGIN
MOVE ~override/%file%.tis~ ~Bonehill/temp/BH-TIS2~
END
ACTION_FOR_EACH file IN "AM9100E1" "AM9100E2" "AM9100E3" "AM9100E4" "AM9100E5" "AM9100E6" "AM9100E7" "AM9103B" "AM9103C" "AM9105B" "AM9400F1" "AM9400F2" "AM9400F3" "AM9400F4" "AM9400F5" "AM9400F6" "AM9400F7" "AM9700A" "AM9700B" "AM9711D" "AM9712B" "AM9712C" "AM_1003" "AM_1007" "AM_1008" "AM_1008A" "AM_1011" "AM_1016" "AM_2000A" "AM_2002" "AM_2103" "AM_4001" "AM_5203A" "AM_9101" "AM_9102" "AM_9103" "AM_9104" "AM_9104A" "AM_9108" "AM_9301" "AM_9400" "AM_WSP01" "AM_WSP02" "AM_WSP03" "AM_WSP04" "AM_WSP05" "AM_WSP11" "AM_WSP13" "AMB_E04A" "AMB_E04B" "AMB_E05B" "AMB_E05D" "AMB_E05E" "AMB_E05F" "AMB_E05G" "AMB_E05H" "AMB_E06A" "AMB_E06B" "AMB_E06C" "AMB_E08A" "AMB_E08B" "AMB_E14A" "AMB_E14B" "AMB_E15A" "AMB_E15B" "AMB_E15C" "AMB_E15D" "AMB_E17A" "AMB_E17B" "AMB_E24" "AMB_E25" "AMB_E29A" "AMB_E40A" "AMB_E40C" "AMB_M01C" "AMB_M03B" "AMB_M16X" "AMB_M26A" "AMB_M26G" "AMB_M26K" "AMB_M28A" "AMB_M35D" "DIRELUTE" "FABIO0" "FABIO1" "FABIO10" "fabio11" "fabio12" "fabio13" "fabio15" "fabio16" "fabio18" "fabio19" "FABIO2" "fabio20" "FABIO3" "FABIO4" "fabio5" "fabio6" "fabio7" "fabio8" "fabio9" "fabio=" "fabio_" "fabioa" "Fabiob" "fabioc" "fabiod" "fabioe" "fabiof" "fabiog" "fabioh" "fabioi" "fabioj" "fabiok" "fabiol" "fabiom" "fabion" "FABIOnBF" "FABIOnG" "FABIOnG1" "FABIOnI" "FABIOnM" "FABIOnM1" "FABIOnSh" "FABIOnV" "FABIOnZ" "fabioo" "fabiop" "fabioq" "fabior" "fabios" "fabiot" "fabiou" "fabiov" "fabiow" "fabiox" "fabioy" "fabioz" "Ign01" "Ign02" "Ign03" "Ign04" "Ign05" "Ign06" "Ign07" "Ign08" "Ign09" "Ign10" "Ign11" "Ign12" "Ign13" "Ign14" "Ign15" "Ign16" "Ign17" "Ign18" "Ign19" "Ign20" "Ign21" "Ign22" "Ign23" "Ign24" "Ign25" "Ign26" "Ign27" "Ign28" "Ign29" "Ign30" "Ign31" "Ign32" "Ign33" "Ign34" "Ign35" "Ign36" "Ign37" "Ign38" "Ign39" "Ign40" "SS_4005A" "SS_4005B" "SS_4005C" "SS_4005D" "SS_4005E" "SS_4005F" "SS_4005G" "SS_4005H" "SS_4005I" "SS_4005J" "SS_4005K" "SS_4005L" BEGIN
MOVE ~override/%file%.wav~ ~Bonehill/temp/BH-REST~
END
ACTION_FOR_EACH dir IN "areas" "bam" "bmp" BEGIN
ACTION_BASH_FOR ~Bonehill/base/%dir%~ ~^.+~ BEGIN
MOVE ~override/%BASH_FOR_FILE%~ ~Bonehill/temp/BH-REST~
END
END
MAKE_BIFF ~BH-TIS1~ BEGIN ~Bonehill/temp/BH-TIS1~ ~^.*$~ END
MAKE_BIFF ~BH-TIS2~ BEGIN ~Bonehill/temp/BH-TIS2~ ~^.*$~ END
MAKE_BIFF ~BH-REST~ BEGIN ~Bonehill/temp/BH-REST~ ~^.*$~ END
this way the mod can be uninstalled, but files moved from the override dir to BH-TIS1, BH-TIS2, BH-REST will end up in override folder after the mod is uninstalled. If I add + to MOVE commands the mod will fail to uninstall.
I can't biff files directly from the mod directory due to potential conflicts with files that are already in override dir. I could use ACTION_BASH_FOR to find these conflicts and use DELETE command in order to store them in backup folder, but it is still not a perfect solution because HANDLE_TILSETS and HANDLE_AUDIO automatically move files to override dir, so the problem is not solveable this way. I could delete these useless files from BH-TIS1, BH-TIS2, BH-REST directories with this code (workaround because weidu can't delete whole directories for some reason):
ACTION_FOR_EACH dir IN "BH-TIS1" "BH-TIS2" "BH-REST" BEGIN
ACTION_BASH_FOR ~Bonehill/temp/%dir%~ ~^.+~ BEGIN
DELETE + ~%BASH_FOR_FILESPEC%~
END
END
but weidu will than complain about missing files during uninstallation...
edit: Thanks Imp, I will take a look.
edit2: well, it looks like that code will not help to solve this matter because it works similarly (with additional stuff to automatically generate biffs based on file sizes etc.). In GeneralizedBiffing the problem I mentioned with files going back to override directory after uninstalling the mod is what is desired. And in my case these files should not be moved back to override.
edit3: I could probably just REPLACE_TEXTUALLY strings in "MOVE.0" file, but that would be kinda hackish workaround. I'd like to do it in a sane way, and I'm probably missing something obvious.