Kingdom Come: Deliverance

File information

Last updated

Original upload

Created by

liyun1981

Uploaded by

liyun1981

Virus scan

Safe to use

Tags for this mod

About this mod

主要用于把多个Mod解包、修复冲突文件、重新整合打包,并且支持自定义Mod排序(适用于不能解决冲突的Mod)。
Mainly used to unpack multiple Mods, fix conflict files, recombine and package them, and support custom Mod sorting (for Mods that cannot resolve conflicts).

Permissions and credits
Changelogs
前言:
Preface:
几个月前在N网找了几个此游戏的Mod整合工具,找到3个下下来一试,2个启动报错,1个使用不方便还一堆BUG,因此,这几天有空闲自己做了这个 天国:拯救 Mod整合工具;自己用着舒心的同时也分享给水友们。
A few months ago, I found several Mod integration tools for this game on N. Net. Find 3 next down to try, 2 startup error, 1 inconvenient to use and a bunch of bugs. So, these days, I have spare time to do this KCD Mod integration tool, share it with my friends while I feel comfortable.


正题:
Subject:
一、此工具作用:
First. This utility function:
主要用于把多个Mod解包、修复冲突文件、重新整合打包,并且支持自定义Mod排序(适用于不能解决冲突的Mod)。
Mainly used to unpack multiple Mods, fix conflict files, recombine and package them, and support custom Mod sorting (for Mods that cannot resolve conflicts).

