Wiki

effect · remove_opinion_modifier

Definition

  • Supported scope:COUNTRY
  • Supported target:any

Description

Remove opinion modifier from target

实战 · 配合 · 坑

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

实战用法

remove_opinion_modifier 常用于外交事件结束后清除临时好感度惩罚/奖励,或在一段关系破裂的剧情选项中撤销之前通过 add_opinion_modifier 施加的立场加成。例如,某国签署停火协议后,清除战前积累的负面舆论标记:

# 某事件选项:停火协议生效,移除对目标国的敌意修正
option = {
    name = my_event.1.a
    FROM = {
        remove_opinion_modifier = {
            modifier = opinion_hostile_stance
            target = ROOT
        }
    }
}

配合关系

  • [add_opinion_modifier](/wiki/effect/add_opinion_modifier) — 最直接的搭档:先用 add_opinion_modifier 施加修正,再用 remove_opinion_modifier 在适当时机撤销,构成完整的好感度生命周期管理。
  • [has_country_flag](/wiki/trigger/has_country_flag) — 在移除修正前通过国家旗帜检查该修正是否确实曾被添加,避免无效调用或触发脚本报错。
  • [add_relation_modifier](/wiki/effect/add_relation_modifier) — 两者常组合使用以区分"舆论向公众展示的印象"与"外交关系层面的数值修正",清除一个的同时保留另一个实现更细腻的外交效果。
  • [country_event](/wiki/effect/country_event) — 移除修正后紧接着触发后续外交事件,形成连贯的事件链叙事。

常见坑

  1. modifier 名称必须与 add_opinion_modifier 中定义的修正 key 完全一致,且该 modifier 需在 opinion_modifiers 文件中预先声明;若 key 写错或不存在,游戏不会报错但修正不会被移除,导致好感度永久残留。
  2. scope 与 target 方向容易搞反:该 effect 在"持有这个 opinion 的一方"scope 下执行,target 填写"被评价的一方";新手常将两者对调,导致移除的对象错误,外交数值出现意料之外的单边残留。

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_opinion_modifier is commonly used to clear temporary opinion penalties/bonuses after diplomatic events conclude, or to revoke stance bonuses previously applied via add_opinion_modifier in story options where a relationship breaks down. For example, after a country signs a ceasefire agreement, you can remove accumulated negative sentiment markers from before the war:

# Event option: ceasefire takes effect, remove hostile stance opinion toward target country
option = {
    name = my_event.1.a
    FROM = {
        remove_opinion_modifier = {
            modifier = opinion_hostile_stance
            target = ROOT
        }
    }
}

Synergy

  • [add_opinion_modifier](/wiki/effect/add_opinion_modifier) — The most direct counterpart: first apply a modifier using add_opinion_modifier, then revoke it at an appropriate moment with remove_opinion_modifier, forming a complete opinion lifecycle management system.
  • [has_country_flag](/wiki/trigger/has_country_flag) — Before removing a modifier, verify via country flag whether the modifier was actually added in the first place, avoiding ineffective calls or script errors.
  • [add_relation_modifier](/wiki/effect/add_relation_modifier) — Commonly combined together to distinguish between "the impression publicly displayed in public opinion" and "numerical modifiers at the diplomatic relations level", allowing you to remove one while preserving the other for more nuanced diplomatic effects.
  • [country_event](/wiki/effect/country_event) — Trigger a follow-up diplomatic event immediately after removing the modifier, forming a coherent event chain narrative.

Common Pitfalls

  1. The modifier name must exactly match the modifier key defined in add_opinion_modifier, and that modifier must be pre-declared in the opinion_modifiers file; if the key is misspelled or does not exist, the game will not report an error but the modifier will not be removed, causing the opinion to persist permanently.
  2. The scope and target direction are easily reversed: this effect executes under the scope of "the party holding this opinion", with target specifying "the party being evaluated"; beginners often swap the two, causing the removal to target the wrong side, resulting in unexpected one-sided opinion residue.