Wiki

trigger · has_intelligence_agency

Definition

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

Description

has country created an Intelligence Agency

实战 · 配合 · 坑

实战内容由 AI 生成,并已对照 vanilla 命令词表校验 —— 请当作起点而非权威依据。上方的定义节才是游戏自带文档原文。

实战用法

has_intelligence_agency 常用于判断玩家或 AI 国家是否已建立情报机构,从而解锁后续情报相关的决议、国策或顾问选项。例如,可以在某个决议的 available 块中设置前置条件,确保玩家必须先建立情报机构才能执行间谍行动类内容。

# 示例:某决议要求本国已建立情报机构才能使用
my_spy_decision = {
    available = {
        has_intelligence_agency = yes
    }
    ...
}

配合关系

  • [create_intelligence_agency](/wiki/effect/create_intelligence_agency):最直接的配对——先用 has_intelligence_agency = no 作为条件判断,再通过该 effect 创建情报机构,避免重复建立导致脚本报错或逻辑混乱。
  • [agency_upgrade_number](/wiki/trigger/agency_upgrade_number):在已确认情报机构存在的前提下,进一步检查升级数量,两者常嵌套使用来分级解锁内容。
  • [has_done_agency_upgrade](/wiki/trigger/has_done_agency_upgrade):与本 trigger 配合可构成「已建立机构 + 已完成特定升级」的双重门槛,用于高阶间谍事件或决议的 available 判断。
  • [any_operative_leader](/wiki/trigger/any_operative_leader):确认情报机构存在后,再检查是否拥有特工人员,常见于判断某国间谍网络是否具备行动能力的综合条件块。

常见坑

  1. 正反逻辑混用:新手有时在 create_intelligence_agency effect 的前置条件中忘记写 has_intelligence_agency = no,导致脚本尝试对已有情报机构的国家再次创建,引发静默报错或机构数据异常;务必先用本 trigger 做保护性判断。
  2. Scope 对象错误:在 any_allied_country / any_neighbor_country 等循环块内部使用时,trigger 已自动切换到子国家 scope,无需再手动指定目标;新手常额外加 ROOT:has_intelligence_agency 写法,导致实际检测的仍是根国家而非循环目标国。

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_intelligence_agency is commonly used to check whether a player or AI nation has established an intelligence agency, thereby unlocking subsequent intelligence-related decisions, focus trees, or advisor options. For example, you can set a prerequisite condition in the available block of a decision to ensure the player must establish an intelligence agency before executing espionage-related content.

# Example: A decision requiring the nation to have established an intelligence agency
my_spy_decision = {
    available = {
        has_intelligence_agency = yes
    }
    ...
}

Synergy

  • [create_intelligence_agency](/wiki/effect/create_intelligence_agency): The most direct pairing—first use has_intelligence_agency = no as a conditional check, then create the intelligence agency via this effect to avoid duplicate creation that could cause script errors or logic confusion.
  • [agency_upgrade_number](/wiki/trigger/agency_upgrade_number): After confirming the intelligence agency exists, further check the upgrade count; the two are often nested together to unlock content in tiers.
  • [has_done_agency_upgrade](/wiki/trigger/has_done_agency_upgrade): When combined with this trigger, you can establish a dual threshold of "agency established + specific upgrade completed," used for advanced espionage events or decision available checks.
  • [any_operative_leader](/wiki/trigger/any_operative_leader): After confirming the intelligence agency exists, check whether the nation has operative personnel; commonly seen in comprehensive conditional blocks that determine whether a nation's spy network is operationally capable.

Common Pitfalls

  1. Mixed positive and negative logic: Beginners sometimes forget to write has_intelligence_agency = no in the prerequisites of a create_intelligence_agency effect, causing the script to attempt creating an agency for nations that already have one, triggering silent errors or agency data corruption; always use this trigger as a protective check first.
  2. Scope object errors: When used inside loop blocks like any_allied_country / any_neighbor_country, the trigger automatically switches to the child nation scope and requires no manual target specification; beginners often add the ROOT:has_intelligence_agency syntax by mistake, resulting in checking the root nation instead of the loop target.