Detects conflicts between mods & helps you resolve them, either by creating merged files that override the conflicting ones, or by configuring a custom load order for your mods. Merges are easy to undo because they don't change the original mod or game files. Depending on your mods, some merges may require basic understanding of code.
Requirements
This mod does not have any known dependencies other than the base game.
Other user's assetsAll the assets in this file belong to the author, or are from free-to-use modder's resources
Upload permissionYou can upload this file to other sites but you must credit me as the creator of the file
Modification permissionYou must get permission from me before you are allowed to modify my files to improve it
Conversion permissionYou can convert this file to work with other games as long as you credit me as the creator of the file
Asset use permissionYou must get permission from me before you are allowed to use any of the assets in this file
Asset use permission in mods/files that are being soldYou are not allowed to use assets from this file in any mods/files that are being sold, for money, on Steam Workshop or other platforms
Asset use permission in mods/files that earn donation pointsYou must get permission to earn Donation Points for your mods if they use my assets
Author notes
This author has not provided any additional notes regarding file permissions
File credits
This author has not credited anyone else in this file
Donation Points system
This mod is opted-in to receive Donation Points
Changelogs
Version 0.6.5
- Fixed an issue where the merged mod folder was not being removed from the mods folder when all merges were removed. - Initial detection of arguments (This is not properly used yet anywhere but it's some ground work) including detection of when Vortex is starting up the merger. - Fixed an issue where Script merger would crash if the user had moved his W3 game dir.
Version 0.6.2
- Added detection of updated merge source files & basic prompt to delete affected merge. - Added more mods.settings file validation. - Re-added runtime info to config file. Hopefully avoids TypeLoadException at launch. - Fixed: False "missing file" error after successful bundle merge of 3+ mods. - Fixed: "Dependency Locations" menu item stopped working in 0.6.1. - Fixed: Crash when trying to open relative file paths. - Fixed: Disabled mods still had checkboxes in some situations.
Version 0.6.1
- Added File menu with options to open certain files/folders, repack merged bundle, or exit & launch the game. - Refined status bar aesthetics. - Refined "Set Priority" prompt functionality. - Removed checkboxes from disabled mods - Added prompt to delete merges that include disabled mods. - Added taskbar progress bar (Windows Vista or newer). - Added tooltips to context menu. - Hid "Select/Expand All" context menu items when a node is right-clicked. - Disabling an unprioritized mod gives it priority 9999, instead of your order's lowest priority + 1. - Added expected path to missing file dialog for troubleshooting. - Fixed: Option to collapse conflicts resolved by load order really collapsed all conflicts. - Fixed: "Open Vanilla" context items were shown when the vanilla file didn't exist. - Fixed: Wrong text color upon right-clicking a node, then clicking a checkbox.
Version 0.6.0
- Improved handling of custom load order: . . . Added mod context menu items to set priority, enable/disable, & remove from load order. . . . Conflicts that are resolved by your custom load order are purple. . . . Mods that are overridden by your custom load order are gray. . . . Mods that are disabled in your custom load order are italicized. . . . Added option to auto-collapse conflicts that are resolved by custom load order. . . . Added option to disable validation of custom load order. . . . Corrected min & max priority constraints according to CDPR's documentation. . . . Removed option & suggestion to disable custom load order. . . . Fixed: Load order validation crashed when mods.settings file was empty. - Added F5 hotkey to refresh conflicts. - Renamed "unsupported" to "not mergeable". - Possible fix for misaligned icons in the merge report.
Version 0.5.11
Hotfixed: Custom load order modification was super broken (crashed when mod0000_MergedFiles wasn't already in the order, reassigned existing priorities incorrectly).
Version 0.5.10
Hotfixed: Bundled XML files were interpreted as flat XML files.
Version 0.5.9
- Added support for non-bundled XML files. - Added intervention when custom load order (mods.settings file) doesn't load merged files first. - Renamed ScriptsDirectory setting to VanillaScriptsDirectory, because some users misunderstood. - Moved "Witcher 3 Directory" textbox to top of UI. - Added plus sign, arrow, & text colors to merge report for extra clarity. - Added tooltips to Options menu items. - Added error message for missing config file. - Fixed: Incorrect progress numbers when merge involved multiple game files. - Fixed: Empty conflict category remained on refresh after resolving conflict outside of Script Merger. - Possible fix for bug where tempbundlecontent directory didn't exist, causing QuickBMS to invisibly prompt for confirmation.
Version 0.5.8
- Added support for bundled CSV & TXT files. - Added completion sound after merging or packing (new setting in Options menu & config file). - Merge progress message shows "conflict X of Y, file N of M" when applicable. - Removed recommendation to copy scripts from wcc_lite, because they're outdated. - Fixed: Context menu items for deleting merges didn't do anything.
Version 0.5.7
- KDiff3 now follows symlinks, to support Nexus Mod Manager's multi-HD install mode. - Script Merger jumps in front of other windows when a dialog opens (e.g. merge report). - Made the wording of a few UI messages a bit clearer. - Fixed: Context menu was broken by the v0.5.6 fix for tree background colors. - Fixed: Refresh got stuck when no mods were found. - Fixed: Empty Merged Bundle Content folders were left behind after canceling merge.
Version 0.5.6
- Added more status bar text (how many scripts & bundles were found in how many mod folders). - Fixed: After right-clicking a Conflicts or Merges tree item, its background color stopped changing properly.
Version 0.5.5
- Auto-detect game directory if user accidentally selects Mods folder instead. - Reworded "Merge X Selected Files" button to "Create X Selected Merges", to clarify that existing files aren't affected when creating a merge. - Fixed: Mod names in UI were sorted with underscores after numbers & letters, but should have been BETWEEN numbers & letters. This also affected checking if the configured MergedModName will load first after a merge. - Fixed: "Loading..." stuck in the status bar on first launch, even after the program became idle.
Version 0.5.4
- Updated wcc_lite to latest version (1.1). - KDiff3 always uses Windows-style line endings, to avoid "line ending conflict" errors. - Status bar text suits different contexts better.
Version 0.5.3
- Fixed: Script merge for 3+ mods created duplicates in merge tree. - Fixed: Aborting merge didn't work, broke pretty badly.
Version 0.5.2
- Grouped both trees into categories. Scripts, XML, & unsupported files are clearly separated. - Added +/- boxes for expanding/collapsing tree nodes. - For clarity, reworded "solvable" & "unsolvable" to "mergeable" & "unsupported". - Paths in Dependency Locations dialog are green if valid, red if invalid. - Fixed: Bundle merge of 3+ mods failed after 1st merge (referenced bundle instead of content & vice versa). - Fixed: Bundles weren't updated if merged bundle didn't change when Refresh was clicked. - Fixed: Progress panel didn't show while refreshing at launch after pruning merge with missing file(s). - Fixed: Ignoring mod names didn't work because mod folder names weren't correctly retrieved from full paths.
Version 0.5.1
Fixed: XML files disappeared from Conflicts after merging/unmerging script(s).
Version 0.5
- Can merge XML files in .bundle packages, using QuickBMS, KDiff3, & wcc_lite. - Can detect (but not merge) conflicts in non-XML bundle content. - Detects conflicts with no corresponding vanilla version & lets you do manual 2-way merge. - Progress bar while detecting conflicts & merging. - Options menu & status bar. - Changed merged mod name to mod0000_MergedFiles, since TW3 actually seems to load in ASCII order, not just alphabetically (thanks to wghost81 for the tip). - Adjusted conflict detection to account for ASCII load order. - "Dependency" dialog to locate missing KDiff3, QuickBMS, or wcc_lite. - KDiff3 shows "Vanilla", "modName1", "modName2" instead of paths (option to disable). - Disabled KDiff3's .orig backup files. - In tree views, Ctrl+D deselects all. - Merge/delete buttons show # of selected files. - Added a few settings. - Removed modBaseScripts from default ignore list, as it can break load order (better to call it modZZZZ_BaseScripts). - Fixed: More case-sensitivity. - Fixed: Launch failure dialog didn't actually exit the app.
Version 0.4.3
- Added context menu item: Delete This Merge. - Added context menu item: Delete All modClickedMod Merges. (Useful when uninstalling/updating a particular mod!) - Fixed excessive context menu width. - Clicking a mod in the Merged Scripts list selects its corresponding script. - Added workaround instructions to error message for missing Scripts directory. - Added error messages for empty Mods directory.
Version 0.4.2
- Removed merged mod name field (but retained config setting & validation). - Merged mod name allows underscores & now defaults to "mod__MergedScripts". - In the Merged Script panel, Delete key triggers the "Delete Selected Merge" button. - Fixed: Merged Script was added to list even if all merges were canceled.
Version 0.4.1
- Removed backups. Now leaves mod files in place & considers alphabetical load order when checking for conflicts. - Only checks for conflicts in folders that start with "mod", because TW3 ignores other folder names. - Merged mod name has max length of 64, because TW3 ignores longer names. - Warning if merged mod name will load after the original mods. - Selecting your Witcher 3 directory refreshes Conflicts & Merged Scripts. - Asks to remove missing files from Merged Scripts list. - Option to disable the post-merge report. - Inapplicable context menu items are hidden (expand/collapse all, select/deselect all). - In MergeInventory.xml, renamed ModBackup to IncludedMod. - Fixed: Could open context menu on empty tree. - Fixed: Lost alt-key shortcuts on buttons.
Version 0.4
- Completely replaced Google text-merging with the powerful external merge tool KDiff3. - "Merged Scripts" list with unmerging capability. (Deletes merged script file, restores backups.) - Check for conflicts at launch & backup after merge are no longer optional. - Added "AAAAAA" to default merged scripts directory (because TW3 loads in alphabetical order). - Set wolf as .exe icon. - Fixed: Clicking & dragging out of tree made it stop updating. - Fixed: Directory deletion failed if a directory contained subdirectories but no files.
Version 0.3.3
- Improved post-merge report with buttons to open files/folders, move to backup, & undo move. - Moved backup path field & auto-backup checkbox to post-merge report. - Added dialog to manually overwrite/rename backup file if it already exists. - Moved checkbox for line-break symbols to Resolve Conflict screen. - Ctrl+A "select all" shortcut in text fields & tree. - The Enter key presses the merge button.
Version 0.3.2
- New checkbox to ignore whitespace-only changes while merging. - New config option to ignore certain mod folders (separated by commas). - Can select nodes for multiple scripts at once. - Added Select/Deselect All context menu items (and separators). - Right-clicked node is highlighted while context menu is open. - Non-directory fields only save on exit. - Added descriptions of settings in config file. - Fixed: Failed to merge change A into change B if A's left side overlapped B's right side. - Fixed: Didn't detect some conflicts, due to case-sensitivity while finding vanilla file. - Fixed: Settings failed to save if you had modified the config file after launch.
Version 0.3.1
- Fixed auto-merge bugs. - Saves window state only on exit, instead of every time it changes. - Waits till the form is showing to auto-check for conflicts at launch. - Fixed: 2 checkboxes had the same alt-key shortcut.
Version 0.3
- Remembers window position, size, & maximize state. - Auto-merges Google patches that overlap only in their equalities (no real conflict). - Resolve Conflict: Column scrollbars are synced & resizable. - Resolve Conflict: Inserted text is highlighted green. Deleted text is red with strikethrough. - Resolve Conflict: New option to show line break symbols. - Shows warning message if the merged mod name isn't alphanumeric & will therefore be ignored by the game. - Can optionally specify Mods directory and/or Scripts directory in the config file, instead of finding them based on game directory. - Mod names are black instead of red. - Fixed: File path comparisons were case-sensitive. - Fixed: Selected mods that were removed from the list by clicking "check for conflicts" were still considered selected.
Version 0.2.0
- New screen to resolve conflict between overlapping changes. - Optional backup functionality. - Option to check for conflicts at launch.
Version 0.1.2
- Fixed crash when scripts were found outside \content\scripts. - Added wolf icon.
Version 0.1.1
- Replaced a couple crashes with error dialogs. - Fixed merge button being clickable at launch. - Added version number to executable & window title.
When you have multiple mods that modify the same game file, TW3 only loads 1 of the modded versions of that file, overriding all over versions. This kind of conflict is common & can break mods. Script Merger tries to make the problem less painful.
What It Does
Despite the name, Script Merger detects mod conflicts in .bundle packages as well as .ws scripts. Then, it helps you resolve them by creating merged versions of conflicting text files. It leaves the original files untouched, but overrides them. It can't merge non-text conflicts, but for these it can help you manage your custom load order (mods.settings file) to make certain mods override others.
Uses these 3rd-party external tools: - KDiff3 by Joachim Eibl, for merging text files. - QuickBMS by Luigi Auriemma, for scanning & unpacking .bundle files. - wcc_lite by CD Projekt RED, for packing merged text files into .bundle files.
Also contains code from xxHash.NET by Wilhelm Liao, to detect when mod updates have changed files that you merged.
NOTES
When merging, KDiff3 simply does a text merge. In many cases, that works fine. But because the tool doesn't actually understand the code, sometimes it can merge things in the wrong order. Auto-resolved conflicts aren't guaranteed to be correct. In these cases, it needs human help.
Also, script mods can have logic conflicts that the tool can't detect. In these cases, even if the text can merge without direct conflicts, the resulting script won't work properly. For example, if Mod A tries to hide the HUD, but then Mod B displays the HUD, Mod A won't work. Resolving this also requires human help.
NMM users: Currently, Script Merger doesn't support NMM's multi-HD mode (or symlinks in general).
Instructions
1) Download, extract, & launch Script Merger.
2) Enter your game's installation path in the textbox at the top.
3) Click "Refresh" button above the "Conflicts" list.
4) If mergeable conflicts are detected, repeat these steps until the conflicts are resolved: > Choose 2 or more versions of any file(s) to merge. > Click "Create Selected Merge" button. > If the mods have differences that don't overlap, KDiff3 can merge them automatically. > If the mods have differences that overlap, KDiff3 will appear so you can merge them manually. See below for tutorial videos. > If Script Merger can't find the vanilla version of the modded file, you must merge all differences manually when KDiff3 appears.
5) If non-text conflicts are detected, Script Merger displays them but can't merge them. So, one of the mods in each conflict will "win" & override the others. Here's how the winner is decided: > By default, the game loads mods in order of folder names — numbers first, then underscores, then letters (not case-sensitive). > Or, you can right-click one of the mods to set its priority (1 to 9999, lower number loads first). Here's an excellent detailed explanation by Kad_Venku.
6) Play!
7) When you uninstall or update one of the mods included in a merge, Script Merger will detect the change & prompt you to delete affected merges. If you update a mod & Script Merger doesn't prompt you delete any of that mod's merges, then they weren't affected by the update.
Tutorial Videos
General Usage (thanks to Gopher & wghost81) Note: Gopher's tutorial, though quite helpful overall, says to edit the Script Merger config file manually. Typically, this is unnecessary & increases the chance of misconfiguration.
Using KDiff3 This video shows a couple KDiff3 basics. This video goes a bit more in-depth.
Example Scenario
If we successfully merge all 3 versions of r4Player.ws, then Script Merger will put the merged script here by default: The new mod folder starts with "0000_" to ensure that it loads before any other mod folder. (TW3 loads in ASCII order.) Because the merged version of r4Player.ws loads first, the non-merged versions will simply be ignored by the game.
Uninstallation
To undo all merges & return your mods to their original state, delete the merged mod folder (mod0000_MergedFiles in v0.5, mod__MergedScripts in v0.4.3).
To completely remove Script Merger from your computer, delete the files that were in the .zip file you downloaded, as well as the generated MergeInventory.xml file if you have it.