Wiki

trigger · has_civil_war

Definition

  • Supported scope:COUNTRY
  • Supported target:none

Description

check if participant in civil war as revolter or target

实战 · 配合 · 坑

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

实战用法

has_civil_war 常用于内战 mod 中,防止玩家或 AI 在内战进行期间触发某些外交决议、国策或事件,避免逻辑冲突。例如,可以在某个决议的 available 块中排除内战状态,或在事件触发条件中检查是否处于内战以分支处理剧情。

# 某外交决议:仅在未卷入内战时可用
available = {
    NOT = { has_civil_war = yes }
    is_subject = no
}

配合关系

  • [civilwar_target](/wiki/trigger/civilwar_target):用于进一步判断内战的对立方是哪个国家,配合 has_civil_war 可精确处理"确认内战存在后再筛选目标"的逻辑。
  • [has_defensive_war](/wiki/trigger/has_defensive_war):内战期间通常伴随防御战争状态,两者联用可区分"普通防御战"与"内战性质的防御战",避免条件误判。
  • [add_civil_war_target](/wiki/effect/add_civil_war_target):在 effect 侧添加内战目标前,先用 has_civil_war 确认当前是否已处于内战,防止重复触发内战逻辑。
  • [has_capitulated](/wiki/trigger/has_capitulated):内战中一方投降后 has_civil_war 会转为 false,两者配合可处理"内战刚结束"的边界状态事件。

常见坑

  1. 误以为 has_civil_war = no 等价于从未发生过内战:该 trigger 只反映当前时刻是否处于内战状态,内战结束后它立刻返回 false,无法用来判断历史上是否经历过内战,需要用国家标志(has_country_flag)来记录历史状态。
  2. 忽略双方 scope 都返回 true:内战中的发起方目标方对该 trigger 均返回 true,因此如果你只想对其中一方生效,必须额外配合 [civilwar_target](/wiki/trigger/civilwar_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

has_civil_war is commonly used in civil war mods to prevent players or AI from triggering certain diplomatic decisions, national focuses, or events during an ongoing civil war, avoiding logical conflicts. For example, you can exclude the civil war state in a decision's available block, or check for civil war status in event trigger conditions to branch the narrative accordingly.

# Diplomatic decision: only available when not involved in civil war
available = {
    NOT = { has_civil_war = yes }
    is_subject = no
}

Synergy

  • [civilwar_target](/wiki/trigger/civilwar_target): Used to further determine which country is the opposing side in the civil war. Combined with has_civil_war, it enables precise handling of the logic "confirm civil war exists, then filter the target."
  • [has_defensive_war](/wiki/trigger/has_defensive_war): A defensive war state typically accompanies a civil war. Using both together allows you to distinguish between "ordinary defensive war" and "civil war as a defensive war," avoiding condition mispredication.
  • [add_civil_war_target](/wiki/effect/add_civil_war_target): Before adding a civil war target on the effect side, first use has_civil_war to confirm whether you are already in a civil war, preventing duplicate triggering of civil war logic.
  • [has_capitulated](/wiki/trigger/has_capitulated): After one side surrenders during a civil war, has_civil_war turns to false. Using both allows you to handle edge-case events "just after civil war ends."

Common Pitfalls

  1. Mistakenly believing has_civil_war = no is equivalent to "never had a civil war": This trigger only reflects whether you are currently in a civil war state. After a civil war ends, it immediately returns false and cannot be used to judge whether a civil war occurred in history. Use country flags (has_country_flag) to record historical state instead.
  2. Overlooking that both sides return true: Both the initiating side and the target side of a civil war return true for this trigger. If you only want it to apply to one side, you must additionally use [civilwar_target](/wiki/trigger/civilwar_target) to distinguish between your own side and the opposing side, otherwise the logic will apply to both sides of the civil war simultaneously.