effect · add_opinion_modifier
Definition
- Supported scope:
COUNTRY - Supported target:
any
Description
Add opinion modifier(s) to target(s)
add_opinion_modifierCOUNTRYanyAdd opinion modifier(s) to target(s)
实战内容由 AI 生成,并已对照 vanilla 命令词表校验 —— 请当作起点而非权威依据。上方的定义节才是游戏自带文档原文。
add_opinion_modifier 常用于外交事件、国策完成或决策触发后,向特定国家添加好感度/厌恶度修正,例如在盟约签订事件中提升双方好感,或在宣战后向受害国施加负面舆论。它需要预先在 opinion_modifiers 文件中定义好修正器,脚本中直接引用该修正器名称即可。
# 某国完成国策后,对目标国家添加正面外交印象
complete_national_focus = GER_sign_treaty
immediate = {
GER = {
add_opinion_modifier = {
target = ITA
modifier = treaty_signed_positive
}
}
}
[add_relation_modifier](/wiki/effect/add_relation_modifier):两者都服务于双边关系塑造,add_opinion_modifier 影响舆论数值,add_relation_modifier 则附加规则性外交限制或加成,常在同一外交事件中搭配使用。[has_country_flag](/wiki/trigger/has_country_flag):用于检查某事件或国策是否已经触发,避免对同一目标重复叠加同名修正器,防止数值异常堆叠。[country_event](/wiki/effect/country_event):外交互动往往需要通知对方,添加舆论修正后立即触发对方的外交事件,形成完整的互动链。[diplomatic_relation](/wiki/effect/diplomatic_relation):在调整外交关系类型(如互不侵犯、保证独立)时,常与舆论修正一并写入同一效果块,保证外交状态与好感数值同步更新。opinion_modifiers 中定义就直接引用:游戏不会报错但修正器静默失效,新手常因此误以为脚本正常运行,实则好感度毫无变化,需确保修正器名称与定义文件中完全一致。add_opinion_modifier 只对 target 方添加修正,即只改变当前 scope 国家"对 target"的看法,若需要双方互相产生好感,必须在双方各自的 scope 下分别调用一次,漏写另一侧会导致外交关系单方面生效。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.
add_opinion_modifier is commonly used in diplomatic events, national focus completion, or decision triggers to add approval/disapproval modifiers toward specific nations. For example, it can boost mutual approval when treaties are signed, or impose negative sentiment on the victim nation after a declaration of war. The modifier must be predefined in the opinion_modifiers file; the script simply references the modifier name directly.
# After a nation completes a national focus, add a positive diplomatic impression to the target nation
complete_national_focus = GER_sign_treaty
immediate = {
GER = {
add_opinion_modifier = {
target = ITA
modifier = treaty_signed_positive
}
}
}
[add_relation_modifier](/wiki/effect/add_relation_modifier): Both serve bilateral relationship shaping; add_opinion_modifier affects opinion values, while add_relation_modifier applies rule-based diplomatic restrictions or bonuses. They are commonly used together in the same diplomatic event.[has_country_flag](/wiki/trigger/has_country_flag): Used to check whether a specific event or national focus has already been triggered, preventing duplicate stacking of the same modifier on the same target and avoiding numerical anomalies.[country_event](/wiki/effect/country_event): Diplomatic interactions often require notifying the other party. After adding an opinion modifier, immediately trigger a diplomatic event for the other nation, forming a complete interaction chain.[diplomatic_relation](/wiki/effect/diplomatic_relation): When adjusting diplomatic relationship types (such as non-aggression pacts or guarantees of independence), opinion modifiers are commonly written together with relationship adjustments in the same effect block, ensuring diplomatic status and approval values update synchronously.opinion_modifiers first: The game won't error, but the modifier silently fails to apply. Beginners often mistakenly assume the script runs correctly when in fact the approval changes nothing. Always ensure the modifier name matches the definition file exactly.add_opinion_modifier only applies the modifier to the target side—it only changes the current scope nation's opinion of the target. If mutual approval is needed, the effect must be called once under each nation's scope separately. Omitting one side results in one-sided diplomatic effects.