Wiki

effect · add_threat

Definition

  • Supported scope:COUNTRY
  • Supported target:none

Description

Adds country threat

实战 · 配合 · 坑

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

实战用法

add_threat 常用于事件或决议中模拟某国的侵略性行为对世界局势的冲击,例如吞并小国、违反条约、发动突袭宣战时给施害国叠加威胁值,从而触发其他国家组建对抗同盟或加速进入战争状态。也可在 focus 完成时给玩家施加惩罚性威胁,配合叙事增强外交压力感。

# 某国宣战后,在 hidden_effect 中给该国增加威胁
hidden_effect = {
    add_threat = 5
}

配合关系

  • [has_added_tension_amount](/wiki/trigger/has_added_tension_amount):用于检测当前累计威胁值是否达到阈值,与 add_threat 配合可实现"威胁超限则触发事件"的逻辑闭环。
  • [add_war_support](/wiki/effect/add_war_support):侵略国威胁上升时,受威胁邻国往往同步获得战争支持度加成,两者配合模拟国际舆论反弹。
  • [create_wargoal](/wiki/effect/create_wargoal):高威胁通常伴随宣战目标的生成,两条指令写在同一 option 内可还原历史上"侵略国先积累借口再宣战"的流程。
  • [add_opinion_modifier](/wiki/effect/add_opinion_modifier):威胁增加后同步降低他国好感度,使外交惩罚立体化而不仅停留在威胁数值层面。

常见坑

  1. 误用 scopeadd_threat 只能作用于 COUNTRY scope,新手有时在 owned_stateunit_leader 子块里调用,会导致脚本静默报错或效果不生效,必须确保调用时处于国家 scope。
  2. 数值无法负向清零:传入负数并不能将威胁降至 0 以下,且游戏本身也有自然衰减机制,若想快速清除威胁应使用专门的降威胁手段而非简单传负值,否则数值行为与预期不符。

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_threat is commonly used in events or decisions to simulate the impact of a nation's aggressive actions on global affairs. Examples include annexing smaller nations, breaking treaties, or launching surprise attacks—adding threat values to the aggressor state triggers other nations to form counter-alliances or accelerates entry into war. It can also apply punitive threat to the player upon focus completion, enhancing the sense of diplomatic pressure through narrative context.

# After a nation declares war, add threat to that nation via hidden_effect
hidden_effect = {
    add_threat = 5
}

Synergy

  • [has_added_tension_amount](/wiki/trigger/has_added_tension_amount): Checks whether accumulated threat has reached a threshold. Combined with add_threat, this creates a closed-loop logic for "trigger event when threat exceeds limit."
  • [add_war_support](/wiki/effect/add_war_support): As the aggressor's threat rises, threatened neighboring nations typically gain war support bonuses simultaneously. Together, these effects simulate international backlash.
  • [create_wargoal](/wiki/effect/create_wargoal): High threat is typically accompanied by the generation of war goals. Placing both commands in the same option recreates the historical process of "aggressors accumulating pretexts before declaring war."
  • [add_opinion_modifier](/wiki/effect/add_opinion_modifier): After threat increases, simultaneously reduce other nations' opinion toward the aggressor, making diplomatic penalties multidimensional rather than limited to threat values alone.

Common Pitfalls

  1. Incorrect scope usage: add_threat only works in COUNTRY scope. Inexperienced modders sometimes call it within owned_state or unit_leader sub-blocks, causing silent errors or the effect to fail silently. Always ensure the call occurs within a country scope.
  2. Negative values cannot zero out threat: Passing negative numbers does not reduce threat below 0, and the game has a natural decay mechanism anyway. To quickly eliminate threat, use dedicated threat-reduction methods rather than simply passing negative values; otherwise, the numerical behavior will deviate from expectations.