Wiki

effect · add_civil_war_target

Definition

  • Supported scope:COUNTRY
  • Supported target:THIS, ROOT, PREV, FROM, OWNER, CONTROLLER, OCCUPIED, CAPITAL

Description

Adds a country as a civil war target (added to both sides)

Example:
add_civil_war_target = TAG

实战 · 配合 · 坑

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

实战用法

在内战事件或 national focus 触发内战后,需要让双方阵营相互识别对方为内战交战目标时使用此命令。典型场景是 mod 中自定义内战流程,确保分裂出来的新国家与原国家正确建立内战关系,使 AI 和玩家双方都能看到对方。

# 在内战触发事件的 immediate 块中
country_event = {
    id = my_civil_war.1
    immediate = {
        add_civil_war_target = FROM  # FROM 为分裂产生的叛军国家
    }
}

配合关系

  • [has_civil_war](/wiki/trigger/has_civil_war):配合使用以先确认内战是否已经发生,避免在内战状态外错误调用此命令。
  • [declare_war_on](/wiki/effect/declare_war_on):在设置内战目标后,若自动战争状态未建立,可补充声战来强制进入交战。
  • [create_wargoal](/wiki/effect/create_wargoal):内战双方通常需要添加战争目标,与 add_civil_war_target 配合完整构建内战框架。
  • [civilwar_target](/wiki/trigger/civilwar_target):用于检测某国是否已被登记为内战目标,可在后续事件中做条件判断,避免重复添加。

常见坑

  1. 不在 COUNTRY scope 下调用:此命令仅在国家 scope 中有效,若误放在 STATE 或 CHARACTER scope 内会导致脚本报错或静默失效,务必确认执行块的当前 scope。
  2. 误以为只需单侧调用:官方描述明确该命令会同时向双方添加关系,因此不需要在叛军和原国家两侧各写一次——重复调用反而可能导致状态异常。

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

Use this command when you need to establish mutual recognition between both sides of a civil war as combatants after a civil war is triggered by an event or national focus. The typical scenario is customizing civil war flows in mods to ensure that the newly split nation and the original nation correctly establish civil war relations, allowing both AI and players to see each other as adversaries.

# In the immediate block of a civil war trigger event
country_event = {
    id = my_civil_war.1
    immediate = {
        add_civil_war_target = FROM  # FROM is the rebel nation created by the split
    }
}

Synergy

  • [has_civil_war](/wiki/trigger/has_civil_war): Use together to first confirm whether a civil war has already occurred, avoiding incorrect invocation of this command outside of civil war conditions.
  • [declare_war_on](/wiki/effect/declare_war_on): After setting the civil war target, if the automatic war state is not established, you can supplement with a declaration of war to force combatant status.
  • [create_wargoal](/wiki/effect/create_wargoal): Both sides in a civil war typically need war goals added; use this in conjunction with add_civil_war_target to build a complete civil war framework.
  • [civilwar_target](/wiki/trigger/civilwar_target): Use to detect whether a country has been registered as a civil war target, allowing conditional checks in subsequent events to avoid duplicate additions.

Common Pitfalls

  1. Calling outside of COUNTRY scope: This command only works within a country scope. If mistakenly placed in a STATE or CHARACTER scope, it will cause script errors or silent failures. Always verify the current scope of the execution block.
  2. Mistakenly thinking only one-sided invocation is needed: The official description explicitly states that this command simultaneously adds relations to both sides, so there is no need to write it separately for both the rebels and the original nation—duplicate invocations may actually cause abnormal states.