Wiki

trigger · has_annex_war_goal

Definition

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

Description

Checks a country has annex war goal on another 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_annex_war_goal is commonly used to determine whether a country currently holds an annexation war goal against a target nation, enabling you to trigger related events, decisions, or AI strategy adjustments. For example, you might display a warning event when the player discovers they've been targeted by a major power, or restrict a decision's available block so that seeking foreign aid is only permitted when under such threat.

# Allow activation of the "Emergency Mobilization" decision when this country is marked for annexation by a major power
available = {
    any_enemy_country = {
        has_annex_war_goal = ROOT
    }
}

Synergy

  • [any_enemy_country](/wiki/trigger/any_enemy_country): Iterates through all enemy countries; combined with has_annex_war_goal, it checks whether any enemy holds an annexation goal against your nation—the most common usage pattern.
  • [has_defensive_war](/wiki/trigger/has_defensive_war): Often checked simultaneously to verify that you are in a defensive war state, confirming that the annexation threat has materialized into actual combat.
  • [create_wargoal](/wiki/effect/create_wargoal): After detecting that an opponent holds an annexation goal against you, use this effect to create a reciprocal war goal for your nation, enabling a "tit-for-tat" scripting logic.
  • [add_ideas](/wiki/effect/add_ideas): Once you confirm the annexation threat, grant your nation a specific "fight to the last" type national idea to enhance immersion.

Common Pitfalls

  1. Scope confusion: The subject of has_annex_war_goal is "the country holding the war goal," while the target is "the country being targeted"—beginners often reverse these, calling the trigger directly under the threatened nation's scope when they actually need to first enter the scope of the nation issuing the annexation to judge correctly.
  2. Checking before war goal is created: Wars declared via declare_war_on may experience a one-frame delay between war goal registration timing and event trigger order, causing a trigger check immediately following the declare war effect to return false. Move such checks into separate events or on_action callbacks instead.