Wiki

trigger · has_border_war_between

Definition

  • Supported scope:any
  • Supported target:any

Description

Checks if a there is a border war between two states

实战 · 配合 · 坑

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

实战用法

has_border_war_between 常用于边境战争相关的事件或决策中,用来检查两个特定地块之间是否正在进行边境冲突,从而决定是否触发后续外交事件、允许第三方介入或解锁特定选项。例如在一个"调停边境冲突"的决策中,可以用它作为 available 条件,确保只有边境战争确实存在时才能触发调停:

available = {
    has_border_war_between = {
        state_1 = 500
        state_2 = 501
    }
}

配合关系

  • [cancel_border_war](/wiki/effect/cancel_border_war):检测到边境战争存在后,可用此 effect 强制取消边境战争,常用于外交调停或特殊事件结局。
  • [finalize_border_war](/wiki/effect/finalize_border_war):在确认边境战争存在的条件下,用此 effect 结算战争结果,是边境战争流程中最常见的配套操作。
  • [set_border_war_data](/wiki/effect/set_border_war_data):在边境战争存在的前提下,动态调整其参数(如双方兵力或进度),与本 trigger 配合可实现条件化的战局干预。
  • [any_state](/wiki/trigger/any_state):当不确定具体是哪两个地块时,可以用 any_state 循环遍历地块,再在内部用 has_border_war_between 精确筛选目标组合。

常见坑

  1. state 填写顺序无严格要求,但两个 state 必须真实相邻且存在边境战争,若填入的地块没有共享边界或当前根本没有边境战争,trigger 永远返回 false,容易误以为脚本写错而反复排查无果。
  2. 作用域不影响结果,但两个 state 参数必须填写实际 state ID 或合法的变量/scope 引用,新手常误写成国家 tag 或省份 ID(province ID),导致判断失效且不报错,难以定位问题。

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_border_war_between is commonly used in border war-related events or decisions to check whether a border conflict is currently occurring between two specific states, thereby determining whether to trigger subsequent diplomatic events, allow third-party intervention, or unlock specific options. For example, in a "mediate border conflict" decision, you can use it as an available condition to ensure that mediation can only be triggered when a border war actually exists:

available = {
    has_border_war_between = {
        state_1 = 500
        state_2 = 501
    }
}

Synergy

  • [cancel_border_war](/wiki/effect/cancel_border_war): After detecting that a border war exists, you can use this effect to forcefully cancel the border war, commonly used in diplomatic mediation or special event outcomes.
  • [finalize_border_war](/wiki/effect/finalize_border_war): Given that a border war exists, use this effect to settle the war result—the most common accompanying operation in the border war workflow.
  • [set_border_war_data](/wiki/effect/set_border_war_data): Under the premise that a border war exists, dynamically adjust its parameters (such as troop strength or progress for both sides). Combining with this trigger enables conditional battle intervention.
  • [any_state](/wiki/trigger/any_state): When you are uncertain which two specific states are involved, you can use any_state to iterate through states, then use has_border_war_between inside to precisely filter the target combination.

Common Pitfalls

  1. The order of state parameters has no strict requirement, but the two states must be truly adjacent and have a border war. If the states you specify do not share a border or there is currently no border war at all, the trigger will always return false, easily leading to repeated troubleshooting under the mistaken assumption that the script is wrong.
  2. Scope does not affect the result, but the two state parameters must be filled with actual state IDs or valid variable/scope references. Beginners often mistakenly write country tags or province IDs instead, causing the check to fail silently without error messages, making the issue difficult to locate.