This guide describes the steps to retrofit the changes from a vanilla patch, for a mod that modifies some vanilla files.
It is best to avoid copying and modifying vanilla files inside a mod (by loading from folders), but sometimes this is unavoidable.
If you do, there is some extra work needed for every vanilla patch, to merge changes with your own, and make the mod compatible with the new patch:
'Base' file (vanilla version N) ----------------> 'Destination' file (vanilla version N+1)
| New patch |
| Copied and modified | Propagating vanilla changes
| |
v v
'Source' file (mod version N) ----------------> 'Result' file (mod version N+1)
Keeping mod changes
Ideally you should use a 3-way merge tool, with 3-way folder merging capability:
Some 3-way merge tools:
Note that WinMerge doesn't support 3-way merge, only 2-way diff.
3-way merge is composed of 4 windows:
For simplicity, it's common to have source and result work on same files, but make sure the old version of the mod is backed-up in case you need to re-start the merge for any reason.
| 这是一篇小作品。你可以通过编辑或修订扩充其内容。 如果可以请尽你所能的去协助完善这篇文章。 |
For instance if removing religious CB in 00_cb_types, keeping the following in the mod will help future merges:
# Regular Holy War CB
#religious = {
#
# can_use_gui = {
#
# }
#
# can_use = {
#
# }
#
# can_use_title = {
#
# }
#
# is_valid = {
#
# }
#
# is_valid_title = {
#
# }
#
# on_add = {
#
# }
#
# on_success_title = {
#
# }
#
# on_fail = {
#
# }
#
# on_reverse_demand = {
#
# }
#
# attacker_ai_victory_worth = {
#
# }
#
# attacker_ai_defeat_worth = {
#
# }
#
# defender_ai_victory_worth = {
#
# }
#
# defender_ai_defeat_worth = {
#
# }
#}