Wiki

trigger · is_border_conflict

Definition

  • Supported scope:STATE
  • Supported target:any

Description

checks if a state is in border conflict

实战 · 配合 · 坑

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

实战用法

is_border_conflict 常用于边境冲突系统相关的决策或事件中,用来判断某个州是否正处于边境战争状态,从而决定是否允许玩家触发某些干预决策或阻止其他建设行为。例如在自定义边境冲突 mod 里,可以用它限制交战州内的建设行动:

# 在某个决策的 available 块中,禁止对交战中的州发起新建设
available = {
    NOT = {
        any_neighbor_state = {
            is_border_conflict = yes
        }
    }
}

配合关系

  • [has_border_war](/wiki/trigger/has_border_war):两者都检测边境战争状态,has_border_war 侧重于国家层面是否存在边境战争,而 is_border_conflict 在 STATE scope 下更精确定位到具体州,常搭配使用以做多层过滤。
  • [any_neighbor_state](/wiki/trigger/any_neighbor_state):如上例所示,用于遍历邻接州并检测其中是否有边境冲突州,是最典型的组合写法。
  • [set_border_war](/wiki/effect/set_border_war):在 effect 块中用于开启或关闭边境战争,通常与 is_border_conflict 搭配——先用 trigger 判断状态再决定是否调用 effect,避免重复设置。
  • [is_controlled_by](/wiki/trigger/is_controlled_by):边境冲突期间控制权归属复杂,常与本 trigger 联用,确认某州当前控制方后再做进一步逻辑判断。

常见坑

  1. Scope 写错位置is_border_conflict 必须在 STATE scope 下调用,若直接写在国家 scope 的 trigger 块里而不借助 any_neighbor_state 等切换 scope,脚本会报错或静默失败,新手容易忘记先切换到州级 scope。
  2. has_border_war 混淆:部分新手误以为两者等价而随意替换——has_border_war 是国家 scope 的 trigger,is_border_conflict 是州 scope 的 trigger,在错误 scope 下使用对方会导致条件永远不成立。

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_border_conflict is commonly used in decisions or events related to the border conflict system to determine whether a specific state is currently in a state of border war, thereby deciding whether to allow players to trigger certain intervention decisions or prevent other construction actions. For example, in custom border conflict mods, you can use it to restrict construction actions in states engaged in conflict:

# In the available block of a decision, prevent initiating new construction in states under border conflict
available = {
    NOT = {
        any_neighbor_state = {
            is_border_conflict = yes
        }
    }
}

Synergy

  • [has_border_war](/wiki/trigger/has_border_war): Both detect border war status, but has_border_war focuses on the country-level existence of border wars, while is_border_conflict under STATE scope pinpoints specific states more precisely. They are commonly used together for multi-layer filtering.
  • [any_neighbor_state](/wiki/trigger/any_neighbor_state): As shown in the example above, used to iterate through neighboring states and check whether any of them have border conflicts. This is the most typical combination pattern.
  • [set_border_war](/wiki/effect/set_border_war): Used in effect blocks to enable or disable border wars. It is typically paired with is_border_conflict—use triggers to check status first, then decide whether to call the effect, avoiding duplicate settings.
  • [is_controlled_by](/wiki/trigger/is_controlled_by): Control ownership is complex during border conflicts. Frequently used together with this trigger to confirm the current controller of a state before proceeding with further logic.

Common Pitfalls

  1. Incorrect Scope Placement: is_border_conflict must be called under STATE scope. If written directly in a country scope's trigger block without switching scope via any_neighbor_state or similar, the script will error or fail silently. Beginners often forget to switch to state-level scope first.
  2. Confusion with has_border_war: Some beginners mistakenly treat them as equivalent and swap them carelessly—has_border_war is a country scope trigger, while is_border_conflict is a state scope trigger. Using one in the wrong scope will cause the condition to never evaluate true.