Jump to content
  • Announcements

    • AndalayBay

      Orphan Attachments   07/31/2018

      I have been doing some housekeeping lately and I've noticed that I had a lot of orphaned attachments. Attachments get orphaned when the PM or post is deleted without removing the attachment first. Deleting a PM or post does not delete the attachment and the file or image remain on the server. I'd like to ask all members to go through their attachments and delete any attachments you don't need anymore or those that have been orphaned. Where can I get a list of my attachments? Click on your display name in the upper right corner of the forums and pick "My Attachments" from the drop-down list. How can I tell an attachment is orphaned? If the PM has been deleted, you'll see a message like this in your attachment list: Unfortunately there is no message if the post has been deleted, so please check your old posts. We do purge old birthday threads every once in a while. Also some hosted projects have been shut down, so you may have orphaned attachments on one of those locations. Thanks!
Sign in to follow this  

Cleaning Mods with TESxEdit

Recommended Posts

TESxEdit Cleaning Guide

There have been many cleaning guides written over the years, with the main one being on the Construction Set Wiki, but recent updates to TESxEdit have made most of those guides obsolete. I also thought I would collect the different aspects of cleaning mods into a single guide.

What is a "Dirty" Mod?

While some would consider it's a mod that uses foul language or has scenes of a sexual nature, that's not what we mean by a "dirty" mod. Dirty mods are mods that modify records in a master file, like Oblivion.esm, that are not necessary for the mod to function. They can encompass records that have been flagged as modified, but not actually changed, and records that have actually been modified with what are called "wild" edits. The Construction Set (CS) itself is part of the problem in that records can be flagged as modified even if the mod author was just looking at a cell or viewing a dialogue record. "Wild" edits can occur when you accidentally hit a key when looking at a landscape cell, for example. Mod authors often don't even realize these changes have occurred, so as a mod author, it is important that you clean your mod before releasing it.

There are also changes that inexperienced mod authors make, like deleting content from a cell that they don't want. They don't realize that these deleted records will crash peoples' games. Why? Because you don't know if another mod is going to reference that record you deleted. If it does, boom! There is no authority that checks every mod that has ever been produced to ensure that they are all going to be compatible with each other, so it's incumbent on each mod author to restrict their changes to only the content they need to change and they never ever delete records from the game master plugins, like Oblivion.esm. I'll explain the proper way to handle stuff you don't want later in this guide.

Why are Dirty Edits a Problem?

Basically as I just described above. Obviously deleted content is a serious problem, but even unintentional edits are a problem because they can prevent another mod from functioning properly. The last mod in a load order always wins, so if that mod has a dirty edit, that dirty edit will override the intentional edit of another mod and the other mod won't work.

Ok, so what happens when two mods make intentional changes to the same record? That's what the Bashed Patch is for. The Bashed Patch collects all the changes that mods make and combines those changes into a single patch that's loaded last in your load order. Cool, eh? You use Wrye Bash to create a Bashed Patch. See the Wrye Bash documentation for instructions, at least until I get my guide posted for doing that.

If the Bashed Patch can't handle the compatibility issues, then one of the mod authors involved usually creates a custom compatibility patch to resolve the issue.

Cleaning Mods

In this guide, I will explain simple cleaning, cleaning mods with explicit dependencies, cleaning mods with implicit dependencies and manual cleaning.

Simple Cleaning
Level: Beginner

This is always the first step in cleaning a mod. It will remove what TESxEdit calls "Identical to master" records. These are records that have been flagged as modified, but haven't actually changed.

Run TESxEdit. When it opens, you will be presented with a dialog box to select the plugins you wish to work with. When cleaning a mod, it is vital that you only load the plugin that needs cleaning. In this simple case, the plugin has no other dependencies than the game master file(s).

Right-click on the dialog and click Select None from the menu.


 Then scroll through the list and select the plugin you wish to clean. Click in the box to the left of the plugin to select it for loading. Click OK.

Now TESxEdit will proceed to load the plugin. You will see a bunch of messages scroll by in the right pane. Once it's done loading the plugin, the last message will say "Background Loader: finished".

Right-click on the plugin name in the left pane and select Apply Filter for Cleaning from the menu.


TESxEdit will pause for a few moments while it applies the filter. When it's done, the message at the bottom of the right pane will say "[Filtering done] Processed Records: xxxxxxx Elapsed Time: xx:xx" where the x's represent the number of records and the time it took.

Now right-click on the plugin name in the left pane again and select Remove "Identical to Master" records from the menu. Why doesn't it just say "Clean Plugin"? Because "cleaning" involves several steps. Removing the records with the false changed flag, or identical to master records, is just the first step.



Once TESxEdit is done, it will display the results in the right pane, like this:



