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?
- How to clean a plugin on Windows using Powershell
- How to clean a plugin on Windows using Mod Organizer 2
- How to clean a plugin on Linux or MacOS
- Further Reading
- Legacy Information
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
- Download tes3cmd and extract
tes3cmd.exe
to your vanillaMorrowind\Data Files
folder. - 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). - Before you run the commands below, replace
C:\Path\To\Morrowind\Data Files
to reflect your own folder structure andModToClean.esp
with the file name of the mod you want to clean. - Open Windows Powershell and type the following commands:
- 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. - Replace the original dirty plugin from your mods folder with the
Clean_
version tes3cmd produced. - 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.
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.
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.- Download tes3cmd and extract
tes3cmd.exe
to your vanillaMorrowind\Data Files
folder. - Download and install Wrye Mash to your vanilla
Morrowind
folder. Use theWrye Mash 2019 x64 - Installer
file. - 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.
- 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 themash64.exe
file in theMopy
folder and title itWrye Mash
. Now, in the drop-down menu next to the bigRun
button you should be able to run Wrye Mash from MO2. - 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 sayDetected!
in blue text if it is found. - In Wrye Mash on the
Mods
tab you should now be able to right-click your plugins and use the optionClean with tes3cmd
in the context menu.
How to clean a plugin on Linux or MacOS
- Download tes3cmd and extract
tes3cmd
to your vanillaMorrowind/Data Files
folder. - 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). - Before you run the commands below replace
/path/to/Morrowind/Data Files
to reflect your own folder structure andModToClean.esp
with the file name of the mod you want to clean. - Open a Terminal window and type the following commands:
- 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. - Replace the original dirty plugin from your mods folder with the
Clean_
version tes3cmd produced. - 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.
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.
Further Reading
Please see the below pages as a more detailed reference on the topic of plugin cleaning:
- Argent's GMST Explanation
- Morrowind++ Tools Guide
- UESP: Tes3Mod:GMST_Contamination
- UESP: Tes3Mod:Cleaning Mods
- A reddit post about using
tes3cmd.exe
with MO2 on Windows
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:
- A working install of vanilla Morrowind.
- Copies of each plugin you want to clean should be in the vanilla install's
Data Files
directory. - 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.