Hands-On Usage
add_relation_modifier is commonly used in diplomatic system mods to apply persistent static modifiers between two specific countries, such as granting additional trade benefits or diplomatic pressure bonuses to both parties after signing a secret agreement. Unlike the generic add_opinion_modifier, it binds to a static modifier and can carry richer numerical effects.
# When the player completes a certain diplomatic decision, add a relation modifier to the target country
effect_on_complete = {
GER = {
add_relation_modifier = {
target = ITA
modifier = secret_pact_bonus
}
}
}
Synergy
[add_opinion_modifier](/wiki/effect/add_opinion_modifier) — Often used alongside relation modifiers; opinion modifiers handle displaying diplomatic affinity changes while relation modifiers apply actual numerical effects, complementing each other.
[add_dynamic_modifier](/wiki/effect/add_dynamic_modifier) — If you need modifiers with expiration times or dynamic variables, pair with add_relation_modifier: relation modifiers handle bilateral relations while dynamic modifiers handle domestic effects.
[has_dynamic_modifier](/wiki/trigger/has_dynamic_modifier) — Check in trigger conditions whether a modifier already exists to prevent stacking the same relation modifier multiple times and causing numerical anomalies.
[diplomatic_relation](/wiki/effect/diplomatic_relation) — Call alongside establishing formal diplomatic relations (such as non-aggression pacts) to keep diplomatic status consistent with relation modifiers.
Common Pitfalls
- The modifier must be predefined in
static_modifiers: Beginners often directly enter a name not declared in common/modifiers/, causing the modifier to silently fail without error messages and have no effect in-game.
- The target direction is easily reversed: This effect executes on the current scope's country, with
target pointing to the other party; the modifier applies to the "current country → target country" relationship, not bidirectionally. If bidirectional effects are needed, execute once in each country's scope.