Morrowind modding for smarties, part 10: generating merged_objects

Note: I'm keeping this article for historical reason, but now that we have tes3merge probably there is no more need to use testool for this, see this video for details.

I am assuming here you already know why it is useful to have a merged_objects.esp generated by TESTool.

Problem is, often TESTool crashes (probably due to a buffer overflow error) when computing a long mod list.

So far, a frequently used workaround has been to do something like this:

  • divide your loaded mods in smaller groups
  • set first mod group as loaded
  • generate merged_objects.esp
  • rename merged_objects to merged_obj1.esp
  • set second mod group as loaded
  • generate merged_objects.esp
  • rename merged_objects to merged_obj2.esp...

and so on,
then finally merge merged_obj1.esp ... merged_obj2.esp to a final Merged_Objects.esp

I want to show you the last approach I used for a faster and more precise workaround.
Instead of dividing the whole list in smaller parts, we will try to process just the conflicting mods, without using TES conflict detector.
It will still need tools synergy though, so get ready with:

  • a good text editor: it should be able to format a list of files as required by a tes3cmd option. I recently tried a small/fast/powerful one so I suggest EverEdit for the task, you can naturally use any other editor you may prefer, but it should be able to join lines, search and replace regular expressions.
  • Mash or Mash stand alone (must-have mod management tool)
  • Morrowind\Data Files\tes3cmd.exe
  • Morrowind\TESTool.exe (we will use it to generate Merged_Objects.esp)

Ready? Let's go.

  1. start Mash, Mods tab, right click File header, be sure to have Lock Times checked, right click File header, Load, Save List..., save your current load list (e.g. name it savedlist)

  2. Start your preferred text editor (e.g. EverEdit), create a new blank text file, type:
    tes3cmd.exe active > out.txt
    , save the file as Morrowind\Data Files\loadinglist.bat

  3. From your file manager, double click the Morrowind\Data Files\loadinglist.bat to make tes3cmd generate the out.txt file containing the list of your loaded mods

  4. From your preferred text editor, load Morrowind\Data Files\out.txt, delete the first ( [LOAD ORDER] ) and the last line ( [N Active Plugins] )
     Now we must clean/reformat the list for next tes3cmd command: I will describe operations for EverEdit here, you should be able to use any other text editor able to join lines, search and replace regular expressions...

  5. We have to add "" to file names, so: Search, Replace..., check Regular Expression, Current File

  6. fill the Find input field with a ^, fill the Replace input field with a ", Replace All

  7. fill the Find input field with a $, fill the Replace input field with a " followed by a space, Replace All
    Now your list should be formatted like this:
    "Morrowind.esm"
    "AnnastiaV3.3.esp"
    "Atmospheric Balmora for VBA.esp"
    and so on...

  8. select all (Ctrl + A), Edit, Format, Join Lines. Now your list should be formatted in a single text line like this:
    "Morrowind.esm" "AnnastiaV3.3.esp" "Atmospheric Balmora for VBA.esp"

  9. go to top line, insert text at the beginning:
    tes3cmd.exe dump --type FACT --type CLAS --type SOUN --type SKIL --type MGEF --type REGN --type BSGN --type STAT --type DOOR --type APPA --type LOCK --type PROB --type INGR --type BOOK --type ALCH --raw-with-header out.esp
    after the insertion your text should be a single line like this:
    tes3cmd.exe dump --type FACT --type CLAS --type SOUN --type SKIL --type MGEF --type REGN --type BSGN --type STAT --type DOOR --type APPA --type LOCK --type PROB --type INGR --type BOOK --type ALCH --raw-with-header out.esp "Morrowind.esm" "AnnastiaV3.3.esp" "Atmospheric Balmora for VBA.esp"
    , save the file as Morrowind\Data Files\mods2merge.bat
    Note: save the file using a standard text encoding, e.g. ANSI or UTF-8 (without BOM)

  10. from Mash, Mods tab, right click File header, Load, None, Mods tab, right click File header, Load, Bethesda ESMs (you should now have only standard Bethesda .esm loaded)

  11. from Mash, Mods tab, tick/put in your loading list all the .esm (master) files you are using in your saved game (masters should not be many so you can do it by hand)

  12. From your file manager, double click the Morrowind\Data Files\mods2merge.bat to make tes3cmd generate the out.esp file

  13. back to Mash, Mods tab, tick/add the out.esp file to your loading list

  14. run Morrowind\TESTool.exe, click Options button, tick "Merge unchanged objects", execute "Merge Objects for Active Plugins"

  15. If all is well, back to Mash, right click File header, Load, None, Mods tab, right click File header, Load, savedlist, tick also the new Merged_Objects.esp

  16. if you are using Necessities of Morrowind, redate/move Merged_Objects.esp to be loaded before NOM

[EDIT] I am happy to announce I managed to build an autoit script to automate the whole described process... you can grab it here