Wiki

effect · add_relation_rule_override

Definition

  • Supported scope:COUNTRY
  • Supported target:THIS

Description

Adds an override rule to the country's relation to other countries. If there are multiple applicable overrides for a rule, then they are combined using AND logic for positive rules (e.g. can_access_market) and OR logic for negative rules (e.g. can_not_declare_war). 
The description of the effect is based on the trigger or the target country.The description when using the rule override is based: on the target country; the trigger at the time of effect evaluation; or the provided usage_desc.
The following rules are currently supported: can_send_volunteer, can_access_market
Alternative 1:
add_relation_rule_override = { 
 target = GER # [Required] Target country usage_desc = REASON_DESCRIPTION # [Optional] usage description can_not_declare_war = yes # [Required] 
}
Alternative 2:
add_relation_rule_override = { 
 trigger = is_democratic_country # [Required] Named trigger usage_desc = DEMOCRATIC_COUNTRY # [Optional] usage description can_not_declare_war = yes # [Required] 
}

Hands-On Notes

Hands-on notes are AI-generated and checked against the vanilla command vocabulary — treat them as a starting point, not authoritative reference. The definition above is the game's own documentation.

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

  1. 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.
  2. 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.