The first step is complete. You can press CTRL+S to save the plugin at this point if you wish. Click OK in the dialog that pops up if you do.

Simple Cleaning Step 2: Undelete and Disable

This is the second step in the simple cleaning process. If you've been reading from the beginning, you'll recall that I said that you should never delete anything from the game master files and that I would tell you how to handle content that you don't want in your mod. You have two options: disable the content yourself, or delete the content and then use TESxEdit to handle the deleted content properly. This is my recommendation. Yes, go ahead and delete the content in your mod, but clean it with TESxEdit and then perform the Undelete and Disable process as I will explain now.

Even if you're just running mods, it's a good idea to clean them and that includes this step. You never know if the mod author deleted something. It may not have even been intentional.

If you closed TESxEdit after the first step, open it again, deselect all mods and then select the mod that needs cleaning. Click OK to load the mod.

Right-click on the plugin name in the left pane and select Undelete and Disable References from the menu.



After a few seconds, you'll see the results at the bottom of the right pane:



All done! Now you can close TESxEdit. If it prompts you to save, click OK in the dialog that pops up.

If you're cleaning plugins for mods that you use, I suggest creating a folder somewhere called Cleaned Mods and keep a copy of the plugin in that folder. Then you know which mods need cleaning if you return to playing after being away for a while. BOSS and LOOT will also tell you if a mod needs cleaning, providing someone has told them about it. If you find a mod needs cleaning and BOSS or LOOT don't have a message about that, then please let them know.

Last note: Bethesda isn't innocent when it comes to dirty mods. The official DLC's for Oblivion and Skyrim need cleaning! Cleaning the official DLC's for Skyrim is a bit more work that I'll discuss later.


Edited by AndalayBay
Restored images

Share this post

Link to post
Share on other sites

Beautiful tutorial Andalay Bay.  You made the mod cleaning process clear and concise, and easy to follow.


I'll be honest with you.  Mod cleaning was daunting to put it mildly.  I never knew where to start or what the different


menu items did.  Thanks for posting this.  It will be invaluable.


Now I have no excuse not to clean my dirty mods.

Share this post

Link to post
Share on other sites

I find most of the tutorials out there leave out key steps and don't have enough screenshots.

I agree. I started with the good old CS Wiki. It has a lot of good information, but telling people to "go read that page and start cleaning your mods" rarely gets them to actually do it. No pics, a lot of reading, etc. This guide is just perfect! :D

Share this post

Link to post
Share on other sites

LOL! I thought I was the only one crazy enough to think that way! I tend to do them in big batches, so it's kind of a repetitive task I can just relax with.

Hint: With Wrye Bash, once you've cleaned a plugin, the Installer's box will turn orange, indicating a CRC mismatch. Obviously because the CRC changed if any edits were made & saved during the cleaning process. If you Anneal, Install, or Install Missing, your newly cleaned ESP will be replaced with the old dirty one from the package or project - so don't do that. What I do is double click on the installer to open it up (in 7-Zip in my case). I hit F2 to rename the ESP, and change the name to "xxx.esp.Original.DIRTY", that way I have a backup of the original ESP, in-case something got screwed up. Then I drag the newly cleaned ESP from my Data folder into my 7-Zip window, aka copy it into the archive. When you switch back to Wrye Bash and the Installers tab updates, it should show green (or yellow) again, indicating that the ESP in the package/project now matches what's in the Data folder. If you keep a separate archive of downloaded mods (as I do), you may also want to repeat this process for the mod in that archive.

Also, don't forget to clean your Official DLC! :)

Edited by RavenMind

Share this post

Link to post
Share on other sites

Oh sorry, that's not what I meant by big batches. I just meant I clean one, save & close xEdit, then repeat with the next mod. Not that I'm cleaning more than one esp in the same xEdit session. Yeah, definitely only clean one esp at a time!

Share this post

Link to post
Share on other sites

I probably shouldn't post this as it may confuse people, but in fact you CAN clean multiple ESPs in a single session (still one after the other, but without closing and reopening xEdit for each one). You hide all the ESPs loaded which aren't relevant to the current clean, clean the first ESP, then hide it (and any masters not needed for the next one) and unhide the next ESP and its masters, clean it and repeat. When you have a large number of ESPs sharing a single master, this makes life a little easier (such as if you have 10 compatibility patches for a single Unique Landscape, load them all up along with the 10+ conflicting mods, and clean each patch one after the other - no you don't need to do this, I did it for you).

Share this post

Link to post
Share on other sites

@Vorians Thank you! I can see that saving me a lot of time! (And also thanks for cleaning up all those patches. Ye gods, that must have taken a while.)

@AB: Totally understand. Cleaning that way is not for average users cleaning a handful of mods, who are generally confused by the process &/or interface anyway.

Edited by RavenMind

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this