Fixing the AddTopic Bug

From the Oblivion ConstructionSet Wiki
Jump to navigation Jump to search

Just to summarize the issue for those just joining our program, the GREETINGS/Add Topics box bug is one that a lot of modders miss when creating their mods, because 1) it's a bug in a perfectly legitimate CS function that one thinks one ought to be able to use; and 2) the bug is only triggered under specific circumstances that many modders and users don't necessarily encounter, because it requires both the affected mod and another mod which changes GREETINGS to be loaded after the affected mod.

Neither the affected mod nor the triggering mod is bugged; the bug is in the game engine. For that reason, I've made a minor crusade of publicizing this bug and documenting mods affected by it, because a number of really good mods have been blamed for errors that are totally not the mod nor the modder's fault, and that many modders don't know to watch out for when creating their mods.

The bug itself:

To make a long story short, if a mod changes GREETINGS, and also uses the AddTopics box to add topics when the new GREETING is played, this functionality will work fine unless another mod which also changes GREETINGS is loaded after that mod (whether or not the second mod also AddsTopics). The deal is that the engine is supposed to increment the AddedTopics IDs when another mod then later changes GREETINGS and doesn't (or doesn't do so correctly, or something along those lines)-- in any case the result is that the topics are still there, but the "connection" between the name of the topic and the ID the game thinks that topic has is lost, so the game can't find the topic to load, so it doesn't (of course). But this will only happen if another mod which changes GREETINGS loads after the mod using the AddTopics box; what's worse is that both GREETINGS themselves play normally, so the mod seems to be working fine.... except that you can't get the quest or whatever, because the topic itself does not appear.

If the affected mod is the only one that actually uses the AddTopics box, then moving it to the very end of the load order will solve the problem functionally (meaning that the topics will then appear, which is why KotN was advised to be moved to the end of the load order until it was unofficially patched). Problems arise if you have two mods that unfortunately use the Add Topics box-- moving one to the end of the load order breaks the other and vice-versa (because they both change GREETINGS, so no matter what you do, you'll have a mod which changes GREETINGS loading after a mod that uses the Add Topics dialog, which is the whole problem).

Fortunately, once you identify the mods affected (easy enough, because they're the ones that inexplicably have no new topics for the NPCs), they are quite easy to fix in the CS, by removing the topics from the Add Topics box and adding them instead to the Result Script:

  1. Open the affected mod in the CS.
  2. Go to the Characters => Filtered Dialogue menu.
  3. Select GREETINGS (which will have an * asterisk after it, indicating that it has been changed by the mod).
  4. Scroll down the GREETINGS list and look for the dialogue topics that have a * asterisk before the dialogue in the upper section of the window-- so you'll see a topic name in the first column and "* Whatever the NPC actually says" in the second column, and select the first of these dialogue lines.
  5. In the rightmost box in the lower half of the window when you have selected an individual topic, you should see one or more topics listed in the box labeled "Add Topics". These are the problem, or rather these are the uses of the bugged function of the engine-- if another mod loads after this one that also changes GREETINGS (whether the second mod itself AddsTopics or not), these topics will not be loaded correctly, resulting in a broken mod. What you need to do is move these topics one box to the left, to the Result Script, so that they will be added, no matter what. It's real easy.
  6. Point your mouse cursor at the first topic in the Add Topics box, so you can see the tooltip that tells you the name of the topic (you can't extend the box or make the columns wider, so this is the only way to see the full name).
  7. Then click on the end of the last line in the Result Script box to get a text cursor, and hit Enter to start a new line if necessary, then type: AddTopic <name of the topic you just noted> There is no space between "Add" and "Topic" (the command the game recognizes is AddTopic not "Add Topic"), and capititalization of the A in Add and the T in Topic is not required, it is just to make the script look neater.
  8. If this is the only topic added for that particular line of dialogue, then click the "Compile" button next to the Result Script. If multiple topics are added, then add them to the Result Script, one to a line, as before, then click the Compile button. If you get an error saying that the topic is not recognized, you've spelled the topic name wrong; point your mouse cursor at the topic in the Add Topics box again and correct.
  9. When the Result Script compiles successfully, select each topic in the Add Topics box, right-click and choose "Remove" (or Delete, whatever it says, just "the selection that gets rid of the entry" smile.gif), until the Add Topics box is empty.
  10. Repeat for all GREETINGS dialogs changed by this mod that use the Add Topics box.
  11. SAVE THE EDITED PLUGIN.
  12. That's it; you've fixed the GREETINGS/AddTopics box bug for your copy of that mod, and may now load it anywhere in the load order and it will work fine.

It looks complicated when you read it like this, but trust me, it's really simple when you see it in the CS in front of you.

Credits[edit | edit source]

Special thanks to motub on the Elder Scrolls Forums for writing the original article that this is based on.