Thank god for that. I think the lisp compiler was saving the executable in different directory from where I thought -- hence I was uploading an old exe thinking it was freshly compiled.
Glad it's sorted
The logic is that whenever a unique record (eg "glass_pauldron_right") is encountered for the first time in a list of ESPs/ESMs, a copy of that record is remembered as "original". In addition, a working copy of the record called "merged" is kept, which starts out the same as "original".
Then, each time a different version of the record is encountered in subsequent plugins, each value in the "new" record is compared to the value in the "original" record. Whenever the values differ, the "new" value is written into "merged", overwriting any previously stored value.
OK, I think I understand how that goes. When generating that information I didn't specify filenames, I was relying on morrowind.ini. To show what I was expecting to happen here's the equivalent part of my TESTool.log:
ARMO glass_pauldron_right > Morrowind.esm MODL a\A_Glass_Pauldron_GND.nif FNAM Glass Right Pauldron AODT Type=3, Weight=3.00, Value=http://forums.bethsoft.com/index.php?/topic/1067443-wip-new-merge-objects-program/9600, HP=500, Ench=15, AC=50 ITEX a\TX_Glass_pauldron.tga INDX/BNAM 23 / a_glass_cl_pauldron INDX/BNAM 13 / a_glass_pauldron_ua INDX/BNAM 11 / a_glass_pauldron_fa> Clear Glass.esp MODL MH\a\clear_glass_pldrn_GND.NIF FNAM Glass Right Pauldron AODT Type=3, Weight=3.00, Value=http://forums.bethsoft.com/index.php?/topic/1067443-wip-new-merge-objects-program/9600, HP=500, Ench=15, AC=50 ITEX a\TX_Glass_pauldron.tga INDX/BNAM 23 / a_glass_cl_pauldron INDX/BNAM 13 / a_glass_pauldron_ua INDX/BNAM 11 / a_glass_pauldron_fa> LeftGloves_Addon_v2.esp MODL a\A_Glass_Pauldron_GND.nif FNAM Glass Right Pauldron AODT Type=3, Weight=3.00, Value=http://forums.bethsoft.com/index.php?/topic/1067443-wip-new-merge-objects-program/9600, HP=500, Ench=15, AC=50 ITEX Lefty\TX_Glass_pauldron_R.tga INDX/BNAM 23 / a_glass_cl_pauldron INDX/BNAM 13 / a_glass_pauldron_ua INDX/BNAM 11 / a_glass_pauldron_fa---------------------------- MODL MH\a\clear_glass_pldrn_GND.NIF FNAM Glass Right Pauldron AODT Type=3, Weight=3.00, Value=9600, HP=500, Ench=15, AC=50 ITEX Lefty\TX_Glass_pauldron_R.tga INDX/BNAM 23 / a_glass_cl_pauldron INDX/BNAM 13 / a_glass_pauldron_ua INDX/BNAM 11 / a_glass_pauldron_fa
It looks like TESTool is doing a similar thing but the "original" record (i.e. the one encountered for the first time) is the record in Morrowind.esm (in this instance but it could be any of the Bethesda ESMs depending on the object) and the changes made by subsequent plugins (in this case "Clear Glass.esp" and "LeftGloves_Addon_v2.esp") are compared against
that original record (i.e. the Morrowind.esm one) and written into "merged".
There are cases when TESTool can't merge an object, like this:
ARMO glass_pauldron_left > Morrowind.esm MODL a\A_Glass_Pauldron_GND.nif FNAM Glass Left Pauldron AODT Type=2, Weight=3.00, Value=http://forums.bethsoft.com/index.php?/topic/1067443-wip-new-merge-objects-program/9600, HP=500, Ench=15, AC=50 ITEX a\TX_Glass_pauldron.tga INDX/BNAM 24 / a_glass_cl_pauldron INDX/BNAM 14 / a_glass_pauldron_ua INDX/BNAM 12 / a_glass_pauldron_fa> Clear Glass.esp MODL MH\a\clear_glass_pldrn_GND.NIF FNAM Glass Left Pauldron AODT Type=2, Weight=3.00, Value=http://forums.bethsoft.com/index.php?/topic/1067443-wip-new-merge-objects-program/9600, HP=500, Ench=15, AC=50 ITEX a\TX_Glass_pauldron.tga INDX/BNAM 24 / a_glass_cl_pauldron INDX/BNAM 14 / a_glass_pauldron_ua INDX/BNAM 12 / a_glass_pauldron_fa> LeftGloves_Addon_v2.esp MODL Lefty\A_Glass_Pauldron_L.nif FNAM Glass Left Pauldron AODT Type=2, Weight=3.00, Value=http://forums.bethsoft.com/index.php?/topic/1067443-wip-new-merge-objects-program/9600, HP=500, Ench=15, AC=50 ITEX Lefty\TX_Glass_pauldron_L.tga INDX/BNAM 24 / a_glass_cl_pauldron INDX/BNAM 14 / a_glass_pauldron_ua INDX/BNAM 12 / a_glass_pauldron_fa----------------------------Some information has been lost during merging due to a conflictResult discarded due to being identical to the last loaded object
In this instance the changes made by Clear Glass (just to MODL) are discarded as the later-loading Left Gloves also changes MODL. There's only so much that can be done and the basic load order principle of most important plugins load later is followed by TESTool.
So, the best way to test "merge-records" is to merge 3 files. The first contains an "original" of the record (in practice this usually comes from Morrowind/Tribunal/Bloodmoon.esm). The other two each modify that same record in *different* ways.
For example, suppose:
* the base stats of "glass_pauldron_right" in Morrowind.esm were health 500, value 9600, and
* "Clear Glass" sets armour value to 15000, and
* "Left Gloves" sets armour health to 200
* You run: esper -r Morrowind.esm "Clear Glass.esp" "Left Gloves.esp"
Then the resulting merged plugin should have armour with value 15000 (from clear glass) and health 200 (from left gloves), rather than both health and value set to "Left Gloves" values, which is what you effectively get if you just load your plugins in the above order without merging objects.
Thought I'd try this, ran the command and piped it to a text file:
Esper, version Beta 4Released under GPL; see the file LICENSE for details.Command line arguments received: ("-r" "Morrowind.esm" "Clear Glass.esp" "LeftGloves_Addon_v2.esp")NIL Clear Glass.esp .LeftGloves_Addon_v2.esp Merged records:Original:# # # # # # # # # # #>New:# # # # # # # # # # #>Merged:# # # # # # # # # #>Merged records:Original:# # # # # # # # # # #>New:# # # # # # # # # # #>Merged:# # # # # # # # # #>..Merged records:"ARMO": "glass_pauldron_left""ARMO": "glass_pauldron_right"2
So, despite specifying Morrowind.esm its contents aren't taken as the "original" during merging.
Finally, I think some tweaking to the file header of "output.esp" would be in order. You could have Author as "Esper generated file. Esper created by eeeickythump", just to stoke your ego
Perhaps "description" could be driven by whether -r or -p is used (maybe "merged objects" for the former and "merged plugins" for the latter).
The Esper-generated plugin's file masters information needs to be correctly set. Currently the only dependency set is against Morrowind.esm; it might be worthwhile to set Bloodmoon.esm and Tribunal.esm too if present. However I'm in two minds about that as there's no way to work out whether the expansions are there if someone is just merging a couple of plugins and not including the Bethesda ESMs. Not too big a deal.
More seriously, however, is that when recording the Morrowind.esm dependency Esper records the filesize of Morrowind.esm as 1234 bytes. This'll lead to the "One or more plugins could not find the correct versions of the master files they depend on. Errors may occur during load or game play" error message. Easy enough to fix in Wrye Mash but it could cause needless concern for people using Esper. Not sure how easy it is to get the Morrowind.esm filesize and use that?