[English] Merging two mods & Install them via ModLauncher

  • In this HowTo I will show you how to merge two(2) or more mods and how to install them via ModLauncher. Some of you know how to merge mods together and some of you don't know that's why I decided to make this HowTo.


    Merging two mods & Install them via ModLauncher


    First you need to download and install(full installation) WinMerge.
    After you installed WinMerge you need two mods to work with (I take two of my mods 'Ancient Amulet' and 'Elixir of Power' for this example).



    Now I open the folders and go to DB folder and right click on BuildingUpgrades.dbt from both folders(Amulet and Elixir).


    Step ONE - Open the Ancient Amulet folder go to DB select a .dbt file in our case BuildingUpgrades.dbt.


    Step TWO - WinMerge opened the first file, now click Browse the second button and select from the Elixir of Power folder the folder DB and inside the DB folder select BuildingUpgrades.dbt.



    After you have done that click OK.


    Step THREE
    After WinMerge opens those two files for you to compare, scroll up and/or down to see the difference between those two files if you don't want to complicate yourself OR click directly on the small button 'Next Difference'(One green arrow with yellow and red under it) and the program will sent you directly on the first line who is next in the .dbt files (I will do it manually to simplify the thing for you). As you can see below the only difference between files are the bottom parts and I mean line number 6582 and from the other file, line number 6578.


    Step FOUR
    Select the line 6582 or 6578. I will select 6578 and after I selected the line, I right click on it and I click Copy option.



    Now I click on the other file right above the last line and I mean I will copy & paste the line number 6578 above line 6582(To make space for line 6578 click in front of line 6582 and press Enter and like that the line 6582 will go down a row to create a free space). 6578 and 6582 are the lines ID so make sure are unique.



    Step FIVE
    After you have completed the steps above you need to save the file and to be exactly in our case, here, in the AncientAmulet\DB\BuildingUpgrades.dbt !



    Now we check the file that we saved earlier in AncientAmulet\DB\BuildingUpgrades.dbt, to see if everything is okay. I will open the BuildingUpgrades.dbt with Notepad++ and I recommend this program for .dbt files but you can do it with a simple notepad or another text editor.



    Looks like everything in there is OK as you can see in the pictures above.


    Like above you will do for the rest of the .dbt files because if I take them one by one I write a 10 pages tutorial and you'll get bored... we try to avoid that.


    As you can see below we have some folders DB, gfx, savegames, Scripts, Textures and an extra three(3) files that ModLauncher demands(we get to these 3 files later).
    Now we take the Scripts folder and as you can see there are 2 other folders: City and Measures.



    City folder
    In the AncientAmulet\Scripts\City we have the file MarketPingHour.lua and in the ElixirOfPower\Scripts\City
    we have it to... now we need to compare the files MarketPingHour.lua from both folders to see what's the difference between them. We open them with WinMerge as above, you follow the steps above to open them both.



    Now I will copy & paste " "ElixirOfPower", " in the left panel, exactly after " "AncientUnknownAmulet", " , I select " "ElixirOfPower", ", right click on it then I press copy then I put my mouse cursor after "AncientUnknownAmulet", in the left panel, I hit SPACE to let a space between them and I right click and press paste. Save your work how I told you above and below is the result on how it should look after you copy and paste.



    Measures folder
    In Measures folder we have another folder called Artefacts in both Ancient Amulet and Elixir of Power folders. Luckily for us in Measures folder rarely you will see new files. Now, in Artefacts folder we have two(2) totally different files so we copy the as_UseElixirOfPower.lua file, from Elixir of Power\Scripts\Measures\Artefacts to Ancient Amulet\Scripts\Measures\Artefacts !



    Textures folder
    We can't compare the textures so we will copy everything from Elixir of Power\Textures in Ancient Amulet\Textures !
    Make sure that when you merge two(2) Textures folders there are no items with the same name otherwise the new ones will overwrite old ones.


    3 more files remaining for us: text.xml, description(HTML Doc) and data.xml !


    text.xml
    Usually the text files are very different from a mod to another so this will make it easy for you to merge them. In our case we will merge the text.xml from Elixir of Power folder with the text.xml from Ancient Amulet folder. I will merge them manually because this request maxim attention because if you mistake even a "<" the ModLauncher will give you error. I will open text.xml from Elixir Of Power folder with notepad++ and select everything except <textlist> and </textlist> and that mean the very first line and the very last line inside text.xml!



    Now I copy & paste the selected text(all except the first and the last line) inside the text.xml from Ancient Amulet folder. Copy it at the bottom above the list line ( </textlist> ).



    Where do you see those two free spaces between the text with ID 100080 and 100060 there the text from both text files try to merge. Why do I say try ?! because now for them to work together as one we need to give them unique ID's... I will delete the free space betwen lines and I start to give them unique ID's from 100000 to 100044.
    The <state>new</state> is for new lines and ours are new lines. To modify an existing line you need the line ID and the <state>changed</state> at the end of that line.


    First lines...


    Last lines...


    Now save your work and we go to the next file.


    description (HTML Doc)
    Here is our mod description what will appear in the ModLauncher window so if you want to play with it Open it with notepad++ and edit inside the file but don't touch the blue lines if you don't known what they are or what they do, just follow the example inside the file.


    data.xml
    Do one mistake, no matter how small it is and the ModLauncher will give you error. Follow me closely !


    Open data.xml with notepad++
    Complete the first three fields: author(does not matter what do you type), version(For Tg2Ren or else...), title (the title MUST have the same name as the mod folder have)
    We rename the folder with those two(2) mods merged to AncientAmuletAndElixirOfPower like this it will be easyer to understand for you (No space between word is recommended). See the photo below to understand !!!



    Now we go further inside the data.xml !
    Inside DB folder we have six(6) files: BuildingUpgrades.dbt, Filter.dbt, Impacts.dbt, Items.dbt, Measures.dbt and MeasureToObjects.dbt and we must declare them inside data.xml !



    Now let me explain something:
    <path> is very, very important for us so it must be like in the picture above because we renamed those two mods to give you a good example, to understand what I do here. After you finish the mod and copy it into mods inside your\The Guild 2 - Renaissance\mods, the ModLauncher will first check if the files you declared in data.xml are really there. If one is missing but if was declared in data.xml it then the ModLauncher will give you error.
    <state> it must be changed for our .dbt files !!! (Q)Why ?! (A)Because if we set it to <state>new</state> will overwrite the existing one when is installed and when you uninstall the mod the ModLauncher will have no original file to replace the one from the mod and the ModLauncher will let the one from the mod instead the original. This is leading to game errors. Conclusion: the <state> must be changed for our .dbt files.


    gfx folder - Is no need to declare it.
    savegames - Is no need to declare it.


    Scripts and Textures folders
    As you can see in the picture below our .lua files and the textures have <state>new</state> except one of them!
    Q - Why all of them have state = new and that single one have not ?
    A - Because the file MarketPingHour.lua is already existing in the game files and we don't want to loose it, we want to replace it and after you uninstall the mod replace it again with the original first one. The other .lua files and all the textures are new and them don't need to be replaced just placed inside the game files.



    Now we save our work and we copy & paste our new mod inside \The Guild 2 - Renaissance\mods. Open The Guild 2 - Mod Launcher.exe and go to Manage Modifications, select AncientAmuletAndElixirOfPower and click Apply.
    When you install the mod you will get an error with "Error while moving savegames" you don't have save games in your mod savegames folder so ignore it because nothing happens. Something about the savegames will say when you uninstall as well if you don't have an auto-save or save or both file in your mod savegames folder if I remember well so ignore it because nothing happens.



    When your mod will be displayed at "Current Game State: YourMod" then you are ready to go(Like in the picture above).


    I apologize if I made one or more mistakes above, I write this HowTo with no stop so feel free to correct me.


    If you encounter difficulties, please post them here and I or someone else will surely respond.


    This HowTo was created for those who want to merge two or more mods together but don't know how !


    Enjoy!!!

    [center]RO: Am jefuit boieri cu toptanul pana am ajuns in top ten.
    EN: I robbed landowners wholesale, until I reached the top ten.
    [/center]

    6 Mal editiert, zuletzt von Nekuratu ()