Patch 2.5.2 issue: infamy_modifier does not work-- at all.
One of the key issues addressed with infamy in patch 2.5.2 was the ability to vary the total amount of infamy gained from a war individually by CB type via a new CB parameter
infamy_modifier, which is supposed to be a multiplier/factor applied to any Threat which might be gained from that type of war. This new parameter is used in several vanilla CBs, as heavily advertised with patch 2.5.2. However,
infamy_modifier does NOT work.
Regardless of the value or formatting of the numeric parameter given to
infamy_modifier in any CB, it has
no effect whatsoever upon the Threat value gained from CB success. It is as if the implementation of this feature were simply forgotten in the merge for the release of patch 2.5.2.
I've been dealing with this in many of my own mods' CBs for awhile, but I finally decided to thoroughly test this in isolation and report it, because it is a game-changing feature insofar as the Threat mechanic is concerned and is already relied-upon by vanilla. The [probably obvious] fix for this issue will likely result in a major face-palm somewhere in Stockholm, although in the interest of simply having this functionality ASAP, I do hope that I'll be the one facepalming.
I've written an ultra-simple, annotated test CB to demonstrate the problem. I've also placed the CB file into a test mod for easy verification, which is attached to this post.
First, let's cover the test CB for reference, and then I'll show you it in action-- or, rather, as far as
infamy_modifier goes, lack of action.
Code:
# This infamy_modifier test CB was designed to be as simple as possible, usable within fully vanilla context,
# and used in the same way(s) that vanilla 2.5.2 uses infamy_modifier. It shows that, for all intents and purposes,
# the CB parameter `infamy_modifier` is ignored.
#
# I chose an is_permanent=yes, check_de_jure_tier=DUKE invasion-style CB only allowed between independent ROOT and FROM.
# The CB itself, of course, is entirely WAD, aside from infamy_modifier's epic fail.
cb_test_infamy_modifier = {
name = CB_NAME_INVASION
war_name = WAR_NAME_INVASION
sprite = 8
truce_days = 3650
hostile_against_others = yes
can_ask_to_join_war = no
is_permanent = yes
check_de_jure_tier = DUKE
allowed_to_target_tributaries = no
allowed_to_target_suzerains = no
# None of these infamy_modifier variants affected Threat gain due to any war outcome (all tested):
# infamy_modifier = 0 # Why initially chosen: main, desired behavior that led to discovery of this problem
infamy_modifier = 0.0 # Why: perhaps there's a parsing issue with bare integers on the RHS (e.g., 0 as above)
# infamy_modifier = 0.01 # Why: perhaps it doesn't work with a strictly-zero-valued parameter at all
# infamy_modifier = 0.85 # Why: sanity-checking a value used in vanilla's `claim` CB (#1) -- no dice
# infamy_modifier = -1.0 # Why: maybe it's not a multiplier/factor but indeed a "modifier," as its name suggests
# infamy_modifier = -0.99 # Why: maybe it doesn't like 0% infamy at all, given the prior "modifier" logic
# infamy_modifier = -0.85 # ...
can_use = {
ROOT = {
independent = yes
NOT = { same_realm = FROM }
}
}
can_use_title = {
# Any duchy with a direct border
any_direct_de_jure_vassal_title = {
holder_scope = { same_realm = FROM }
location = {
any_neighbor_province = {
owner = { same_realm = ROOT }
}
}
}
}
is_valid_title = {
FROM = {
any_realm_title = {
de_jure_liege_or_above = PREVPREV
}
}
}
on_success_title = {
ROOT = {
vassalize_or_take_under_title = {
title = PREV
enemy = FROM
type = invasion
}
}
if = {
limit = { holder_scope = { same_realm = FROM } }
usurp_title_only = { target = ROOT type = invasion }
}
# Variants such as this were also tried (though definitely not necessary):
# ROOT = {
# gain_settlements_under_title = {
# title = PREV
# enemy = FROM
# is_crusade = yes # Even if the title holder is not participating in the war...
# type = invasion
# }
# }
}
on_fail = { } # No need
on_reverse_demand = { } # No need
attacker_ai_victory_worth = {
factor = -1 # always accept
}
attacker_ai_defeat_worth = {
factor = 100
}
defender_ai_victory_worth = {
factor = -1 # always accept
}
defender_ai_defeat_worth = {
factor = 100
}
}
Got it? Good. Now, let's see it in action...
Spoiler: Despite
infamy_modifier = 0.0 in the CB (as one of the numerous values tried), we will still accrue the same amount of Threat as we do in any war with the parameter set to anything else or excluded altogether.
I load up in 1066 as Heinrich Salian [Holy Roman Emperor]. I immediately use the test CB to invade France for the neighboring Duchy of Flanders:
Now, since I'd rather this not get bloody, I then immediately switch to King Philippe of France and surrender to the HRE:
I switch back to the HRE, and I accept the French surrender:
Excellent. Flanders is now under my control, and I've won-- but, wait, what's this?
I've gained
12.00% Threat due to the 'Holy Roman Invasion of Flanders,' and yet I should not have accrued any Threat at all. Once I unpause, the defensive pacts form (as they start forming at 5% Threat).
...
Beers to
@Divine if he can tell us how to properly write CBs with varying levels of Threat impact w/ the current patch.
Presently, for special-purpose CBs which tend to come up in "restoration / unification / anarchy" historical scenarios (or, say, various historical invasions in the game already), my only options to prevent the Defensive Pact mechanic from overreacting to these types of wars and thus preventing the desired behavior are to either:
- Disable the Threat / D-Pact mechanic entirely -- game/mod-global
- Prevent the involved AIs from using any CBs via normal war declaration mechanisms and force all "desired" war declarations to be scripted (using the infamy = 0 parameter which can be passed to the war and reverse_war commands).
Thanks for taking the time to read this, and hopefully there'll soon be a solution. I'm sure users of vanilla would appreciate the fix as well.