Wiki

trigger · has_border_war_with

Definition

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

Description

Checks if a there is a border against a state/country

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_with is commonly used as a trigger condition in events or decisions related to border wars, such as determining whether a country is engaged in a border conflict with a specific neighbor, thereby activating decision chains for diplomatic mediation, reinforcement, or ending the border war. In the following example, a decision is only allowed to trigger when a country has an active border war with Germany:

available = {
    has_border_war_with = GER
}

It can also be used within STATE scope to check whether a state is currently in a border war, useful for restricting the triggering of construction or recruitment effects.

Synergy

  • [has_border_war](/wiki/trigger/has_border_war): Used to first check whether any border war currently exists (without specifying a target), then use has_border_war_with to precisely identify the specific belligerent. These two are often paired together to form layered filtering.
  • [divisions_in_border_state](/wiki/trigger/divisions_in_border_state): Border wars typically involve military deployments. Using them together allows you to check the number of divisions in border states and assess the intensity of the conflict.
  • [any_neighbor_country](/wiki/trigger/any_neighbor_country): When you need to iterate through all neighboring countries and check each one for active border wars, has_border_war_with is commonly nested within this scope.
  • [declare_war_on](/wiki/effect/declare_war_on): After a border war ends, a full declaration of war logic often follows. Use has_border_war_with as a limit condition to ensure the effect upgrades to formal war only when a border war exists.

Common Pitfalls

  1. Scope Confusion: Beginners often write logic for STATE scope checks within COUNTRY scope (or vice versa), causing conditions to never be satisfied. Always verify the current scope of your script block—whether it is STATE or COUNTRY—before deciding whether to fill the target with a state tag or a country tag.
  2. Mistaking It for Detecting Formal Wars: has_border_war_with only applies to the Border War mechanism and does not work for formal wars initiated through declare_war_on. If you need to detect formal wars, use other triggers instead.