As none of us is pleased with PI's peace mechanism, I've thought of new ways to do it, and I thought I've found a perfect way. Later on, while searching PI and community's scripts for used scripting language components, I've discovered that something similar was actually imagined before in the War and Peace mod.
Here's my implementation, it's a rough script which needs tweaking, as it is intended as a part of a bigger mod, and I haven't worked on tuning it. Atm, it triggers instantly, immediately after someone occupies a province, giving it an occupied province modifier, and after a month of occupation, it offers the occupier an option to annex it. Therefore, it needs is a proper occupation duration and modifiers (commander's attributes, size of the army, war situation, etc) to trigger the script, which also needs testing in order to see how long is enough in order to not be too short, or too long.
Also, because I don't know what happens if the province is enemy's capital and you try to annex it, nor had time to test it, you can't annex a capital province.
Because many are complaining about this (it seems most of them are people which bought EUR from steam which don't know much about PI or EU game series), I'll release it as it is right now, before completing the rest of the intended mod (which contains province looting events and much more).
PS: forgot about the event modifier it needs
PPS: added the province liberated event which removes the occupied province event modifier.
enjoy!
Here's my implementation, it's a rough script which needs tweaking, as it is intended as a part of a bigger mod, and I haven't worked on tuning it. Atm, it triggers instantly, immediately after someone occupies a province, giving it an occupied province modifier, and after a month of occupation, it offers the occupier an option to annex it. Therefore, it needs is a proper occupation duration and modifiers (commander's attributes, size of the army, war situation, etc) to trigger the script, which also needs testing in order to see how long is enough in order to not be too short, or too long.
Also, because I don't know what happens if the province is enemy's capital and you try to annex it, nor had time to test it, you can't annex a capital province.
Because many are complaining about this (it seems most of them are people which bought EUR from steam which don't know much about PI or EU game series), I'll release it as it is right now, before completing the rest of the intended mod (which contains province looting events and much more).
Code:
################################################
# Province occupied (owner)
################################################
province_event = {
id = 57000
trigger = {
NOT = { controlled_by = owner }
NOT = { has_province_modifier = adem_anex_occupied_province }
is_capital = no
has_siege = no
}
mean_time_to_happen = {
days = 1
}
title = "Province occupied!"
desc = "Our $PROVINCENAME$ province is in enemy hands!"
option = {
name = "We'll take it back"
ai_chance = { factor = 100 }
add_province_modifier = { name = "adem_anex_occupied_province" duration = 73000}
controller = {
country_event = 57001
}
}
}
################################################
# Province occupied (new controller)
################################################
country_event = {
id = 57001
is_triggered_only = yes
title = "Province occupied!"
desc = "An enemy province is in our hands!"
option = {
name = "We won't let them take it back"
ai_chance = { factor = 100 }
}
}
################################################
# Province occupied (controller = new owner)
################################################
country_event = {
id = 57002
trigger = {
any_country = {
limit = {
NOT = { tag = THIS }
any_province = {
controller = { tag = THIS }
has_province_modifier = adem_anex_occupied_province
is_capital = no
has_siege = no
}
}
}
}
mean_time_to_happen = {
month = 1
}
title = "Province annexed!"
desc = "$PROVINCENAME$ belongs to us now!"
option = {
name = "It's ours now"
ai_chance = { factor = 90 }
any_country = {
limit = {
NOT = { tag = THIS }
any_province = {
limit = {
controller = { tag = THIS }
has_province_modifier = adem_anex_occupied_province
is_capital = no
has_siege = no
}
province_event = 57003
remove_province_modifier = adem_anex_occupied_province
secede_province = THIS
}
}
}
option = {
name = "Don't want it"
ai_chance = { factor = 10 }
}
}
################################################
# Province occupied (old owner)
################################################
country_event = {
id = 57003
is_triggered_only = yes
title = "Province lost!"
desc = "$PROVINCENAME$ is not ours anymore!"
option = {
name = "Damn them"
ai_chance = { factor = 100 }
}
}
################################################
# Province occupied (controller = owner)
################################################
province_event = {
id = 57004
trigger = {
controlled_by = owner
has_province_modifier = adem_anex_occupied_province
# is_capital = no
# has_siege = no
}
mean_time_to_happen = {
month = 1
}
title = "Province liberated!"
desc = "We've cut enemy's hands holding our province. $PROVINCENAME$ belongs to us again!"
option = {
name = "Hurrray"
remove_province_modifier = adem_anex_occupied_province
}
}
PS: forgot about the event modifier it needs
Code:
### ad_annexation
adem_anex_occupied_province = {
ruler_popularity_gain = 0.01
global_revolt_risk = -0.01
land_morale = 0.05
cavalry_morale = 0.05
naval_morale = 0.05
local_population_growth = -0.05
local_tax_modifier = -0.5
local_revolt_risk = 3
icon = 3
}
PPS: added the province liberated event which removes the occupied province event modifier.
enjoy!
Attachments
Last edited: