Wiki

effect · remove_relation_modifier

Definition

  • Supported scope:COUNTRY
  • Supported target:THIS

Description

Removes a static modifier between current scope and target
Example: add_relation_modifier = {
	target = TAG # target of the relation
	modifier = static_modifier_name_here #Name of the modifier added
	}
}

实战 · 配合 · 坑

实战内容由 AI 生成,并已对照 vanilla 命令词表校验 —— 请当作起点而非权威依据。上方的定义节才是游戏自带文档原文。

实战用法

remove_relation_modifier 常用于外交事件或焦点树完成后撤销之前通过 add_relation_modifier 施加的双边关系加成/惩罚,例如停战协议到期、盟约解除或特定剧情阶段结束时清除临时外交状态。典型场景是在一段互惠贸易协议结束后,从当前国家视角移除对目标国的关系修正。

# 外交协议到期事件中移除双边修正
country_event = {
    id = my_mod.42
    option = {
        name = my_mod.42.a
        # 从本国移除对 ENG 的关系修正
        remove_relation_modifier = {
            target = ENG
            modifier = trade_pact_bonus
        }
        # 同时让 ENG 也移除对我方的修正
        ENG = {
            remove_relation_modifier = {
                target = ROOT
                modifier = trade_pact_bonus
            }
        }
    }
}

配合关系

  • [add_relation_modifier](/wiki/effect/add_relation_modifier) — 与之成对使用,先添加后移除,构成完整的关系修正生命周期管理。
  • [add_opinion_modifier](/wiki/effect/add_opinion_modifier) / [add_days_remove](/wiki/effect/add_days_remove) — 若需要带自动到期的关系效果,可改用带 days 字段的修正,配合本命令在手动触发时提前清除残留。
  • [has_dynamic_modifier](/wiki/trigger/has_dynamic_modifier) — 在移除前用类似的存在性检测思路(或用 has_country_flag)确认修正确实存在,避免无效调用引发日志报错。
  • [country_event](/wiki/effect/country_event) — 常在事件 option 块中与本命令搭配,实现"玩家选择结束协议 → 立即移除双边修正"的叙事流程。

常见坑

  1. 必须双向手动移除remove_relation_modifier 只移除"当前 scope → target"方向的修正,若当初用 add_relation_modifier 在双方各自加了一次,则必须分别进入两个 scope 各调用一次移除,否则另一方的修正会永久残留。
  2. modifier 名拼写必须与添加时完全一致:若 modifier = 的值与 add_relation_modifier 时使用的静态修正名称不匹配(哪怕大小写差异),游戏不会报错但也不会实际移除任何东西,导致修正"消不掉"的难以排查问题。

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

remove_relation_modifier is commonly used in diplomatic events or after focus tree completion to revoke bilateral relation bonuses/penalties previously applied via add_relation_modifier. Typical scenarios include when a ceasefire agreement expires, an alliance dissolves, or a specific narrative phase ends and temporary diplomatic states need to be cleared. A classic use case is removing a relation modifier toward a target nation at the end of a reciprocal trade agreement, from the current country's perspective.

# Remove bilateral modifier when diplomatic agreement expires
country_event = {
    id = my_mod.42
    option = {
        name = my_mod.42.a
        # Remove relation modifier toward ENG from this country
        remove_relation_modifier = {
            target = ENG
            modifier = trade_pact_bonus
        }
        # Also have ENG remove the modifier toward us
        ENG = {
            remove_relation_modifier = {
                target = ROOT
                modifier = trade_pact_bonus
            }
        }
    }
}

Synergy

  • [add_relation_modifier](/wiki/effect/add_relation_modifier) — Use as a paired counterpart; add first, then remove to manage the complete lifecycle of relation modifiers.
  • [add_opinion_modifier](/wiki/effect/add_opinion_modifier) / [add_days_remove](/wiki/effect/add_days_remove) — If you need relation effects with automatic expiration, consider using modifiers with a days field instead, paired with this command to manually clear any lingering effects when needed.
  • [has_dynamic_modifier](/wiki/trigger/has_dynamic_modifier) — Before removing, use similar existence checks (or has_country_flag) to confirm the modifier actually exists, avoiding invalid calls that trigger log errors.
  • [country_event](/wiki/effect/country_event) — Frequently paired with this command within event option blocks to implement narrative flows like "player chooses to end agreement → immediately remove bilateral modifiers."

Common Pitfalls

  1. Must remove bidirectionally and manually: remove_relation_modifier only removes the modifier in the "current scope → target" direction. If you initially added the modifier on both sides using add_relation_modifier, you must call the removal separately from each scope, otherwise the other party's modifier will persist indefinitely.
  2. Modifier name spelling must match exactly when added: If the value of modifier = doesn't match the static modifier name used during add_relation_modifier (even with case differences), the game won't error but also won't actually remove anything, resulting in a difficult-to-debug "modifier won't disappear" issue.