Wiki

trigger · has_offensive_war_with

Definition

  • Supported scope:COUNTRY
  • Supported target:THIS, ROOT, PREV, FROM, OWNER, CONTROLLER, OCCUPIED, CAPITAL

Description

One country has offensive war against other 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_offensive_war_with is commonly used to determine whether an "aggressor-defender" unidirectional war relationship exists between two nations. For example, in diplomatic events or decisions, it restricts certain options to be available only when your nation is the active aggressor, or it can be used in AI strategy condition checks. Typical scenario: allow activation of a wartime decision or trigger a specific event only when your nation is the active attacker.

# This decision is only available when your nation has launched an offensive war against the target
available = {
    has_offensive_war_with = FROM
}

Synergy

  • [has_defensive_war_with](/wiki/trigger/has_defensive_war_with): Used as a counterpart to this trigger to distinguish between "your nation as aggressor" versus "your nation as defender". Commonly used in condition blocks where precise war nature classification is needed.
  • [any_enemy_country](/wiki/trigger/any_enemy_country): Enumerates all current enemy nations. Combined with has_offensive_war_with, it can filter which enemies your nation actively initiated war against, suitable for batch strategy judgments.
  • [create_wargoal](/wiki/effect/create_wargoal): Actively generates war goals in effect blocks. Often after confirming war status on the trigger side using has_offensive_war_with, it determines whether to append new war goals.
  • [has_war_score](/wiki/trigger/has_war_score): Offensive wars often require checking current war score as well. Used together, these can construct a compound condition of "currently attacking and already gaining advantage".

Common Pitfalls

  1. Confusing aggressor/defender direction: The semantics of has_offensive_war_with = X is "the current scope nation has launched an offensive war against X", not "X has launched war against the current scope". Beginners often reverse the two, causing the condition to fail entirely. Double-check the direction of the relationship before implementation.
  2. Target misdirection: In country_event option conditions, the referents of FROM and ROOT change with the triggering context. Blindly copying examples without confirming which nation the current scope's FROM actually points to will cause the judgment object to be misaligned. It is recommended to first use [exists](/wiki/trigger/exists) paired with debugging to confirm scope direction before filling in the target.