Save game compatibility is the ability to load a save file created with version N of vanilla and a mod with the version N+1 of vanilla or that mod, and continue playing without issues.
Keeping save compatibility
Generally entities cannot be removed or renamed (except if doing some save conversion):
- Removing a culture would result in characters with that culture in the save file getting noculture culture upon loading the save.
In addition you need to be careful about:
- Adding any traits, since they are not stored by their name in the saves, but the numeric index in which they were loaded at the time. So if a trait is added in vanilla at the last index, it will show up for characters that had the trait with first index in the mod - and all traits will be wrong by 1 index.
- Adding a new title set to be inactive at game start through a history file (
active = no
), as it will remain active when loading from a save file. - Changing the potentials of buildings: building from the save will still be present in the holding when potential doesn't match, but would not appear on the building list.
- Adding new laws: the "default" law will not get determined when loading from a save, so player may not be able to select any law in that group depending on how the conditions are written.
When new counties are added on the map, and loading a save with missing title holder, a random nearby ruler should get the title. However vanilla map extensions have been known to break save compatibility in the past.
Automatic save conversion
As of patch 2.7.1, a new folder common/save_conversion/ allows to apply automatic migration of some entity names when loading a save.
The syntax is:
<entity_type> = { <old_name> = <new_name> }
The supported entities are:
- Religions:
religions = { bektashi = hurufi }
- Societies:
societies = { secret_religious_society_buddhism = secret_religious_society_buddhist secret_religious_society_hinduism = secret_religious_society_hindu }
Manual save conversion
For some changes, it is possible to create an on_startup
event that does some conversion via scripting:
- changing a modifier or flag into another one, or removing them.
- removing traits, ...
Compared to the automatic save conversion, it requires old entity definitions to still be present in the mod (even if not used in the new version), in order to be usable via scripting.
历史 | 角色 • 家族 • 省份 • 头衔 • 剧本 |
脚本 | 指令 • 条件 • 作用域 • 修正 • 事件 • 决议 |
常规 | 定义 • 游戏规则 • 另类开局 • 宗教 • 文化 • 政体 • 特质 • 血脉 • 科技 • 法律 • 建筑 • 宣战理由 • 朝贡国 • 单位 • 目标 • 疾病 • 死亡 • 荣誉头衔 • 社团 • 宝物 • 地图外政权 • 内阁成员 • 贸易路线 • 继承 • 奇观 • 称号 |
图像/音效/本地化 | 地图 • 图形 • 盾徽 • 肖像 • 界面 • 小地图 • 音乐 • 本地化 |
其他 | 故障排除 • 验证器 • 控制台指令 • 编辑游戏存档 • Steam创意工坊 • EU4转档器模组制作 |