(Back to mods page)

How to connect mods to CompanionSubjects.esm




NB: updated 01-02-2010, change of method! Only the subjects in CompanionSubjects.esm should be deleted/imported. See below. And another update on 03-02-2010: also delete/import subjects with strings that have identical IDs.

It doesn't happen often, but it happens. Load companion mod X. Load companion mod Y. Suddenly, companion mod X loses half its topics. This doesn't happen only to companion mods, but they're more at risk because there are certain subjects common to companions, like "(don't) follow me", and "use this or that fighting method", which are typically abbreviated to one word and prefixed with a dash to bring them to the top of the topics list for easy access (no scrolling all the way down), as:

-combat
-follow

If two companions both have these topics, one of them will not be able to follow or switch tactics.

The problem is that neither topic is in the standard game file, "Morrowind.esm". If the topics had been in an ESM file, the topic responses made in the editor would have been hung under a common topic, and the game, in loading two ESP files, would have loaded both sets of topic responses. If the topic exists only in ESP files, then, since ESP files can't depend on each other the way they depend on ESM files (barring experiments with fan-made tools), a topic in the first ESP file loaded will be overwritten with a topic of the same name in the ESP file loaded after that. Of all mods with the topic "-follow", only the last mod loaded will have anything to show for it.

In my case, the problem mods were "Indiana James" versus "Laura Craft" from the same author, who stated in her readme file that these mods were incompatible, and "Kimu" versus "Agony & Rapture", which shared some dash-commands. When I started using the Laura Craft mod, I found that it also shared a topic with a rather silly companion mod I was making for my own amusement.

The solutions?

1. Restrict oneself to the topics in the basic ESMs. Or make a new ESM for these common topics. (That's what I ended up doing.)

2. Use only original topics. For dash-commands, that means using "--" or " -" or ">" instead of "-". But that only works if each modder starting a new mod is aware of all existing mods and their topics, and any two modders working on a mod at the same time report to each other to avoid using each other's topics. That's just not doable. (Although, to their credit, most companion mods are unique enough not to conflict with each other.)

3. Merge the conflicting mods in the TES Construction Set. This works for finished conflicting mods. It doesn't work when you're working on a mod that shares topics with other mods. Using this solution, I would have to merge my mod with "Laura Craft". And if I ever wanted to release that mod, I would have to tease the two apart again, or release something that isn't mine.

(Of course I could also tag and untag incompatible ESP files before starting the game, but then I tend to forget what goes with which save game, and end up with errors filling the screen each time I load a game. So I prefer to load all the plugins every time.)

Solution 1 it is, so I create an ESP with the common topics of Kimu/Agony, Laura/James and Laura/mymod, plus any terms from those mods that look generic enough to pop up in more mods. Each topic has a "dummy first entry" containing the name of the mod(s) it came from, and a "dummy last entry". This is because dialogue lines don't just need a common topic, they need a common insertion point, an existing line to be hung under. This existing line is connected to the journal "11111 test journal" which is never seen, so the dummy lines should never be seen either, and the speaker id is set to the not-in-game NPC "dialog placeholder" so the dummy lines don't turn up as "generic dialogue" for other NPCs. Then, I use the fan-made tool TESDTK to change the ESP to an ESM.

(The TES Dependency Toolkit or TESTDK has problems opening the C: drive to look for files on my laptop, so when opening a file on C:, I type in the filename plus drive and whole path. The buttons at the top transform one type of file to another.)

Now, load new ESM, load conflicting plugins: still the topics are missing. Of course. The plugins don't know about the ESM.

To make plugins work with CompanionSubjects.esm, they have to be torqued a bit. I opened the TESCS, selected "Morrowind.esm", "CompanionSubjects.esm" and the plugin (and "GMST Vaccine.esp" because I have GOTY, in a Morrowind-only installation this is not needed) and set the plugin to Active. The TESCS combined topics for me, so if I loaded "Laura Craft" and went to topic "my studies" I would see a dummy first line and a dummy last line right under the plugin's lines. Now if I go to the dummy first line and move it up to the top, Laura Craft's lines will be attached to the dummy first line, and the plugin will have a new dependency: CompanionSubjects.esm. I do this for all topics followed by an asterix that also contain the ESM's dummy lines.

The images show that the first dummy line, having been moved, has now also been marked as changed. That's not the idea; the insertion point should always be unchanged. To clean this up, I open the plugin and look at Details: here, I can see the dummy lines inder INFO. I select them (this can be done per line or for multiple lines with Shift-Click or Ctrl-Click) and press Delete to set them to I(gnore). Then I click OK to close the Details screen and load the plugin, and save the plugin to get rid of the ignored lines. Now the plugin is clean.

(Cleaning a mod when dialog lines have been added to a standard topic is done the same way: set any standard lines to Ignore so they will no longer be included in the mod. I found this information somewhere on a Morrowind modding forum, and adapted it to my case.)

I start a game with all companion mods together. Success is limited. I don't get the expected greetings from Indiana James, and I still can't get Kimu to follow me.

The problem with the greetings illustrates why just making a new ESM with common topics is not enough. Overwriting happens not only when two ESPs have the same topic, but also when two lines under a common topic have the same ID. A line's ID is a very long number randomly generated when that line is created, and is rarely the same for two lines. In the case of greetings, the problem has to be identical IDs, since they're all attached to the common topic "Greeting 5" which is in the basic game file "Morrowind.esm". Since Laura/James were made by the same author, it's likely that Laura was copied from James (or the other way round) after which both mods had their own dialogue added. Whatever was copied, has identical and therefore conflicting IDs.

(Note that this would not have been a problem for completely generic greetings. But the LauraCraft mod assigns line XYZ to speaker Laura and the IndianaJames mod assigns line XYZ to speaker James. The game can only load one line XYZ, therefore it only turns up for one speaker: the one whose mod loaded last.)

The same problem kept Kimu's dash-commands from appearing. I suspect that the maker of "Agony & Rapture" used Kimu as a base, since so many line IDs were identical. (I used Kimu as a base too, since it's a very simple mod and an example how to use the well-known "Grumpy's companion script". But instead of copying the ESP and editing the copy, I made a new ESP and copy-pasted whatever dialogue and code I needed. It all ended up unrecognizably changed anyway.) To make my solution work, I would have to change all the conflicting IDs.

