Wiki

trigger · has_offensive_war

Definition

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

Description

is country at offensive 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

has_offensive_war is commonly used to determine whether a nation is currently engaged in an offensive war, for example in national focuses, decisions, or events to restrict certain rewards or options to only those nations actively on the offensive. Typical scenarios include: preventing nations on the offensive from accessing certain diplomatic event options, or checking in AI strategies whether allies have already joined the war to decide whether to follow suit.

# This decision can only be triggered when the nation is conducting an offensive war
available = {
    has_offensive_war = yes
}

Synergy

  • [has_defensive_war](/wiki/trigger/has_defensive_war): These two are frequently used in pairs, combining with OR/NOT to distinguish between "active aggression" and "passive defense", precisely filtering the nature of a nation's war status.
  • [any_enemy_country](/wiki/trigger/any_enemy_country): After confirming the existence of an offensive war, further iterate through hostile nations to add conditional checks specific to the actual belligerents.
  • [create_wargoal](/wiki/effect/create_wargoal): When paired in effect blocks, first use has_offensive_war to confirm the nation is already in a war state, avoiding logic conflicts from duplicate wargoal creation.
  • [casualties](/wiki/trigger/casualties): Offensive wars often involve high casualties, which can be combined with casualties thresholds to judge the intensity of the offensive, thereby triggering different event branches.

Common Pitfalls

  1. Confusing offensive/defensive determination: Beginners often assume "any active war returns yes", but in fact only the nation that declared war is the aggressor; if your nation is the one being declared on, use has_defensive_war instead, otherwise the condition will never trigger.
  2. Using outside COUNTRY scope: This trigger only supports national scope; if mistakenly written in a STATE or CHARACTER scope block (such as in the limit of every_owned_state without switching back to national scope), the game will error or silently return false. Ensure the outer scope is a nation or explicitly switch back to national scope using OWNER or similar target selectors.