Merging mods

From Mod Wiki

Jump to: navigation, search

Most of the mods for S.T.A.L.K.E.R. games are not compatible with each other i.e. they contain the same files that need to be overwritten during installation. Copying/replacing one mod on top of the other usually leads to game crashes during load or starting new game.

This tutorial will show you how to merge 2 mods properly. In this case I will merge 2 mods for Call of Pripyat: Alundaio's Various AI v1.06 (called later AVAI) with AtmosFear 2 (called later AF2)

To complete this tutorial you will need WinMerge (http://winmerge.org/)

Contents

Preinstallation


Install/unpack both mods to separate folders in temporary forder (e.g. E:\Temp) In this case we have E:\Temp\Various AI modules Alpha 1.06 and E:\Temp\AtmosFear 2.

Common files


We need to check which files are common to both mods so we can merge those files together.

Run WinMerge and click Open (CTRL+O). Browse for AVAI gamedata folder as 'Left' and AF2 gamedata folder as 'Right' Check 'Include subfolders' and click OK.

Image:Merging_mods_select_dirs.gif


In Menu > View uncheck everything except 'Show Different Items'

Image:Merging_mods_select_different_items.gif


As you see on the screenshot below we have 2 conflicting files to merge: configs\system.ltx and configs\misc\sound_script.ltx

Image:Merging_mods_different_files.gif

Creating patches


We will create patch files for those 2 conflicting config files.

General rules are that you need to copy everything that is missing from one file to another and/or replace existing lines.


Double click system.ltx file.

Image:Merging_mods_merge_files.gif

In 'Location Pane' you can see which lines are different in both files. As you can see there are not many differences. They are in [sound] section, then in comments which we can skip and in [hud_sound] section. We need to copy values of [sound] and [hud_sound] sections from AF2 to AVAI.

Navigate to first marked difference, select 3 lines from [sound] section in right pane and click 'Copy Left'. Now navigate to [hud_sound] section and repeat this on 2 difference lines from that section. You can notice that there are additional lines at the end of AVAI file that are missing of AF2 file (e.g. 2 #include lines). Leave them as they are (do not delete them)


We have created the 1st patch file. Select Menu > File > Save Left > Save as… Create new folder in Temp dir e.g. E:\Temp\AVAI+AF2 and save file to exactly the same location e.g. E:\Temp\AVAI+AF2\gamedata\configs\system.ltx. Close the system.ltx file comparison window (click 'Discard all' in the popup)


Now do the same for script_sound.ltx file. In this case you can notice that in the first difference line of AVAI file starting with [list] there is additional fragment (', rx_list_script_sound') at the end. Do not replace this line as the first rule says that we need to add everything is missing. Copy everything else what's different/missing from AF2 file to AVAI file (blowout_particle_wave_looped list entry, paths in sound definitions, blowout_particle_wave_looped sound definition) Save left file as E:\Temp\AVAI+AF2\gamedata\configs\misc\script_sound.ltx

Installation


Now it is the time to install our merged mods. Install them by copying the gamedata folders from Temp dir to your S.T.A.L.K.E.R. directory. First AVAI, then AF2. Don't worry of overwriting the existing files. We've created the patches for them. Now copy patch folder (E:\Temp\AVAI+AF2\gamedata) to your S.T.A.L.K.E.R. directory (again overwriting the files) Launch the new game (if any of the merged mods readme says to do so) and enjoy your first merged mods.

Notes


Described method is not always possible. Especially when mods contain the different versions of the binary files (e.g. particles.xr).

Another thing is to choose which mod should be merged on top of the other. In this case more lines were missing in AF2 configs so I've decided to merge AF2 to AVAI. But it will work the other way.

The more files to merge the more difficult the merging process is so sometimes it is virtually impossible to merge them.

Cromm Cruac

Personal tools