Wiki

effect · upgrade_intelligence_agency

Definition

  • Supported scope:COUNTRY
  • Supported target:none

Description

add an upgrade to the Intelligence Agency (must be created):
upgrade_intelligence_agency = upgrade_army_department

实战 · 配合 · 坑

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

实战用法

upgrade_intelligence_agency 常用于国策、决议或事件中,当玩家完成特定情报线研究条件后,自动为其情报机构解锁指定升级模块,省去手动点击的步骤。例如在一个强化间谍系统的 mod 里,可以把原本需要手动购买的升级绑定到国策完成事件上,提升剧本沉浸感。

focus = {
    id = GER_strengthen_intelligence
    ...
    completion_reward = {
        # 先确保机构存在,再添加升级
        create_intelligence_agency = { name = "Abwehr" }
        upgrade_intelligence_agency = upgrade_army_department
    }
}

配合关系

  • [create_intelligence_agency](/wiki/effect/create_intelligence_agency):情报机构必须先存在才能添加升级,两者几乎总是成对出现;若机构尚未创建就调用本 effect,指令将无效。
  • [has_done_agency_upgrade](/wiki/trigger/has_done_agency_upgrade):在添加升级前用此触发器检查目标升级是否已获取,避免重复赋予同一升级导致逻辑混乱。
  • [agency_upgrade_number](/wiki/trigger/agency_upgrade_number):可在 limit 块中用来限定当前升级数量达到某门槛时才触发,精确控制升级节奏。
  • [add_ideas](/wiki/effect/add_ideas):常与本 effect 同时使用,通过额外 idea 为情报机构升级提供对应的数值加成或剧本 buff,形成完整的情报强化奖励包。

常见坑

  1. 机构未创建即调用:最常见的错误是直接在 effect 块中写 upgrade_intelligence_agency 而未先确认情报机构已存在(未调用 create_intelligence_agency 或玩家从未建立机构)。此时指令会静默失败,不报错但升级不生效,调试时极难发现。
  2. 升级标识符拼写错误:升级名称(如 upgrade_army_department)来自 intelligence_agency_upgrades 的定义文件,若 mod 中自定义了新升级却拼错 key,游戏同样静默忽略,务必对照定义文件逐字核对。

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

upgrade_intelligence_agency is commonly used in national focuses, decisions, or events to automatically unlock specified intelligence agency upgrade modules for the player upon completion of certain intelligence research conditions, eliminating the need for manual clicking. For example, in a mod that enhances the espionage system, you can bind upgrades that originally required manual purchase to focus completion events, improving scenario immersion.

focus = {
    id = GER_strengthen_intelligence
    ...
    completion_reward = {
        # Ensure the agency exists first before adding the upgrade
        create_intelligence_agency = { name = "Abwehr" }
        upgrade_intelligence_agency = upgrade_army_department
    }
}

Synergy

  • [create_intelligence_agency](/wiki/effect/create_intelligence_agency): The intelligence agency must exist before upgrades can be added; these two effects are nearly always used together. If the agency has not been created when this effect is called, the command will have no effect.
  • [has_done_agency_upgrade](/wiki/trigger/has_done_agency_upgrade): Check whether the target upgrade has already been obtained using this trigger before adding upgrades, to avoid assigning the same upgrade multiple times and causing logic conflicts.
  • [agency_upgrade_number](/wiki/trigger/agency_upgrade_number): Can be used in limit blocks to restrict triggering only when the current number of upgrades reaches a certain threshold, precisely controlling the upgrade pace.
  • [add_ideas](/wiki/effect/add_ideas): Commonly used together with this effect to provide corresponding numerical bonuses or scenario buffs to intelligence agency upgrades through additional ideas, forming a complete intelligence enhancement reward package.

Common Pitfalls

  1. Calling the command before the agency is created: The most common mistake is writing upgrade_intelligence_agency directly in an effect block without first confirming that the intelligence agency exists (either create_intelligence_agency was not called or the player never established an agency). In this case, the command will silently fail without error messages, and the upgrade will not take effect, making it extremely difficult to debug.
  2. Upgrade identifier misspelling: Upgrade names (such as upgrade_army_department) come from the definition file of intelligence_agency_upgrades. If you define a new upgrade in your mod but misspell the key, the game will similarly ignore it silently. Be sure to cross-check against the definition file character by character.