trigger · is_decrypting
Definition
- Supported scope:
COUNTRY - Supported target:
THIS,ROOT,PREV,FROM,OWNER,CONTROLLER,OCCUPIED,CAPITAL
Description
checks if is currently decrypting a cipher. Example is_decrypting = GER
is_decryptingCOUNTRYTHIS, ROOT, PREV, FROM, OWNER, CONTROLLER, OCCUPIED, CAPITALchecks if is currently decrypting a cipher. Example is_decrypting = GER
实战内容由 AI 生成,并已对照 vanilla 命令词表校验 —— 请当作起点而非权威依据。上方的定义节才是游戏自带文档原文。
is_decrypting 常用于情报战相关 mod 中,判断本国或目标国当前是否正在对某国密码进行破译,从而触发特定决策、事件或解锁特殊选项。例如,可以在决策的 available 块中限制只有当玩家已对德国发起破译时才能启用某项情报行动:
available = {
is_decrypting = GER
}
也可以在事件触发条件中检查某友国是否正在对共同敌人实施破译,以提供外交互动选项。
[decryption_progress](/wiki/trigger/decryption_progress):破译进度常与"是否在破译"同时检查,先用 is_decrypting 确认破译行为存在,再用 decryption_progress 判断进度达到阈值后触发奖励或事件。[add_decryption](/wiki/effect/add_decryption):作为 effect 端的搭档,当 is_decrypting 为假时,可通过该 effect 主动增加破译值,形成"未破译则补充资源"的逻辑闭环。[compare_intel_with](/wiki/trigger/compare_intel_with):情报系统中常联用,破译进行中时进一步对比双方情报优劣,决定是否触发额外情报增益事件。[has_country_flag](/wiki/trigger/has_country_flag):用于防止事件重复触发——先检查 flag 是否已设置,再结合 is_decrypting 确认破译状态,避免同一破译周期内重复弹出事件。is_decrypting 需要在 COUNTRY scope 下使用,新手有时误写在 STATE scope(如 owned_by 子块内部)里,导致脚本静默失败或报错;务必确认外层 scope 是国家而非省份/州。GER)或支持的 scope 关键字(THIS/ROOT 等),有些新手误写成变量引用或直接留空,导致条件永远不满足。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.
is_decrypting is commonly used in intelligence-focused mods to check whether the current nation or a target nation is actively decrypting another nation's codes, triggering specific decisions, events, or unlocking special options. For example, you can restrict a decision's available block so it only activates when the player has initiated decryption against Germany:
available = {
is_decrypting = GER
}
You can also check in event trigger conditions whether an allied nation is conducting decryption against a common enemy, enabling diplomatic interaction options.
[decryption_progress](/wiki/trigger/decryption_progress): Decryption progress is often checked alongside "whether decryption is active"—use is_decrypting first to confirm decryption exists, then use decryption_progress to judge if the progress reaches a threshold before triggering rewards or events.[add_decryption](/wiki/effect/add_decryption): As the effect counterpart, when is_decrypting returns false, you can actively increase decryption value via this effect, creating a closed logic loop of "supply resources if not decrypting."[compare_intel_with](/wiki/trigger/compare_intel_with): Frequently paired in the intelligence system—while decryption is ongoing, further compare relative intelligence advantages between nations to decide whether to trigger additional intelligence gain events.[has_country_flag](/wiki/trigger/has_country_flag): Used to prevent event repetition—check if a flag is already set first, then combine with is_decrypting to confirm decryption status, avoiding duplicate event popups within the same decryption cycle.is_decrypting must be used within a COUNTRY scope. Beginners sometimes mistakenly place it in STATE scope (such as inside owned_by blocks), causing silent script failures or errors. Always verify the outer scope is a nation, not a province or state.GER) or supported scope keywords (THIS/ROOT etc.). Some beginners mistakenly use variable references or leave it empty, causing the condition to never be satisfied.