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

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.