Wiki

trigger · agency_upgrade_number

Definition

  • Supported scope:COUNTRY
  • Supported target:none

Description

Checks the number of upgrade done in the intelligence agency. 
agency_upgrade_number > 4

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

This trigger is commonly used in intelligence agency-related mod scenarios, such as checking in national focuses or decisions whether the player has completed sufficient agency upgrades to unlock advanced espionage operations or rewards. It can also be used in AI logic to ensure the AI only triggers certain strategic actions after the agency reaches a certain maturity level.

# Only allow activating an advanced decision after the intelligence agency has completed more than 4 upgrades
available = {
    agency_upgrade_number > 4
}

Synergy

  • [has_done_agency_upgrade](/wiki/trigger/has_done_agency_upgrade): Used to further check which specific upgrades the player has completed. Combined with agency_upgrade_number, it enables dual filtering of both "quantity + type" conditions.
  • [activate_targeted_decision](/wiki/effect/activate_targeted_decision): Triggers a decision targeting a specific entity when the intelligence agency upgrade count meets the threshold. This is a common pattern in intelligence system expansion mods.
  • [any_operative_leader](/wiki/trigger/any_operative_leader): Frequently used alongside agency_upgrade_number to ensure the country not only upgraded its agency but also actually possesses active operatives. Both serve as prerequisite conditions for operations.
  • [add_ideas](/wiki/effect/add_ideas): Grants specific national spirit ideologies or intelligence bonuses as ideas after meeting the upgrade count threshold, serving as a reward for deep development of the intelligence agency.

Common Pitfalls

  1. Operator Confusion: This trigger uses comparison operators like > / < / >=. Beginners often mistakenly write agency_upgrade_number = 4 (equality check), but such numerical triggers in HOI4 typically don't support equality semantics. You should explicitly use >= 4 or > 3 to express the logic of "at least 4 completions".
  2. Wrong Scope: This trigger can only be used under COUNTRY scope. Placing it within a limit block in STATE or CHARACTER scope will cause direct errors or silent failures. Always verify that the outer scope indeed points to a country.