Guide:Merging Plugins: Difference between revisions

From Step Mods | Change The Game
mNo edit summary
No edit summary
Line 14: Line 14:
This does not cover the use of patches created by [http://www.uesp.net/wiki/Tes5Mod:SkyProc SkyProc]. In Skyrim, SkyProc is used by several active Skyrim mods (e.g., ASIS, Dual Sheath Redux, NPC Enchantments Fix) to create mod-specific patches. SkyProc itself, however, is capable of creating patches similar to the bashed patch in [http://skyrim.nexusmods.com/mods/1840/? Wrye Bash] (WB), but to date there are no SkyProc patchers with this scope (the [http://forums.bethsoft.com/topic/1402763-wipz-skybash/ SkyBash] effort is effectively dead).  
This does not cover the use of patches created by [http://www.uesp.net/wiki/Tes5Mod:SkyProc SkyProc]. In Skyrim, SkyProc is used by several active Skyrim mods (e.g., ASIS, Dual Sheath Redux, NPC Enchantments Fix) to create mod-specific patches. SkyProc itself, however, is capable of creating patches similar to the bashed patch in [http://skyrim.nexusmods.com/mods/1840/? Wrye Bash] (WB), but to date there are no SkyProc patchers with this scope (the [http://forums.bethsoft.com/topic/1402763-wipz-skybash/ SkyBash] effort is effectively dead).  


== Merging Mods the Don't Have Conflicts ==
== Merging Mods Without Conflicts ==


=== Automatic Merging of Multiple plugins with the ''Merge Plugins TES5Edit Script'' ===
=== Automatic Merging of Multiple plugins with the ''Merge Plugins TES5Edit Script'' ===

Revision as of 04:18, March 4, 2014


Merging esp Plugins and Creating Plugins that Merge Multiple Patch Plugins[edit | edit source]

For TES and Fallout Bethesda games, primarily Skyrim

Introduction[edit | edit source]

There are multiple methods that can be used to merge all or portions of esp plugin files to allow large collections of plugins to fit inside the 255 plugin limit of Bethesda TES (TES4 and TES5) and Fallout (Fallout 3 and Fallout NV) games. Some of these methods create or merge compatibility patches for multiple mods using a single esp plugin, thus reducing the need for multiple esp plugins to provide compatibility patches for various pairs of mods.

The techniques below are listed in order of increasing complexity. With the exception of the Wrye Bash methods below, all the techniques described here require a good understanding of TES5Edit (or equivalents for other games) and the record structures of plugins.

Since TES4Gecko which automatically merges Oblivion plugins, and FNVPlugin which merges Fallout New Vegas plugins, work for a Oblivion and Fallout New Vegas respectively they are not discussed any further since they are not useful for Skyrim. They remain very useful, of course, for the games for which they were developed.

This does not cover the use of patches created by SkyProc. In Skyrim, SkyProc is used by several active Skyrim mods (e.g., ASIS, Dual Sheath Redux, NPC Enchantments Fix) to create mod-specific patches. SkyProc itself, however, is capable of creating patches similar to the bashed patch in Wrye Bash (WB), but to date there are no SkyProc patchers with this scope (the SkyBash effort is effectively dead).

Merging Mods Without Conflicts[edit | edit source]

Automatic Merging of Multiple plugins with the Merge Plugins TES5Edit Script[edit | edit source]

The Merge Plugins TES5Edit Script mod has evolved to where it provides a simple way to do even complex merges. Version 1.6 includes a simple GUI and a multipass merge approach that even allows merging mods with NAVM/NAVI (navmsesh) records and with FormIDs (new objects created by the mods). Put the script into the "Edit Scripts" folder in the directory that contains the TES5Edit executable, and follow the instructions on the mod page. The FAQ in this description is also quite valuable since it covers the major issues associated with merging plugins including problems caused by changing FormIDs (as discussed later in this guide). For mods that don't create objects used by other mods that aren't being merged, the resulting merged mod should be free of any problems. Examples of mods like this are

The merge script also works well with mods that provide items like armor and clothing. The only issue with these mods is that if the mods being merged change sufficiently when updated then a new merge of the underlying mods might not preserve all of the objects in a players inventory, as discussed in the Q: My hair's gone?! My armor's gone?! My weapons are gone?! My face is gone?!?!WHAAATTTT?!!!?! question in the FAQ for this mod.

It is also limited to mods that don't have any direct conflicts. It there are such conflicts, they have already been reported. This check can also be done manually by looking at the records and subrecords in TES5Edit, perhaps using the Conflict Filters capability in TES5Edit described in section 4.3 of the FNVEdit Training Manual.

If the plugins being merged are compatibility patches, particular care must be taken since these patches typically need to load later in the mod load order and because there might be conflicts across different compatibility patches that need to be resolved. If this automated technique is used, it is a good idea to create one plugin that combines the optional patches for an individual mod vs. creating one plugin across many different mods since the automated method can't properly handle conflicts. If the plugins being combined are from the same mod, always start with the plugin for the main portion of the mod. There may be intentional overwrites in the DLC or optional capability plugins, and by adding the main plugin first the combined plugin will have the correct records.

Using BOSS to maintain proper load order[edit | edit source]

The patches created by this method will not be in the normal BOSS list, so it is recommended that they be added using BOSS Userlist Manager - BUM. The easiest way to add the new plugin is to use BUM to create a new rule that BOSS will use. In BUM, select the new plugin in the left window (the plugin name will usually be in red text since it is unknown) and make sure the upper left menu next to the plugin name says "ADD". In the right window search for the name of the main file for the mod that was merged. When it is found, right click and select 'Sort Object"; this adds the name in the left window below that the new combined plugin. The menu select next to this mod name should say "AFTER". Click "Save Rule" to save this new rule, then close BUM.

Merging Mods that can have Conflicts[edit | edit source]

Wrye Bash[edit | edit source]

Documentation on creating a bashed patch with Wrye Bash is available in the Bashed Patch section of the General Readme for Wrye Bash (use the "?" icon on the bottom of Wrye Bash to display this file) and in the Wrye Bash Pictorial Guide. There is also a video on this. There is also additional discussion on Wrye Bash in the STEP Wrye Bash guide.

Key capabilities of the bashed patch are:

  • some plugins can fully merged into the bashed patch, and these plugins can then be disabled,
  • some tweaks can be added to the bashed patch, avoiding the need for a plugin to set these (e.g., crime radius and maximum number of companions in Skyrim), and
  • a few data record types, such as leveled lists, can be merged automatically in the bashed patch avoiding the need to manually create a compatibility patch for these.

The data record merging used in the bashed patch handles several types of conflicts. Like the TES5Edit Merge Patch discussed below, it handles situations when one mod changes a subrecord and another mod changes a different subrecord. The bashed patch also tries to resolve situations when two or mods change the subrecord. For example, if one mod changes an NPC skill level to 50 and another mod changes the same skill to 60, the bashed patch will choose one of these changes or use a compromise value based on both (e.g., 55).

The Skyrim version of Wrye Bash does not handle nearly as many record types as the versions for TES4 (Oblivion) or Fallout (Fallout 3 and Fallout New Vegas). Wrye Bash for Skyrim handles record types for armor, leveled items, leveled NPC and a very small set of game settings (GMST). The only game settings it handles are ones explicitly included in the bashed patch menu; it does not include any GMST records from mods. It remains, however, the best way to merge leveled lists and leveled NPCs, but with the WB limitations in Skyrim other utilities are often needed to supplement its capabilities.

TES5Edit Merge Patch[edit | edit source]

TES5Edit (and the equivalent programs for the other Bethesda games) can automatically create a Merge Patch that merges some potentially conflicting records across multiple mods. In Skyrim it can only work with a few types of records and is primarily useful as a starting point for creating manual patches.

Using this capability of TES5Edit is quite different than using the Merge Plugins TES5Edit Script described above since here TES5Edit is being using to create a set of merged records that only include records for which the mods being merged have conflicting entries while above it was merging entire mods when the mods had no conflicts. It can handle plugins that include scripts. This is described in section 4.8 of the FNVEdit Training Manual (the most recent available documentation for TES5Edit) and in Sharlikran's "Merge Patch" video. As the video points out, when using this TES5Edit (and the equivalent programs for the other Bethesda games) feature make sure to remove the Leveled List records and the leveled NPCs from the Merge Patch (note that unlike the edit programs for other Bethesda games the TES5Edit Merge Patch does not currently include leveled NPCs). It is recommended that Wrye Bash be used to take care of leveled list merging, as described above. Like the Wrye Bash bashed patch, the Merge Patch needs to be recreated whenever there is a plugins are added or updated that would change the patches automatically produced in the Merge Patch. The documentation on the Merge Patch suggest manual review of the patch to fix conflicts that the automated Merge Patch process was unable to fix.

In TES4 and the Fallout games the WB bashed patch was sufficiently comprehensive and intelligent that the Merge Patch wasn't typically needed. In Skyrim, however, the TES5Edit Merge Patch is quite useful, especially since it takes care of portions of compatibility patching that Wrye Bash doesn't. In addition to Leveled Item, the TES5Edit Merge Patch includes the following record types: Ammunition, Armor, Container, Faction, Magic Effect, Misc. Item, Scroll, Weapon, and Non-Player Character (Actor).

Creating a Merge Patch is straightforward. Load TES5Edit (or the equivalent programs for the other Bethesda games), and select "OK" after removing the checkmark for the bashed patch if there is one. Right click in the left window and select "Other" and then "Create Merged Patch". When prompted for a new module name enter a new name for the merged patch. After the patch is created disable and/or delete any previous Merged Patches. In addition, the Leveled Item object class should be removed and the patches reviewed to make sure they are reasonable changes; most of the time they are.


Manually merging plugins[edit | edit source]

TES5Edit can be used to manually create a single compatibility patch merge plugin that provides compatibility fixes and parameter changes across a large set of mods, that merge complete mods, or combinations of these. Manual editing is the most complicated and flexible of the methods being discussed here. It is briefly described in section 4.7 of the FNVEdit Training Manual. Since this is a manual process it can be used with plugins that have conflicts and those that have scripts; script records can be copied to the patch merge plugin like any other record. Manual Editing is easiest with plugins that do not have new FormIDs; if there are FormIDs they need to be renumbered. Manual editing is especially simple with small plugins that change a few parameters originally set by the main game esm file; of course, these are also the plugins that are easiest to combine with the automated methods discussed in the previous subsection. For example, in Skyrim the 26 Moon Size Tweak mod has two plugins each containing a single record. Merging these two plugins into a single plugin or even into an overall plugin containing Patches is particularly easy. Of course, the Merge Plugins TES5Edit Script mod described above can be used to further simplify this merge process as long as there are no conflicts. Generally speaking, actual manual editing (vs. using tools like the Merge Plugins TES5Edit Script) is needed when there are conflicts that can't be resolved automatically. This occurs frequently, but not always, when merging compatibility patches, and when creating compatibility records for mods that have compatibility problems but don't have existing compatibility patches.

In some ways the most difficult problem with manual merging is to decide which plugins to merge; it can be difficult to correctly merge complex plugins when there are conflicts on multiple subrecords. There is limited documentation on the types of errors that are typically encountered when doing this. General the easiest mods to manually merge are ones that are small or don't have complex record structures.

Manual merging involves four types of actions:

  • "Copy as Overide", as described on page 33-34 in the FNVEdit Training Manual, is used to copy a single record from a mod into a patch plugin. When there are conflicts this is used to get all the subrecords from a mod into a patch plugin, typically followed by manual editing of selected individual subrecords in the patch as described below. The FNVEdit Training Manual suggests that this is done after using a conflict filter; this is useful when a lot of mods are being edited at the same time but isn't needed when a patch is being created or edited for a few specific mods.
  • "Copy as Deep Overide" is used to simultaneously copy multiple records from a mod into a patch plugin. When there are conflicts this is used to get all the subrecords from multiple records of a mod into a patch plugin, typically followed by manual editing of selected individual subrecords in the patch as described below.
  • "Edit" an individual subrecord, as described briefly on the bottom of page 36 in the FNVEdit Training Manual, is used to change the value, text, or reference in a single subrecord in a plugin.
  • "Drag and Drop" editing of individual subrecords, as described on page 35-36 in the FNVEdit Training Manual, is used to copy the contents of a single subrecord from a mod into a patch plugin. When creating a patch this is often the most commonly used action type.

An Example of Using Copy as Override and Drag and Drop to Change a Subrecord for a Patch Plugin[edit | edit source]

Drag and Drop editing is commonly used in creating patches. An example for using this in creating a patch is a patch for to resolve a conflict between Acquisitive Soul Gems (ASG) and Animated Weapon Enchants (AWE). AWE changes the shader subrecord for the Soul Trap spell, while ASG changes many other subrecords. The steps used to create the patch are described below.

  • Open TES5Edit.
  • Select "Acquisitive Soul Gems.esp" and Animated Weapon Enhants.esp then click [OK].
  • Expand "Magic Effect" under Acquisitive Soul Gems.esp and select the "0005B452" node.
  • Right-click on Acquisitive Soul Gems.esp column and select "Copy as Override into...".
  • Select "<new file>" and click [OK]. In the resulting text box type "ASG-AWE Patch".

When you do this a new column appears on the right titled "ASG-AWE Patch". Scroll way down until you see the row heading "Enchant Shader" under "Magic Effect Data". If you look on that line you will see that three of the columns have "EnchPurpleFXShader" entries and one (AWE) has "wpnSoultrapFXS". You want to drag "wpnSoultrapFXS" entry from the AWE column to the entry on the same line in the column to the right ("ASG-AWE Patch"). When you do this it will replace the "EnchPurpleFXShader" entry with "wpnSoultrapFXS".

Patch Load Order[edit | edit source]

While potentially the patches created by these four methods could be merged, it is suggested that the plugins be kept separate to simplify maintenance (there will always be need to add new records and edit/remove old ones). Any merged plugins created should be loaded near where the original mod was loaded, as discussed in 1.3. The Merge Patch from 1.2 should be loaded prior to the bashed patch. Typically any manually created Patch Merge plugins from 1.4 are loaded either after the mods they reference or after the Merge Patch and before the bashed patch.

Issues in Changing FormIDs[edit | edit source]

Every different type of object in the game has an 8 digit hexadecimal number called a FormID, a unique identifier for that particular object type. As mentioned above, when merging some plugins the FormIDs for objects created by a mod (vs. the vanilla objects in the Skyrim.esm or Update.esm plugin or one of the DLC esm plugins) need to be changed. If the resulting merged mod includes all uses of these FormIDs, then there aren't any problems since the merging process changes all references to these FormIDs to use the new values. However, if there are other mods that reference one of these FormIDs that are not included in the merged plugin, there is a problem since those mods reference the old FormID value which is no longer exists. This is why the suggestion was made above to merge plugins from the same mod; this usually insures that all references to FormIDs created by the mod are included in the merged plugin. A merged plugin does not actually need to contain only plugins from the same nod, but for all the mods included in the new merged plugin all uses of any FormIDs created by these mods must be included in the merged plugin.

As mentioned above, this issue is also discussed in the "Q: My hair's gone?! My armor's gone?! My weapons are gone?! My face is gone?!?!WHAAATTTT?!!!?!" question in the FAQ for the Merge Plugins TES5Edit Script mod .

Many mods do not introduce new FormIDs in their plugins, and as long as there are no conflicts among these mods merging their plugins can be fairly straightforward (unless there are issues with merging scripts; this does not typically happen with mods that use small scripts).