Hands-On Usage
add_relation_rule_override is commonly used in diplomatic agreements, ideology restrictions, or scripted event scenarios—for example, preventing a democratic nation from declaring war on an ally, or restricting volunteer deployment between specific countries. Its strength lies in binding named triggers for dynamic condition evaluation rather than hardcoding target tags, making it ideal for mods requiring flexible diplomatic rules.
# Event option: Germany cannot declare war on USA (direct target binding)
option = {
name = example.1.a
add_relation_rule_override = {
target = USA
usage_desc = REASON_PEACE_TREATY
can_not_declare_war = yes
}
}
# Or: enable market access for all democratic nations
add_relation_rule_override = {
trigger = is_democratic_country
usage_desc = DEMOCRATIC_MARKET_ACCESS
can_access_market = yes
}
Synergy
[has_active_rule](/wiki/trigger/has_active_rule): Used in subsequent triggers to check whether a rule override is already active; pair it with this effect for prerequisite or follow-up decision logic.
[clear_rule](/wiki/effect/clear_rule): When a diplomatic agreement expires or the player makes a new choice, clears the rule override previously added by this effect, forming a paired "add/remove" workflow.
[add_opinion_modifier](/wiki/effect/add_opinion_modifier): Rule overrides typically accompany diplomatic relationship changes; adding opinion modifiers provides intuitive UI-level reflection of the diplomatic context behind rule activation.
[diplomatic_relation](/wiki/effect/diplomatic_relation): When setting war declaration or market access rules, simultaneously adjust formal diplomatic status (such as non-aggression pacts or trade agreements); together they constitute a complete diplomatic event outcome.
Common Pitfalls
target and trigger are mutually exclusive: Beginners often write both target and trigger fields simultaneously, but they represent two alternative usage patterns (Alternative 1 / Alternative 2). Writing both causes script parsing errors or rules failing silently.
- Silent failure from typos in rule names: Only a limited set of rule names are supported (such as
can_not_declare_war, can_send_volunteer, can_access_market). Using unsupported rule names won't generate script errors but will have no effect whatsoever, making debugging extremely difficult.