Wiki

trigger · is_target_of_coup

Definition

  • Supported scope:COUNTRY
  • Supported target:none

Description

is_target_of_coup = yes - Returns true if current country is being targeted by a coup from any country.

实战 · 配合 · 坑

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

实战用法

is_target_of_coup 常用于判断某国当前是否正处于被政变针对的状态,从而触发特殊事件、解锁应急决策或限制外交行为。例如在一个"政治动荡"mod 中,可以在决策的 available 块里用它来禁止被政变目标国在此期间发起进攻战争,或为玩家提供"镇压政变"的专属选项。

# 某决策的 available 条件:仅当本国未被政变针对时才可用
available = {
    NOT = { is_target_of_coup = yes }
    has_political_power > 50
}

配合关系

  • [has_civil_war](/wiki/trigger/has_civil_war):政变往往与内战高度相关,二者组合可精确区分"正在经历政变骚乱"和"已爆发全面内战"两种不同的国内危机阶段,避免条件重叠。
  • [civilwar_target](/wiki/trigger/civilwar_target):用于进一步确认内战/政变的具体目标方,与 is_target_of_coup 搭配可以同时判断"谁在发动"与"谁被针对"。
  • [has_country_flag](/wiki/trigger/has_country_flag):政变触发后通常需要设置国家旗帜来追踪流程进度,配合该 trigger 可实现"仅在政变发生且对应旗帜已置位时"才执行后续逻辑。
  • [any_allied_country](/wiki/trigger/any_allied_country):可在盟友范围内遍历判断是否有盟国正在遭受政变,便于制作"盟友危机干预"类决策的条件。

常见坑

  1. 忘记加 scope 检查:该 trigger 只在 COUNTRY scope 下生效,若在 state scope 或 character scope 中直接使用会静默失效或报错,新手要确保外层 scope 是国家。
  2. 误以为可以指定策划国is_target_of_coup 只判断"当前国家是否被任意国家发动政变针对",无法筛选是哪个具体国家在策划政变;若需要针对特定策划方进行条件判断,需要配合其他 trigger 间接实现,不能给本 trigger 传入国家 tag 参数。

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

is_target_of_coup is commonly used to determine whether a country is currently targeted by a coup attempt, enabling special events to trigger, emergency decisions to unlock, or diplomatic actions to be restricted. For example, in a "political turmoil" mod, you can use it in a decision's available block to prevent the targeted country from launching offensive wars during the crisis period, or to provide players with exclusive "suppress coup" options.

# Available condition for a certain decision: only usable when this country is not targeted by a coup
available = {
    NOT = { is_target_of_coup = yes }
    has_political_power > 50
}

Synergy

  • [has_civil_war](/wiki/trigger/has_civil_war): Coups are often closely related to civil wars. Combining these two allows you to precisely distinguish between "experiencing coup unrest" and "full-scale civil war has erupted"—two different domestic crisis stages—and avoid condition overlap.
  • [civilwar_target](/wiki/trigger/civilwar_target): Used to further confirm the specific faction targeted in a civil war or coup. Paired with is_target_of_coup, you can simultaneously judge "who is orchestrating" and "who is being targeted."
  • [has_country_flag](/wiki/trigger/has_country_flag): After a coup is triggered, you typically need to set country flags to track progress. Combined with this trigger, you can execute subsequent logic only when "a coup has occurred and the corresponding flag is set."
  • [any_allied_country](/wiki/trigger/any_allied_country): Allows iteration through allied nations to check whether any ally is suffering a coup, making it convenient to construct conditions for "allied crisis intervention" type decisions.

Common Pitfalls

  1. Forgetting to check scope: This trigger only works in COUNTRY scope. Using it directly in state scope or character scope will silently fail or cause errors. Beginners must ensure the outer scope is a country.
  2. Mistakenly believing you can specify the coup planner: is_target_of_coup only checks whether the current country is targeted by a coup from any nation—it cannot filter which specific country is orchestrating it. If you need condition logic based on a particular coup planner, you must implement it indirectly through other triggers. You cannot pass a country tag parameter to this trigger.