TES3cmd

From Morrowind Modding Wiki
Jump to: navigation, search

tes3cmd is a command-line tool written by john.moonsugar. tes3cmd is used for examining and modifying TES3 plugins in various ways. It can also create a patch for various problems and merge leveled lists. It is written in Perl and runs natively on Windows or Linux.

Download tes3cmd

You can download tes3cmd from its Github page. Old versions can be found in the Google code's mlox project download page.

As of version 0.37, tes3cmd comes in standalone executable (.exe) form. But you can also use the plain script form, which requires you to install Perl.

Installing and running tes3cmd

The easiest way to install tes3cmd is just to put tes3cmd.exe into your "Data Files" folder.

You can install it elsewhere and then modify your computer's environment variables for this new location but other tools which rely on tes3cmd, such as abot's MMOG, expect tes3cmd to be located in your "Data Files" folder.

Features

tes3cmd's full feature list is detailed on the mlox wiki, in summary:

  • Add/Remove/List Plugins in your load order
  • Clean plugins of Evil GMSTs, junk cells, and more
  • Find record IDs common between two plugins
  • Delete records/subrecords/object instances from plugin
  • Report differences between two plugins
  • Dump records as text for easy study
  • Convert plugin (esp) to master (esm)
  • Convert master (esm) to plugin (esp)
  • Read/Write plugin Author/Description, update plugin masters
  • Powerful batch record modification via user code extensions
  • Patches problems, merges leveled lists, etc.
  • Identify overlapping dialog (a source of missing topic bugs)
  • Recover usable records from plugin with 'bad form' errors
  • Reset dates of Bethesda Data Files to original settings

The following are those features most of interest to mod users:

Clean plugins

The clean command removes various junk entries from plugins:

  • The clean command will clean objects in the plugin that match objects in any of its masters.
  • The subrecords for AMBI (ambient lighting) and WHGT (water height) for interior cells are often duplicated from the master of a plugin when the plugin is saved in the Construction Set.
  • Object definitions for various record types defined in a master are sometimes unnecessarily duplicated in dependent plugins.
  • Evil GMSTs, that is GMSTs (Game Settings) from the list of 11 Tribunal GMSTs or 61 Bloodmoon GMSTs that are inadvertently introduced to a plugin by the Construction Set with specific values.
  • Junk cells are bogus external CELL records that crop up in many plugins due to a Construction Set bug.

The goal of the "clean" command is that it should always be safe to use it with no options to get the default cleaning behavior.

Using a batch file to clean plugins

If you are uncomfortable using command-line utilities like tes3cmd you can create create a batch file for cleaning.

Copy and paste this text into Notepad:

@echo off
REM drag and droppable bat file
REM put shortcut on desktop and drag esp onto it
REM “clean” file and log will be added to same folder the esp came from

tes3cmd clean %1 > %1-cleaned.log
TYPE %1-cleaned.log
PAUSE

Save as tes3cmd_clean.bat where ever you installed tes3cmd.exe. Next find tes3cmd_clean.bat, right click it and select Send To > Desktop (create shortcut).

Now you can drag an esp from any folder onto your desktop shortcut and tes3cmd will clean the plugin and replace the original. tes3cmd will create a log file showing what the cleaning command did, the log file's named after the plugin that's been cleaned. So if you dragged and dropped foo.esp onto the shortcut then the log file will be called "foo-cleaned.log". The log file is stored in the same folder as the plugin.

Multipatch

The multipatch command produces a patch file based on your current load order to solve various problems. The tes3cmd created multipatch plugin:

  • Ensures renamed cells are not accidentally reverted to their original name.
  • Fixes all fogbugged cells in your active plugins by setting the fog density of those cells to a non-zero value.
  • Ensures that known summoned creatures are flagged as persistent. There is a bug in Morrowind that can cause the game to crash if you leave a cell where an NPC has summoned a creature.
  • Merges leveled lists used in your active plugins.

Using a batch file to create a multipatch plugin

If you are uncomfortable using command-line utilities like tes3cmd you can create a batch file to generate a multipatch plugin.

Copy and paste this text into Notepad:

@echo off
REM batch file to create a multipatch plugin using tes3cmd
REM put shortcut on desktop and double-click it to create multipatch

tes3cmd multipatch > multipatch.log
TYPE multipatch.log
PAUSE

Save as tes3cmd_multipatch.bat where ever you installed tes3cmd.exe. Next find tes3cmd_multipatch.bat, right click it and select Send To > Desktop (create shortcut).

Now simply double-click the shortcut on your desktop to create a multipatch plugin.

Reset dates

Resets the dates of the Bethesda masters (.esm) and archives (.bsa) to their original settings.

This may help those people who have problems with textures and meshes being overridden by the vanilla resources, as can happen with the Steam version of Morrowind.