1. We have added a Gift Upgrades feature that allows you to gift an account upgrade to another member, just in time for the holiday season. You can see the gift option when going to the Account Upgrades screen, or on any user profile screen.
    Dismiss Notice

Merging Mods

Discussion in 'Civ6 - Creation & Customization' started by redneck_diver, Feb 28, 2020.

  1. redneck_diver

    redneck_diver Chieftain

    Joined:
    Feb 28, 2020
    Messages:
    10
    I've been working on a method to validate and merge mods with as much automation as possible. This also has the goal of making mods more friendly to Linux systems and people forgetting to put quotes around filenames. Wondering if anyone has already tackled this and I'm just reinventing the wheel as well as looking for some help on issues I've had. Here's the basic process that I've followed:

    1. Run dos2unix on all files. This probably isn't needed and may even cause issues with Windows and/or Mac, but I've ran into problems with other products when CRLF was used instead of just LF.
    2. Convert each mod to lower case. Replace spaces with underscores and remove apostrophes in both file and directory names.
    3. Replace all references to files with their new names. This covers all other mod files, not just modinfo.
    4. Run xmllint on all XML files and fix any issues found.
    5. Run all SQL against a clean copy of the cached DB file and fix any issues found.
    6. (TBD) Validate all modinfo files against LeeS' XSD.

    All the above is basically working. I end up having to manually fix a few issues, but it's not bad. Beyond here is where it gets a little tricky. To aid with resolving any conflicts, I've tried to convert all XML DB modifiers to SQL so I can compare all modifications in a common syntax. The script parses the XML files, converts them to SQL and then outputs a new SQL file for each table that is being modified. Then I manually modify the modinfo as needed to change out file references. This is working, but I ran into problems with IconManager:FindIconAtlas failing to look up icons after the changes. So I'm wondering if you must use XML for some types of DB modifications.

    This is already getting a bit long, so I'll stop here. Any feedback would be greatly appreciated.
     
  2. redneck_diver

    redneck_diver Chieftain

    Joined:
    Feb 28, 2020
    Messages:
    10
    I just found the answer to the icons issue in LeeS' modding guide. Need to put quotes around the Index column name. I think I'll just do that for all of them.
     

Share This Page