[MINI MOD] Improved Independence CB
Here are two versions of the independence cb that I think work better than vanilla. Both are compatible with 1.04c. Please feel free to incorporate this into any other mods.
Since most people who will be interested in this mini-mod will probably be combining it with another mod, I've just posted the code for each version of the cb. To use them, just overwrite the vanilla bid_for_independence cb.
1. No Free Revoke Title on White Peace
The first version simply removes the traitor modifier after a white peace. This means that the liege does not get a free revoke title unless he enforces demands in the war. So, the three possible outcomes for the war are:
2. Independence on White Peace if Liege is not De Jure
The second version includes the first, but it also checks if the war is between a vassal and his de jure liege or not. If it is, then a white peace works normally (i.e. the vassal is no longer independent). If however, the vassal is rebelling against a merely de facto liege, then a white peace gives the vassal independence. This makes having a de facto title over your vassals more important, and encourages the break-up of non de jure blobs.
With this version of the cb, the six possible outcomes for a war are:
EDIT: added a claim on vassal titles lost via white peace for defacto lieges.
Here are two versions of the independence cb that I think work better than vanilla. Both are compatible with 1.04c. Please feel free to incorporate this into any other mods.
Since most people who will be interested in this mini-mod will probably be combining it with another mod, I've just posted the code for each version of the cb. To use them, just overwrite the vanilla bid_for_independence cb.
1. No Free Revoke Title on White Peace
The first version simply removes the traitor modifier after a white peace. This means that the liege does not get a free revoke title unless he enforces demands in the war. So, the three possible outcomes for the war are:
- Vassal Wins: The vassal becomes independent; the liege loses prestige/crown authority.
- White Peace: The vassal does not become independent and loses prestige.
- Liege Wins: The vassal does not become independent, loses prestige, and is imprisoned; the liege gets free revoke title on the vassal.
Code:
bid_for_independence = {
name = CB_NAME_INDEPENDENCE
war_name = WAR_NAME_INDEPENDENCE
sprite = 12
truce_days = 2190
is_permanent = yes
is_independence = yes
can_use = {
ROOT = {
de_facto_liege = FROM
}
FROM = {
NOT = {
any_war = {
attacker = {
character = FROM
}
OR = {
using_cb = bid_for_independence
using_cb = depose_liege
}
}
}
}
}
is_valid = {
ROOT = {
OR = {
liege = {
character = PREV # either independent
}
liege = {
FROM = {
is_liege_or_above = PREV # or have shared liege
}
}
}
}
FROM = {
higher_tier_than = ROOT
}
}
on_success = {
if = {
limit = {
FROM = {
independent = no
}
}
FROM = {
liege = {
ROOT = {
set_defacto_liege = PREV
}
}
}
}
if = {
limit = {
FROM = {
independent = yes
}
}
ROOT = {
set_defacto_liege = ROOT
}
}
ROOT = {
prestige = 200
primary_title = {
add_pressed_claim = FROM
}
}
FROM = {
any_demesne_title = { # All titles
limit = {
OR = {
tier = king
tier = emperor
}
is_titular = no
NOT = { has_law = centralization_0 }
}
if = {
limit = { has_law = centralization_1 }
add_law = centralization_0
}
if = {
limit = { has_law = centralization_2 }
add_law = centralization_1
}
if = {
limit = { has_law = centralization_3 }
add_law = centralization_2
}
if = {
limit = { has_law = centralization_4 }
add_law = centralization_3
}
}
}
}
on_fail = {
ROOT = {
prestige = -100
}
FROM = {
remove_opinion = {
modifier = opinion_traitor
who = ROOT
}
}
}
on_reverse_demand = {
ROOT = {
prestige = -200
prisoner = FROM
}
}
on_attacker_leader_death = {
any_defender = {
letter_event = {
id = 251
}
}
end_war = invalid
}
attacker_ai_victory_worth = {
factor = -1 # always accept
}
attacker_ai_defeat_worth = {
factor = 150
}
defender_ai_victory_worth = {
factor = -1 # always accept
}
defender_ai_defeat_worth = {
factor = 100
}
}
The second version includes the first, but it also checks if the war is between a vassal and his de jure liege or not. If it is, then a white peace works normally (i.e. the vassal is no longer independent). If however, the vassal is rebelling against a merely de facto liege, then a white peace gives the vassal independence. This makes having a de facto title over your vassals more important, and encourages the break-up of non de jure blobs.
With this version of the cb, the six possible outcomes for a war are:
- Vassal Wins vs De Jure Liege: The vassal becomes independent; the liege loses prestige/crown authority and gets a claim on the vassal's primary title.
- White Peace vs De Jure Liege: The vassal does not become independent and loses prestige.
- De Jure Liege Wins: The vassal does not become independent, loses prestige, and is imprisoned; the liege gets free revoke title on the vassal.
- Vassal Wins vs De Facto Liege: The vassal becomes independent; the liege loses prestige/crown authority and gets a claim on the vassal's primary title.
- White Peace vs De Facto Liege: The vassal becomes independent but loses prestige; liege gets a claim on the vassal's primary title.
- De Facto Liege Wins: The vassal does not become independent, loses prestige, and is imprisoned; the liege gets free revoke title on the vassal.
Code:
bid_for_independence = {
name = CB_NAME_INDEPENDENCE
war_name = WAR_NAME_INDEPENDENCE
sprite = 12
truce_days = 2190
is_permanent = yes
is_independence = yes
can_use = {
ROOT = {
de_facto_liege = FROM
}
FROM = {
NOT = {
any_war = {
attacker = {
character = FROM
}
OR = {
using_cb = bid_for_independence
using_cb = depose_liege
}
}
}
}
}
is_valid = {
ROOT = {
OR = {
liege = {
character = PREV # either independent
}
liege = {
FROM = {
is_liege_or_above = PREV # or have shared liege
}
}
}
}
FROM = {
higher_tier_than = ROOT
}
}
on_success = {
if = {
limit = {
FROM = {
independent = no
}
}
FROM = {
liege = {
ROOT = {
set_defacto_liege = PREV
}
}
}
}
if = {
limit = {
FROM = {
independent = yes
}
}
ROOT = {
set_defacto_liege = ROOT
}
}
ROOT = {
prestige = 200
primary_title = {
add_pressed_claim = FROM
}
}
FROM = {
any_demesne_title = { # All titles
limit = {
OR = {
tier = king
tier = emperor
}
is_titular = no
NOT = { has_law = centralization_0 }
}
if = {
limit = { has_law = centralization_1 }
add_law = centralization_0
}
if = {
limit = { has_law = centralization_2 }
add_law = centralization_1
}
if = {
limit = { has_law = centralization_3 }
add_law = centralization_2
}
if = {
limit = { has_law = centralization_4 }
add_law = centralization_3
}
}
}
}
on_fail = {
if = {
limit = {
ROOT = {
NOT = { de_jure_liege = FROM }
}
}
ROOT = {
set_defacto_liege = ROOT
primary_title = {
add_pressed_claim = FROM
}
}
}
ROOT = {
prestige = -100
}
FROM = {
remove_opinion = {
modifier = opinion_traitor
who = ROOT
}
}
}
on_reverse_demand = {
ROOT = {
prestige = -200
prisoner = FROM
}
}
on_attacker_leader_death = {
any_defender = {
letter_event = {
id = 251
}
}
end_war = invalid
}
attacker_ai_victory_worth = {
factor = -1 # always accept
}
attacker_ai_defeat_worth = {
factor = 150
}
defender_ai_victory_worth = {
factor = -1 # always accept
}
defender_ai_defeat_worth = {
factor = 100
}
}
EDIT: added a claim on vassal titles lost via white peace for defacto lieges.
Last edited: