修改文明6存档--从存档中删除mod

由于在steam上玩文明6,产生的文明6存档中包括了影响多平台玩的mod Removable Districts,所以现在目标是要把这个mod从存档中去掉,然后再保存至多平台存档中,以便我的switch能使用这个存档记录继续play。下面请看我操作。

1. 从github上下载代码 https://github.com/pydt/civ6-save-parser/tree/master

2. 本地电脑安装node

3. 进入到代码目录civ6-save-parser 分别安装依赖:

npm install mocha -g

npm i buffer-v6-polyfill

4. 从电脑中找到文明6的存档记录,目录在C:\Users\{你的用户名}\Documents\My Games\Sid Meier's Civilization VI\Saves\Single,这里我拿了AutoSave_0253.Civ6Save文件

5. cd civ6-save-parser进入到目录civ6-save-parser 中,在此路径下打开终端 

6. 运行命令: node index.js AutoSave_0253.Civ6Save > ~/253.json  

7. 用文本编辑器打开253.json 全局搜索 Removable Districts

 记录下上面的MOD_ID,也就是 7ce74c28-41ba-4453-b3d1-d30ef8013887

8. 修改test/modifyCiv.js 内代码,加入如下代码

describe('Modify AutoSave_0253', function() {
  const buffer = new Buffer(fs.readFileSync('/Users/margo/Desktop/civ6-save-parser-master/AutoSave_0253.Civ6Save'));
  // const data = civ6.parse(buffer);

  it('remove mod Removable Districts', () => {
    const modid = '7ce74c28-41ba-4453-b3d1-d30ef8013887';
    // const modname = 'Removable Districts';
    const saveWithoutMod = civ6.deleteMod(buffer, modid);
    fs.writeFileSync('test/saves/AutoSave_0253.Civ6Save_modified.Civ6Save', Buffer.concat(saveWithoutMod.chunks));
  });
});

如下图

 9. 保存modifyCiv.js修改,cd civ6-save-parser进入到目录civ6-save-parser 中,在终端内输入命令: npm test,稍等程序运行结束,就可以在test/saves目录下找到产生的新存档文件AutoSave_0204_modified.civ6Save

 

10. 将新存档文件AutoSave_0204_modified.civ6Save 修改一下文件名,和游戏原来的存档名一样,最后替换原来的存档,重新打开游戏即可看到效果

我的修改前

 修改后

 

posted @ 2024-05-31 15:52  margo  阅读(111)  评论(0编辑  收藏  举报