二、使用方法:
Two. Method of use:
1、部署好经典的文本文件合并工具 KDiff3 (大家可以自己网上下载一个最新版本也可以在我的百度网盘下载:https://pan.baidu.com/s/1aqxrCbG9qLFM-bpeGFxr3Q        密码:x4gx),解压文件到任意目录即可;
1. Deploy the classic text file merging tool KDiff3 (you can download a latest version of their own online also can be downloaded in my Baidu disk: https://pan.baidu.com/s/1aqxrCbG9qLFM-bpeGFxr3Q password: x4gx), unzip the file to any directory;

2、解压 game.7z 到任意目录,如:D:\tools ;
2. Decompress game.7z to any directory, such as: D:\tools;

3、以系统管理员身份打开命令提示符窗口,输入 cd /d D:\tools\game\bin ;再输入 kcd 会显示详细的命令行参数帮助信息。
3. Open the command prompt window as a system administrator, enter cd /d D:\tools\game\bin, and then enter KCD to display the detailed command line parameter help information.

参数说明:
Parameter Description:

kcd -lm|-lma|-lmu|-lc|-lca|-lcu|-ld|-lr|-mc|-mp|-mu|-mma|-mmf|-mmc|-mmo|-mmu regex src dest merge gamePath modPath mergePath mergeExecutablePath

-lm                     全量合并翻译文件,合并所有;包含原有的、新增的和更新的记录。The total volume of the merged translation files is merged, and the original, newly added and updated records are included.

-lma                    全量合并翻译文件,合并新增;包含原有的和新增的记录。The total volume of the merged translation files is merged and added; the original and newly added records are included.

-lmu                    全量合并翻译文件,合并更新;包含原有的和更新的记录。Full volume merge translation files, merge updates, include original and updated records.

-lc                     差量合并翻译文件,合并所有;包含新增的和更新的记录,不包含原有的记录。The difference merges the translated files and all of them; contains new and updated records, no original records.

-lca                    差量合并翻译文件,合并新增;包含新增的记录,不包含原有的记录。The merged files are merged and added, contains new records, no original records.

-lcu                    差量合并翻译文件,合并更新;包含更新的记录,不包含原有的记录。The merged files are merged and updated, contains updated records, no original records.

-ld                     调试翻译模式。Debugging translation mode.

-lr                     发布翻译模式。Publishing translation mode.

-mc                     创建Mod配置文件./kcd.xml。Create the Mod configuration file ./kcd.xml.

-mp                     先清空gamePath/Mods目录,再重新打包mergePath目录中文件到gamePath/Mods目录,并重新生成Mod排序文件mod_order.txt。First empty the gamePath/Mods directory, then repack the files in the mergePath directory to the gamePath/Mods directory, and regenerate the Mod sort file mod_order. txt.

-mu                     先清空modPath目录,再重新解包该目录中所有Mod。First empty the modPath directory and then unpack all the Mod in the directory.

-mmf                    重新整合modPath目录中所有Mod,并重新合并所有冲突文件(即多个Mod共有的同名文件)。Re-integrate all Mods in the modPath directory and re-merge all conflict files (i.e. multiple Mods with the same name).

-mma                    重新整合modPath目录中所有Mod,只重新合并变化了的冲突文件(即同名文件有更新、新增或删除)。Re-integrate all Mods in the modPath directory, merging only changed conflicting files (that is, files with the same name are updated, added, or deleted).

-mmc                    只合并Mod配置文件./kcd.xml中配置的所有冲突文件,不打包到gamePath/Mods目录。All conflicting files that are configured in the Mod configuration file ./kcd.xml are merged and not packaged into the gamePath/Mods directory.

-mmo                    根据Mod配置文件./kcd.xml中配置的Mod排序信息重新生成Mod排序文件mod_order.txt。Regenerate the Mod sorting file mod_order.txt according to the Mod sorting information configured in the Mod configuration file ./kcd.xml.

-mmu                    在mergePath目录中重新生成Mod配置文件./kcd.xml中配置的所有唯一文件(即非冲突文件),并更新这些文件的MD5码。Re-generate all the unique files configured in the Mod configuration file ./kcd.xml (that is, non-collision files) in the mergePath directory and update the MD5 code for these files.

regex                   文件名查询正则表达式,.匹配任意文件名。File name query regular expression, . match any file name.

src                     文件输入目录。File input directory.

dest                    文件输入或输出目录。File input or output directory.

merge                   文件整合目录。File integration directory.

gamePath                游戏目录。Game directory.

modPath                 Mod目录。Mod directory.

mergePath               Mod整合目录。Mod integration directory.

mergeExecutablePath     Mod整合工具KDiff3的可执行文件路径名。The executable file path name of Mod integration tool KDiff3.

合并翻译文件说明:先根据regex获得src和dest中匹配的所有文件,再将同名文件数据合并保存到merge中;全量合并与差量合并的区别是前者得到的合并文件是满足游戏 数据规范的文件(即可以直接作为Mod使用的文件),而后者得到的是中间文件,需要进行再编辑以满足游戏数据规范。

Merge translation file description: according to regex to get all the matching files in src and dest, and then merge the file data of the same name into merge; the difference between total merge and differential merge is that the merge file obtained by the former is a file that meets the specifications of game data (that is, can be used directly as Mod file), while the latter is obtained Intermediate files are needed, and need to be re edited to meet the game data specification.

单条命令:
Single command:
kcd -lm regex src dest merge
kcd -lma regex src dest merge
kcd -lmu regex src dest merge
kcd -lc regex src dest merge
kcd -lca regex src dest merge
kcd -lcu regex src dest merge
kcd -ld regex src dest
kcd -lr regex src dest
kcd -mc gamePath modPath mergePath mergeExecutablePath
kcd -mp
kcd -mu
kcd -mmf
kcd -mma
kcd -mmc
kcd -mmo
kcd -mmu

示例:
Examples:
kcd -lm (?i)\.xml$ F:/games/KingdomComeDeliverance/修改/Mods/UltimateRealismOverhaul/Localization/Chineses F:/games/KingdomComeDeliverance/修改/Game/Localization/Chineses F:/games/KingdomComeDeliverance/修改/Game/Localization/Chineses/merge

kcd -lc (?i)\.xml$ F:/games/KingdomComeDeliverance/修改/Mods/UltimateRealismOverhaul/Localization/Chineses F:/games/KingdomComeDeliverance/修改/Game/Localization/Chineses F:/games/KingdomComeDeliverance/修改/Game/Localization/Chineses/diff

kcd -ld (?i)\.xml$ F:/games/KingdomComeDeliverance/修改/Game/Localization/Chineses F:/games/KingdomComeDeliverance/修改/Game/Localization/Chineses/debug

kcd -lr (?i)\.xml$ F:/games/KingdomComeDeliverance/修改/Game/Localization/Chineses/debug F:/games/KingdomComeDeliverance/修改/Game/Localization/Chineses

kcd -mc F:/games/KingdomComeDeliverance F:/games/KingdomComeDeliverance/修改/Mods F:/games/KingdomComeDeliverance/修改/Merge F:/tools/KDiff3/kdiff3.exe


4、输入 kcd -mc 命令创建kcd命令的配置文件kcd.xml,或者直接新建kcd.xml文件再复制如下的模版内容:
4. Enter the kcd -mc command to create the configuration file kcd.xml for the KCD command, or create a new kcd.xml file directly and copy the following template contents:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<Kcd>
    <Config>
        <gamePath>F:/games/KingdomComeDeliverance</gamePath>
        <modPath>F:/games/KingdomComeDeliverance/修改/Mods</modPath>
        <mergePath>F:/games/KingdomComeDeliverance/修改/Merge</mergePath>
        <mergeExecutablePath>F:/tools/KDiff3/kdiff3.exe</mergeExecutablePath>
    </Config>
    <Mods/>
    <Merges/>
    <Conflicts/>
    <Uniques/>
</Kcd>

把gamePath修改为你游戏的主目录,modPath修改为你下载的Mod文件目录,mergePath修改为Mod文件整合目录,mergeExecutablePath修改为KDiff3的可执行文件路径名。
Modify gamePath to the home directory of your game, modPath to the Mod file directory you downloaded, mergePath to the Mod file consolidation directory, mergeExecutablePath to the executable file path name of KDiff3.

5、确保modPath目录可以访问,并且其中的Mod压缩文件都已经解压,该目录结构应该如下图:
5. Make sure the modPath directory is accessible and the Mod compressed files in it are unpacked. The directory structure should be as follows:



6、输入命令 kcd -mmf 进行一次全新的全Mod整合;如果存在冲突文件,则程序会自动调用kdiff3来整合文件,如下图:
6. Enter the command kcd -mmf for a completely new Mod consolidation; if there is a conflict file, the program will automatically call kdiff3 to consolidate the file, as shown below:





修改完后点击保存退出完成合并操作或者点不保存退出取消合并操作(适用于冲突的文件为非文本文件的情况)。
After modification, click Save Exit to complete the merge operation or click No Save Exit to cancel the merge operation.(Applies to cases where conflicting files are non-text files)

7、Mod整合命令执行完成后得到的目录结构应该如下图:
7. After the Mod integration command is executed, the directory structure obtained should be as follows:
Merge目录
Merge directory


游戏Mods目录
Game Mods directory


更新了的文件有:
The updated files are:
Mod排序文件mod_order.txt
Mod sort file mod_order.txt


kcd命令配置文件kcd.xml
KCD command configuration file kcd.xml
Mod路径配置
Mod path configuration


Mod排序列表
Mod sort list


整合文件列表
Integrated file list


冲突文件列表
Conflicting file list


唯一文件列表
Unique file list



8、修改kcd.xml文件中的Mod节点内order节点值为1的所有order节点,order取值范围为1~998,0为最高优先级(为Merge保留),999为最低优先级(表示该Mod不存在冲突文件或所有冲突文件已修复,将不会生成到Mod排序文件mod_order.txt);
8. Modify all order nodes with an order node value of 1 in the Mod node of the kcd.xml file, with order values ranging from 1 to 998, 0 as the highest priority (reserved for Merge), and 999 as the lowest priority (indicating that the Mod does not have a conflict file or all conflict files have been repaired, and will not be generated to the Mod sort file mod_order.txt);

9、输入命令 kcd -mmo 重新生成Mod排序文件mod_order.txt,至此,一次全新的全Mod整合操作全部完成,可以直接运行游戏测试效果!
9. Enter the command kcd -mmo to regenerate the Mod sorting file mod_order.txt.At this point, a new all Mod integration operation is completed, which can directly run the game test results.

10、如果modPath目录下任意Mod文件有更新、删除或新增,或者安装了新的Mod,可以输入命令 kcd -mma 完成一次全Mod增量整合操作;与kcd -mmf 的区别是该命令不会重新整合所有冲突文件,仅对发生了改变的冲突文件(即文件有新增、删除或修改)进行重新整合。
10. If any Mod file in the modPath directory is updated, deleted, or added, or a new Mod is installed, you can enter the command kcd -mma to complete a full Mod incremental integration operation; unlike kcd -mmf, this command does not re-integrate all conflict files, Only conflicting files that have changed (i.e. added, deleted or modified files) have been reintegrated.

调试翻译模式效果图如下:
The effect of debugging translation mode is as follows:



发布翻译模式效果图如下:
The effect of the publishing translation mode is as follows:





三、项目源代码
Three. Project source code
1、码云
1. code cloud
https://gitee.com/liyun_1981/game
2、github
https://github.com/legendaryhero1981/game