Wiki

effect · cancel_border_war

Definition

  • Supported scope:any
  • Supported target:none

Description

cancel border war between two states

实战 · 配合 · 坑

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

实战用法

cancel_border_war 常用于事件驱动的外交 mod 中,当玩家通过谈判、停战协议或第三方干涉等剧情选项强制终止边境战争时触发。例如在某国接受调停的 option 块中调用,使双方边境战争立即结束而不产生正常胜负结算:

option = {
    name = border_war_ceasefire.opt_a
    cancel_border_war = yes
    add_political_power = -50
}

配合关系

  • [has_border_war_between](/wiki/trigger/has_border_war_between):在执行取消前先检测两个州之间是否确实存在边境战争,避免对不存在战争的情况触发无效逻辑。
  • [start_border_war](/wiki/effect/start_border_war):与 cancel_border_war 形成完整的边境战争生命周期管理,开启与关闭通常在同一事件链中配对出现。
  • [finalize_border_war](/wiki/effect/finalize_border_war):若需要以正式胜负方式结算而非直接取消,可在条件分支中二选一使用,明确区分"强制终止"与"正常结算"两种设计意图。
  • [custom_effect_tooltip](/wiki/effect/custom_effect_tooltip):由于 cancel_border_war 本身不会自动向玩家展示反馈文本,配合此命令可在 UI 上显示易读的提示说明。

常见坑

  1. 忽略 scope 对象:此 effect 的 scope 为 any,但实际执行时必须确保脚本上下文能够定位到正确的两个 state,若直接写在国家 scope 下而未指定具体州,可能导致命令静默失效而无任何报错。
  2. finalize_border_war 混用:新手常将"取消"与"结算"混淆,cancel_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

cancel_border_war is commonly used in event-driven diplomatic mods to terminate border wars when players trigger scripted options involving negotiation, armistice agreements, or third-party intervention. For example, it can be called within an option block when a nation accepts mediation, causing the border war between both sides to end immediately without normal victory/defeat resolution:

option = {
    name = border_war_ceasefire.opt_a
    cancel_border_war = yes
    add_political_power = -50
}

Synergy

  • [has_border_war_between](/wiki/trigger/has_border_war_between): Check whether a border war actually exists between two states before executing the cancellation, preventing invalid logic from firing on non-existent conflicts.
  • [start_border_war](/wiki/effect/start_border_war): Works with cancel_border_war to form a complete border war lifecycle management system; opening and closing typically appear as paired operations within the same event chain.
  • [finalize_border_war](/wiki/effect/finalize_border_war): When formal victory/defeat resolution is required instead of direct cancellation, use either one conditionally in a branching structure to clearly distinguish between "forced termination" and "normal resolution" design intentions.
  • [custom_effect_tooltip](/wiki/effect/custom_effect_tooltip): Since cancel_border_war does not automatically display feedback text to the player, pairing it with this command allows readable tooltip descriptions to appear in the UI.

Common Pitfalls

  1. Overlooking scope context: This effect's scope is any, but execution must ensure the script context can properly locate the correct two states; writing it directly under a country scope without specifying particular states may cause silent command failure with no error reporting.
  2. Mixing with finalize_border_war: Beginners often confuse "cancellation" with "resolution"; cancel_border_war produces no territorial or victory/defeat changes. Misusing it in scenarios where resolution should occur leaves the border war unresolved and causes abnormal residual state data for both sides.