Wiki

trigger · has_border_war

Definition

  • Supported scope:STATE, COUNTRY
  • Supported target:any

Description

Checks if a there is any border wars for country/state

实战 · 配合 · 坑

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

实战用法

has_border_war 常用于判断某国或某州是否正处于边境冲突状态,从而决定是否触发特定决策、事件或外交选项。例如在 mod 中,可以用它来阻止处于边境战争中的国家发动正式宣战,或为陷入边境冲突的国家解锁特殊的调停事件链。

# 在某个决策的 available 块中,要求本国当前没有边境战争才能执行外交谈判
available = {
    NOT = { has_border_war = yes }
    is_subject = no
}

配合关系

  • [has_border_war_with](/wiki/trigger/has_border_war_with) — 当需要进一步判断边境战争的具体交战对象时,与本 trigger 配合使用,先用 has_border_war 做宽泛过滤,再用 has_border_war_with 锁定具体国家。
  • [any_neighbor_country](/wiki/trigger/any_neighbor_country) — 在 COUNTRY scope 下遍历邻国,配合 has_border_war 检查是否存在邻国正与本国发生边境冲突,适合构建复杂的地区局势判断。
  • [divisions_in_border_state](/wiki/trigger/divisions_in_border_state) — 边境战争往往伴随着边境州的兵力集结,两者同时检查可以更精确地判断战区紧张程度。
  • [country_event](/wiki/effect/country_event) — 在边境战争条件满足时触发相应的外交或军事事件,是最常见的结果效果搭配。

常见坑

  1. Scope 混用has_border_war 同时支持 STATE 和 COUNTRY scope,但写在 focus 或国家事件的 trigger 块时默认 scope 是 COUNTRY,若误将其写在某个州的 limit 块内而未做 scope 切换,结果可能与预期不符,需注意当前所在 scope 是否正确。
  2. has_civil_war 逻辑混淆:新手容易将边境战争(border war)与内战(civil war)的判断条件互换,has_border_war 不能用来检测内战状态,两者是完全独立的机制,误用不会报错但逻辑会静默失效。

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 is commonly used to check whether a country or state is currently engaged in a border conflict, allowing you to conditionally trigger specific decisions, events, or diplomatic options. For example, in a mod you could use it to prevent countries actively in a border war from declaring formal war, or to unlock special mediation event chains for nations embroiled in border conflicts.

# In the available block of a decision, require that the player's country has no active border war before executing diplomatic negotiations
available = {
    NOT = { has_border_war = yes }
    is_subject = no
}

Synergy

  • [has_border_war_with](/wiki/trigger/has_border_war_with) — When you need to identify the specific opponent in a border conflict, use this trigger alongside has_border_war for more precision: first filter broadly with has_border_war, then lock onto the specific country with has_border_war_with.
  • [any_neighbor_country](/wiki/trigger/any_neighbor_country) — Iterate through neighboring countries within COUNTRY scope, pairing with has_border_war to check whether any neighbor is currently in a border conflict with your nation—ideal for building complex regional situation assessments.
  • [divisions_in_border_state](/wiki/trigger/divisions_in_border_state) — Border wars typically involve troop concentrations in border states; checking both conditions together allows you to gauge combat zone tension more precisely.
  • [country_event](/wiki/effect/country_event) — Trigger corresponding diplomatic or military events when border war conditions are met; this is the most common pairing for consequence effects.

Common Pitfalls

  1. Scope Confusion: has_border_war supports both STATE and COUNTRY scope, but when written in a focus or national event's trigger block, the default scope is COUNTRY. If you mistakenly place it in a state's limit block without scope switching, results may not match expectations—always verify your current scope context.
  2. Conflating with has_civil_war Logic: Newcomers often confuse the conditions for detecting border wars versus civil wars (has_civil_war). The has_border_war trigger cannot detect civil war states; they are completely independent mechanics. Misuse won't throw an error but will silently fail the condition.