Tips: Cleaning Plugins With TES3CMD

Performance Custom Shaders Custom Groundcover Portable Install Navmeshtool Register BSAs Merging Objects File Renames Atlased Meshes INI Importer OPENMW_PHYSICS_FPS

Table of contents

What's an "Evil GMST" and why do I need to "clean" dirty plugins?

Game Setting (GMST) records can be anything from numerical values for armor and weapons to the names of skills or spells and much more. There is a phenomenon with the vanilla TES Construction Set where mod plugins that are saved without loading the Morrowind expansion master plugins (ie: Tribunal.esm, Bloodmoon.esm) into the Construction Set will result in some GMST records becoming contaminated. These contaminated records are called Evil GMSTs and plugins contaminated with Evil GMSTs are called "dirty" plugins.

Evil GMSTs manifest in the form of corrupted or incorrect data in-game and will negatively impact your experience with the game when you encounter them. For the most seamless experience when combining many mods it is important that we clean these dirty plugins.

With the exception of Evil GMSTs, DeltaPlugin will automatically clean all kinds of dirty records with its merged plugin output. The only dirty plugins this website will advise you to clean are those with Evil GMSTs.

The tes3cmd utility was created to, among many other things, clean plugins of these undesired changes.

How to clean a plugin on Windows using Powershell

  1. Download tes3cmd and extract tes3cmd.exe to your vanilla Morrowind\Data Files folder.
  2. Copy the plugin you want to clean into the vanilla Morrowind\Data Files folder along with any master plugins required by the mod you want to clean (If you are unsure just run the command below and tes3cmd will warn you about requirements).
  3. Before you run the commands below, replace C:\Path\To\Morrowind\Data Files to reflect your own folder structure and ModToClean.esp with the file name of the mod you want to clean.
  4. Open Windows Powershell and type the following commands:
  5. cd "C:\path\to\Morrowind\Data Files"
    .\tes3cmd clean "ModToClean.esp"

    If you're unfamiliar with the commands and want an explanation, the cd command changes the directory you are running commands in and then we run the tes3cmd executable with the clean option on the mod you want to clean.

  6. Pay attention to the tes3cmd output. It will let you know if anything went wrong, and will also give you a summary of what was cleaned. If it told you it was trying to locate a master plugin make sure to also copy that plugin into your vanilla Morrowind\Data Files directory and run the command once more.
  7. Replace the original dirty plugin from your mods folder with the Clean_ version tes3cmd produced.
  8. Finally, remove any leftover files in your vanilla Morrowind\Data Files folder including any dirty plugins, cleaned plugins, or requirement files. Feel free to back these up in a separate folder.

How to clean a plugin on Windows using Mod Organizer 2

Note: The instructions above using Powershell work just fine if you are using MO2. These instructions are for those who would rather use a user interface for cleaning mods, but requires a little more setup.
  1. Download tes3cmd and extract tes3cmd.exe to your vanilla Morrowind\Data Files folder.
  2. Download and install Wrye Mash to your vanilla Morrowind folder. Use the Wrye Mash 2019 x64 - Installer file.
  3. Run Wrye Mash and it will prompt you to provide the vanilla Morrowind folder, the folder you have your mods installed to through MO2, and optionally the directory for mlox if you're using that program.
  4. In MO2 click the green and blue gears icon to Modify Executables. Click the blue plus button to add a new executable from a file, and navigate and select the mash64.exe file in the Mopy folder and title it Wrye Mash. Now, in the drop-down menu next to the big Run button you should be able to run Wrye Mash from MO2.
  5. Run Wrye Mash and make sure tes3cmd is detected by clicking the gear icon at the bottom left and click the Paths tab. It should say Detected! in blue text if it is found.
  6. In Wrye Mash on the Mods tab you should now be able to right-click your plugins and use the option Clean with tes3cmd in the context menu.

How to clean a plugin on Linux or MacOS

  1. Download tes3cmd and extract tes3cmd to your vanilla Morrowind/Data Files folder.
  2. Copy the plugin you want to clean into the vanilla Morrowind/Data Files folder along with any master plugins required by the mod you want to clean (If you are unsure just run the commands below and tes3cmd will warn you about requirements).
  3. Before you run the commands below replace /path/to/Morrowind/Data Files to reflect your own folder structure and ModToClean.esp with the file name of the mod you want to clean.
  4. Open a Terminal window and type the following commands:
  5. cd "/path/to/Morrowind/Data Files"
    tes3cmd clean "ModToClean.esp"

    If you're unfamiliar with the commands and want an explanation, the cd command changes the directory you are running commands in and then we run the tes3cmd executable with the clean option on the mod you want to clean.

  6. Pay attention to the tes3cmd output. It will let you know if anything went wrong, and will also give you a summary of what was cleaned. If it told you it was trying to locate a master plugin make sure to also copy that plugin into your vanilla Morrowind/Data Files directory and run the commands once more.
  7. Replace the original dirty plugin from your mods folder with the Clean_ version tes3cmd produced.
  8. Finally, remove any leftover files in your vanilla Morrowind/Data Files folder including any dirty plugins, cleaned plugins, or requirement files. Feel free to back these up in a separate folder.

Please see the below pages as a more detailed reference on the topic of plugin cleaning:

Legacy Information

Below is the legacy information about plugin cleaning, click to this line to expand it.

NOTE: Not all plugins require cleaning, despite TES3CMD finding things to clean! Please consult the documentation for any mod that you are unsure about cleaning.

In my own quest to clean dirty plugins, I wrote a bash script to automate the process. Below is a bash script that can be used on any unix-like OS to clean known dirty mods, all in one swoop (it assumes tes3cmd is available in your $PATH).

Before you can run the script, you must have:

  1. A working install of vanilla Morrowind.
  2. Copies of each plugin you want to clean should be in the vanilla install's Data Files directory.
  3. Place the below script into the root of the vanilla install (right next to the Morrowind.exe file) and run it from that directory.

My vtasteks-light-fixes.sh helper script could be useful for handling steps 1 and 2 above, check it out.

NOTE: If you aren't comfortable with scripts, please don't just copy and paste this. It's meant to be a reference for those who know what they are doing.

HEY: Windows scripters!! I need your help in providing an equivalent example for your OS. Please contact me if you can help!

#!/usr/bin/env bash

set -e

#
# Below is an example list of plugins.
# Replace it with a list of ones you are using that need cleaning.
#
declare -a plugins_to_clean=(
    "Pickpocket Rebalance 0.15 Mod and 100% chance max.ESP"
    "Telvanni Cephalopod Armor.esp"
    "Dark Brotherhood.ESP"
    "sm_golden_mask.ESP"
)

_oldIFS=$IFS

IFS=$(echo -en "\n\b")

for thing in "${plugins_to_clean[@]}"; do
    _path=$(find . -name "${thing}")
    echo NOW RUNNING: tes3cmd clean "${_path}"
    tes3cmd clean "${_path}"
done

IFS=$_oldIFS

Plugins that have been cleaned will be output as Clean_PluginName.esp (e.g. Clean_Windows Glow.esp), and the original left in place untouched.

Getting Started Tips Mod List Changelogs Website Changelog CFG Generator Name Generator About FAQ Resources Users' Guide Developers' Guide Subscribe Issue Tracker MOMW On Discord #momw On IRC MOMW On GitLab
Settings
GPLv3 logo