This can be done manually, but that doesn't really work as it's complicated and may cause dialogue lines to double. There is an easier method, which I applied to the "Kimu" and "Indiana James" ESPs as they were the smaller files in the conflicting pairs, so editing them would be less of a hassle. The way to change the ID of a line under a topic is to stand on it, right-click, and choose "Copy". This produces an identical line on top of the old line, but with a different ID. This new line is automatically selected. Select the old line again, and delete it. Now the old ID is gone. Repeat for all lines under the topic. Since duplicating the second highest line changes the topmost "dummy line" again, I cleaned the dummy lines from the mod when done.

Needless to say, doing this duplicating and deleting on a huge block of "Greeting 5" entries took much time. And I was tempted to simply put the result up for download. But these mods are not mine, and contacting the authors for upload permission could be tricky (the maker of Laura/James is still modding, but the others?) so here is a different trick. All I've really changed is the dialogue. So if I put the new CompanionSubjects-compatible dialogue up for download, it's no use to anyone who doesn't already have the mods. But what does one do with a dialogue file?

The dialogue files are meant to be used as follows. First, get the mod. (The Laura/James dialogue files are only for the Tribunal versions. Sorry, but it was a lot of work and I would only do the earlier versions if the author or someone else asked me to; originally, all I wanted was to make these two mods compatible on my own computer.) Then, start TESCS, select the mod, "CompanionSubjects.esm" and possibly "GMST Vaccine.esp" if needed, and if you have it. Go to the mod, set it to Active, and go to the Details screen. Select all lines of type DIAL or INFO, and press Delete to ignore them. (It is possible to sort the lines by type, so the DIAL and INFO lines can be selected in two big blocks after which Delete changes them all.) Now reload the mod, and save it. The old dialogue is gone, and the mod has added "CompanionSubjects.esm" to the dependency list.

Change of method! I've noticed that when deleting and importing completely new topics of any kind (journals spring to mind) the strings are imported in reverse order. This doesn't matter for journals, but it does matter for added dialogue where the most generic response should be at the bottom, not at the top. This doesn't apply to existing topics, whether standard game topics or topics added by CompanionSubjects.esm, where the strings are added to an existing topic and so have insertion points. Therefore, "new" (existing only in the mod) topics should not be imported, and if I strip those out of the import file, I might as well strip out all other unneeded stuff: journals, greetings, voice and any standard topics like "Background"; this makes a much smaller import file. It also means less dialogue-cleaning afterwards, as any topic not imported also doesn't need to be cleaned up. So now, the method is not to delete all dialogue, but only to delete the topics that exist in CompanionSubjects.esm. Lists of topics to delete per companion mod can be found at the bottom of this page.

Aaannnd of course all strings under Greetings and standard topics that won't appear for both companions because they have identical IDs! Indiana James was obviously made by taking the Laura Craft plugin, throwing a lot out and altering the remainder. So Indiana James also needs new string IDs for "Greetings 5", and his "Greetings 5" block must also be deleted and imported, followed by cleanup. This will still not make them 100% compatible as their diaries have the same ID and the house of Indiana James overrides the house of Laura Craft (even when Laura loads last!) but at least they will both follow you.

Apart from deleting and importing, some strings need to be set to Ignore that were probably overlooked when cleaning the mod: for Kimu, the "Squeak" line under Greeting 0. For Indiana James, a Background string and a Greeting 5 string. For the huge Laura Craft plugin, strings under Greeting 0, 1 and 5 and Bribe Fail.

Then, import the dialogue file, and save again.

The import will mark all the dummy dialogue lines as changed, so the last step is to clean up the dummy lines in the Details screen. This is best done by sorting the lines by "Description", which arranges the dialogue lines in alphabetical order. If the mod alters greetings, these also need to be cleaned. Ditto for any changes to standard subjects, other special topics under Voice and Services, and any additions to standard journals. A complicated mod like Laura Craft needs a lot of cleaning. (Of course, now that the import files contain only the necessary subjects, the only thing to clean is the insertion points of the shared subjects in CompanionSubjects.esm.)

In short, the steps are: load mod with "CompanionSubjects.esm", save, delete old dialogue, reload, save, import new dialogue, save, clean mod dialogue, save.

The mods and other files referred to are:

CompanionSubjects.esm - included with DrinksatDeseles.esp

Imperial Boyfriend Indiana James version 2.1 (Tribunal version) - by Emma

Laura Craft Romance Mod version 3 (Tribunal version) - by Emma

Kimu Companion (first version, beta) - by Fashayshay

Agony & Rapture (adult mod, only version known) - by EvilFluffyBunnies

GMST Vaccine - by Wrye (from the site "Wrye's Musings")

TESDTK - by Aaron White (Argent)

I won't add links for the files, because links tend to go old and broken. A good place to look is the Elric of Melnibone site (http://www.elricm.com). It has a Morrowind downloads section with a search function and a direct link to Emma's site.

Topics to delete and import, per companion:

Kimu:

Agony & Rapture:

(This import file also changes the name of Sellus Gravius' note which was still something like "note from Bugrol".)

Indiana James:

Laura Craft: