Wiki

effect · add_decryption

Definition

  • Supported scope:COUNTRY
  • Supported target:none

Description

add decryption against a target country. Example:
add_decryption = { 
 target = GER 
 # pick one amount = 1000 # a flat amount to be added
 ratio = 0.3 # a ratio of crypto defense of target to be added

实战 · 配合 · 坑

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

实战用法

add_decryption 常用于谍报系统相关的 mod 场景,例如国家焦点、决策或事件完成后为己方提供对特定敌国的密码破译进度,帮助快速打开情报优势。典型场景是当玩家建立情报机构并完成特定升级后,通过事件奖励一次性推进对目标国的破译进度。

country_event = {
    id = spy_ops.5
    title = spy_ops.5.t
    option = {
        name = spy_ops.5.a
        # 对德国加一定比例的破译进度
        add_decryption = {
            target = GER
            ratio = 0.25
        }
    }
}

配合关系

  • [decryption_progress](/wiki/trigger/decryption_progress) — 在使用 add_decryption 之前或之后,用此触发器检测当前对目标国的破译进度百分比,从而决定是否继续给予额外加成或触发后续事件。
  • [add_intel](/wiki/effect/add_intel) — 情报类 mod 中二者常配对使用,add_decryption 提升密码破译进度,add_intel 则直接增加对目标国的情报量,共同构成完整的情报收益奖励。
  • [create_intelligence_agency](/wiki/effect/create_intelligence_agency) — 通常在确保己方已建立情报机构的前提下再施加破译加成,避免效果在无情报机构时白费,因此常见于先创建机构再执行破译的脚本流程中。
  • [compare_intel_with](/wiki/trigger/compare_intel_with) — 用于在赋予破译进度后判断情报差距是否达到某个阈值,以驱动后续的奖惩分支逻辑。

常见坑

  1. amountratio 同时填写:二者只能选其一,若同时写入脚本,游戏只会读取其中一个(行为不可预期),新手常因此得到与预期不符的破译量,务必二选一并注释掉另一个。
  2. target 填写了不存在或已亡国的国家target 必须是当前游戏中存在的国家 TAG,若目标国已被消灭或尚未在游戏中生成,效果会静默失败且不报错,导致调试时难以发现问题,建议配合 [exists](/wiki/trigger/exists) 先做存在性检查。

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

add_decryption is commonly used in espionage-related mod scenarios, such as granting decryption progress against a specific enemy nation after completing national focuses, decisions, or events. This helps establish intelligence advantage quickly. A typical use case is when a player establishes an intelligence agency and completes specific upgrades, then receives a one-time decryption progress boost against a target nation via an event reward.

country_event = {
    id = spy_ops.5
    title = spy_ops.5.t
    option = {
        name = spy_ops.5.a
        # Add a percentage of decryption progress against Germany
        add_decryption = {
            target = GER
            ratio = 0.25
        }
    }
}

Synergy

  • [decryption_progress](/wiki/trigger/decryption_progress) — Before or after using add_decryption, use this trigger to check the current decryption progress percentage against the target nation, allowing you to decide whether to grant additional bonuses or trigger subsequent events.
  • [add_intel](/wiki/effect/add_intel) — These two effects are frequently paired together in intelligence mods. add_decryption increases decryption progress while add_intel directly increases intelligence quantity against the target nation, forming a complete intelligence reward package.
  • [create_intelligence_agency](/wiki/effect/create_intelligence_agency) — Typically used to ensure your nation has an intelligence agency before applying decryption bonuses, avoiding wasted effects when no agency exists. This is commonly seen in script sequences that create the agency first before executing decryption.
  • [compare_intel_with](/wiki/trigger/compare_intel_with) — Used to determine whether the intelligence gap reaches a certain threshold after granting decryption progress, driving subsequent reward or penalty branching logic.

Common Pitfalls

  1. Filling in both amount and ratio simultaneously — Only one can be used. If both are written in the script, the game will only read one (behavior is unpredictable), and newcomers often end up with unexpected decryption amounts. Always choose one and comment out the other.
  2. Target contains a non-existent or already-eliminated nationtarget must be a valid nation TAG that exists in the current game. If the target nation has been eliminated or has not yet spawned in the game, the effect will silently fail without error, making debugging difficult. It is recommended to use [exists](/wiki/trigger/exists) first to verify existence.