Wiki

trigger · is_spymaster

Definition

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

Description

check if country is Spy Master

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

is_spymaster is commonly used in intelligence agency-related mods to determine whether a nation serves as the leader of the current intelligence alliance, thereby unlocking exclusive decisions, special events, or additional bonuses. For example, in a multi-nation intelligence cooperation mod, only the leader nation can trigger coordinated action events:

# In the event's trigger block, restrict triggering only for the intelligence alliance leader
country_event = {
    id = spy_alliance.1
    trigger = {
        is_spymaster = yes
        has_active_mission = yes
    }
}

Synergy

  • [has_done_agency_upgrade](/wiki/trigger/has_done_agency_upgrade): The leader nation typically needs to achieve a certain intelligence agency upgrade level to qualify for or possess the capability to exercise leader privileges; the two are often combined in available conditions.
  • [agency_upgrade_number](/wiki/trigger/agency_upgrade_number): Further quantifies the development level of the intelligence agency; combined with is_spymaster, it can establish "upgrade count thresholds" required to trigger advanced leader events.
  • [create_intelligence_agency](/wiki/effect/create_intelligence_agency): Used in effect blocks to ensure the target nation possesses an intelligence agency; often appears as a remedial effect following reverse judgments of is_spymaster = no.
  • [any_allied_country](/wiki/trigger/any_allied_country): Leader status typically requires checking allied nations together; used to confirm whether qualified member nations exist within the alliance.

Common Pitfalls

  1. Forgetting scope restrictions: is_spymaster can only be used within COUNTRY scope; calling it directly within STATE or CHARACTER scope will cause script errors or silent failures. Always switch to country scope first using OWNER / ROOT or similar.
  2. Confusing it with intelligence agency existence: is_spymaster determines "intelligence alliance leader" status, not "whether an intelligence agency has been established"; if you only want to check whether an agency exists, use [agency_upgrade_number](/wiki/trigger/agency_upgrade_number) or related flags instead. Using is_spymaster = yes directly to check nations that have not joined any intelligence alliance will always return false.