XEdit - Sort & Clean 'master files' from a plugin

From Nexus Mods Wiki
Jump to: navigation, search

Overview

The term xEdit is used as the generic name for the various game specific versions (aka TES5Edit, FNVEdit, etc.) which are simply renamed copies of the same tool so it will correctly determine the correct file structure to use.

Sorting "master files" is necessary if the creator of a plugin didn't have them in the same "load order" as you (or xEdit) do. Fortunately this is easy to fix, but if you don't it can cause problems in your game. It will be covered as part of the more time consuming problem of removing a "master file" from a plugin in this article, but is completely separate and not related. (See the Sorting Masters section if that is all you are interested in learning.)

To the best of my knowledge, xEdit is the only reliable way to remove "master files" from a plugin. But it is not an automatic process. Rather it is the finishing verification that you have manually removed all such references from your plugin.

It is assumed you have at least some familiarity with the terminology and use of xEdit to create a "Compatibility" or "Feature" patch. If not, you are advised to learn the basics of that operation first. They are all described in the FNVEdit Training Manual, but that is not a tutorial style document. It is a "reference manual".

Note that a "compatibility patch" is different than a "merge patch" or a "merge plugin". (There are various terms used on the internet to reference each of these types of files, but they remain distinct entities.)

  • "Compatibility/Feature Patches" make more than one mod work together by resolving specific record level conflicts or incorporating features from another in some chosen manner desired by the plugin author. See the Making a Feature Patch (6:31 minute video) by Roy Batty. A more lengthy series of "steaming style" tutorials can be found at:
  • "Merge Patches" resolve record level conflicts between plugins based upon the last to touch the record in the load order winning. This can be created either manually (forcing a winner by creating a new "last" plugin) using xEdit, or "algorithmically" using "Wrye Bash" or it's game specific forks (e.g. "Mash", "Wrye Flash", etc.) to create a "Bash Patch" (which also goes last in order to win). These "Bash Patch" algorithm winners can be mitigated through the use of "tags". See the wiki article Bash Tags and the Wrye Bash Patch.
  • "Merge Plugins" combine more than one "non-conflicting" plugin into a single plugin (within certain limits) to reduce the number of overall "active" plugins. These must be "non-conflicting" because the process does NOT resolve record level conflicts. See the Merged Plugin Guidelines for Personal Use wiki article. (This is not to say you can't ever merge "conflicting" plugins into a single plugin. Simply that it is an advanced technique not covered in the referenced article.)

You have to load your plugin and all it's "master files" into xEdit, and then find everywhere there are records in the plugin using records from the master file you want to remove. These are not only found in those color tagged as "conflicting" (red background), though those are the place to start. They can also exist in any record, even "new ones" (white background).

Once you think you have removed all the references to records from the master to be removed, you use the "Clean Masters" function and check for the presence of the master in the plugin's file header. IF all references are gone , then it will have been removed. If it remains, you still have some references to locate. (Save what you have done, reload, and work through it again.) You can end up having to work through every single record in the plugin. But it will eventually work.

Programs and Tools


Details

To illustrate, let's suppose we want to remove "Fallout New Vegas" (FNV) plugin "EVE FNV - ALL DLC.esp" as a "master file" from the "AWSO-WMX-EVE-ALLDLC-Merged Patch.esp" plugin.

"AWSO" is "All Weapon Sounds Overhaul", a comprehensive replacement of the existing weapon sound files. As such it is conflicting with weapon and animation records in other plugins (FalloutNV.esm, the 5 DLC files, YUP, WMX, WMX-DLCMerged, and EVE). In this instance, assume we do not want to use the records from EVE in this "compatibility" file. We could build our own "compatibility" file, but have decided instead to only remove the EVE records in order to retain the author's choices for the other records. (It should also be a relatively quicker process involving fewer records.)

Preparation

Seriously consider either moving your game folder elsewhere and installing only the needed plugins, or creating a separate profile for the purposes of this project (depending upon your "mod manager"). You don't want to accidently change anything your saved game files rely upon by accident.

  • Absolutely keep a separate backup of the original "AWSO-WMX-EVE-ALLDLC-Merged Patch.esp" file, just in case you decide to start over.

Make sure you have installed and "actived" all the "master files" the plugin currently depends upon. For "AWSO-WMX-EVE-ALLDLC-Merged Patch.esp" these are:

Sort the "load order" as necessary for the proper functioning of your game. Then place the "EVE FNV - ALL DLC.esp" plugin just above the "AWSO-WMX-EVE-ALLDLC-Merged Patch.esp" plugin (because we only added it to remove it as a master, and not because it is going to be used during play). Placing it there will make it easier to find the records in the latter that come from the former.

Note that this patch was created with the DLC in the wrong order for stable game play. We will be correcting that as part of this process, using the xEdit "Sort Masters" command.

  • Open xEdit and load the plugin we are going to edit: "AWSO-WMX-EVE-ALLDLC-Merged Patch.esp". (Note the xEdit exclusivity warning under Programs and Tools.) This should automatically load the other "master files" it depends upon. The "Messages" tab of the right-hand pane will display "Background Loader: finished" at the bottom when ready to proceed.

Sorting Masters

This only needs to be done once, upon first loading the plugins.

  • "<Right-click>" on the "AWSO-WMX-EVE-ALLDLC-Merged Patch.esp" file in the left hand pane and select "Sort Masters" from the pop-up "context menu". This will cause the "master file" sequence in the "File Header" record to be sorted to that xEdit uses (which is based upon extension and date/time stamp only) and automatically adjust record references.
(See SortMasters Figs. 01 thru 04. Click the link/thumbnail to see the enlarged image. Use your browser "<back page>" control to return to this page.)
  • Exit xEdit and ensure that the plugin "AWSO-WMX-EVE-ALLDLC-Merged Patch.esp" is checked to be saved. (If for some reason you do not want the changes to be saved, uncheck it's filename first.) Click on the "OK" button.
  • Reload the "AWSO-WMX-EVE-ALLDLC-Merged Patch.esp" plugin and it's masters into xEdit. The "master files" should now be in the correct sequence. Proceed to the next step.

Examining records

  • "<Left-click>" on the "+" to the immediate left of the "AWSO-WMX-EVE-ALLDLC-Merged Patch.esp" file in the left hand pane. This will expand the list of record categories in that plugin. ("<Ctrl+Left-click>" will expand not only the record categories but also all the records themselves. we won't do that as we only are concerned with a few specific categories.)
  • As AWSO is a "sound replacement" mod, you might think we would start with the "sounds" record category (and you could). But there is only one such record from "EVE" ("0003C943 WPNMissleLauncherFire2D") so instead to illustrate the process in this example we are going to skip to the "Weapons" category, and scroll down to the record "001251CC VFSWeapPlasmaRifleVanGraff (Van Graff Plasma Rifle)".
CleanMaster Fig. 01-Before
  • In the right-hand pane of FNVEdit, the "View" tab should show you the image in "Fig. 01-Before". (You will need to scroll down through the list of records a bit to find the "INAM - Impact DataSet" record.)
  • In the figure, the "red" boxes show that the record in the "AWSO" plugin is that same as the one in the "EVE" plugin. This is an example of what makes "AWSO" dependent upon "EVE", and will prevent the "EVE" master from being removed by the "Clean Master" command. We have to find every instance of such dependencies and replace them.
  • The "blue" boxes show the possible replacement records we could use to replace the "EVE" record in the "AWSO" plugin. As this is intended as a merge of other plugins, we should choose a record from one of those merging plugins. In this instance, it doesn't matter as they are all using the same record. If more than one other plugin's record was suitable, that would be your choice.
CleanMaster Fig. 01-After
  • To replace the "EVE" record in "AWSO" simply "<Left-Click" and hold the mouse button on the replacement record under another plugin, and drag it over to the "AWSO" record, and release the mouse button. The replaced record should look as shown in the upper record of "Fig. 01-After".
  • (See CleanMaster Figs. 01-Before and 01-After. Click the link/thumbnail to see the enlarged image. Use your browser "<back page>" control to return to this page.)
  • This is the basic process. There is one variation: removal of a record in the "merged plugin" (e.g. "AWSO") from the "master plugin" in question (e.g. "EVE") for which there is no suitable replacement from a plugin being merged. In the example this is the case with the "World Model" record, "MOD4 - Model Filename" sub-record.
  • To delete the record from "AWSO", simply "<Right-Click>" on the record, select "Edit" (or "Remove") from the context menu that appears. ("Remove" does not always appear as an option, but performs the same actions as follow for "Edit" from a single mouse click.)
  • When "Edit is selected, it will display a window with the content of the record as text. You can either hit the "<Delete>" key or remove the contents by backspacing. Once the displayed window is empty, click on the "OK" button to save the changes. Figure 01-After shows one record in the lower area of the image which has already been deleted, and the second is about to be "edited".
  • (See CleanMaster Fig. 01-After. Click the link/thumbnail to see the enlarged image. Use your browser "<back page>" control to return to this page.)
  • Repeat the process for EVERY record in the plugin being "cleaned" (e.g. "AWSO"), whether it appears to have a conflict or not. For example, "sound" record "0003C943 WPNMissleLauncherFire2D" is a "yellow" background with "green" text, indicating it is an "override without conflict". There is no way to tell it is using a sound from "EVE" without looking at the record directly. You can save the file after editing only part of it if you need to break up the process into several sessions. When you do load it back into xEdit, be sure to attempt to "Clean Master".
  • If it fails to remove the target master file (e.g. "EVE" in our example), then you still have records you need to edit.
  • If it succeeds, then proceed to the Clean Master section.

Clean Master

  • If you haven't already, save your edited plugin (e.g. "AWSO-WMX-EVE-ALLDLC-Merged Patch.esp").
  • Reload the "AWSO-WMX-EVE-ALLDLC-Merged Patch.esp" plugin and it's masters into xEdit.
  • "<Right-click>" on the plugin file name (e.g. "AWSO-WMX-EVE-ALLDLC-Merged Patch.esp") and select "Clean Master" from the context menu that is displayed.
  • When the "Messages" tab indicates the process is done, or the filename is displayed in "bold text", expand the "+" next to the filename so you can select the "File Header" record.
If you have successfully edited out all the record dependencies upon the master to be removed (e.g. "EVE"), then the list of "master files" will not longer contain that file (e.g. "EVE FNV - ALL DLC.esp"). Save the result immediately and use Windows Explorer rename the plugin to reflect your new version (e.g. "AWSO-YUP-WMX-ALLDLC-Merged Patch.esp").
If the master file is still present, then there are still references to be removed. Resume from the beginning of the Examining records section.
  • Package your new plugin and add it to your "downloaded mods" collection so you can instll it as normal.
  • If you intend to publish your mod:
  • Check the original mod permissions first,
  • Then see the 'Packaging Mods for Installation' section of the wiki [1]Getting started creating mods using GECK] article.


References

A streaming series of compatibility patching tutorials can be found at: