Wiki

trigger · is_cryptology_department_active

Definition

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

Description

has country an active cryptology department

实战 · 配合 · 坑

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

实战用法

当 mod 涉及情报/密码战系统时,常用此 trigger 检查某国是否已建立并激活了密码学部门,以此作为解锁特定决策、事件或科技奖励的前置条件。例如,可以限制某个情报强化决策仅在密码学部门运转时才可使用:

available = {
    is_cryptology_department_active = yes
    has_army_experience > 50
}

配合关系

  • [has_completed_focus](/wiki/trigger/has_completed_focus):常配合检查某国是否完成了建立情报机构的国策,再结合密码学部门是否激活,双重确认情报体系是否就位。
  • [agency_upgrade_number](/wiki/trigger/agency_upgrade_number):密码学部门通常与情报机构升级级别挂钩,两者联合使用可精确限定情报类决策的触发条件。
  • [add_decryption](/wiki/effect/add_decryption):在密码学部门激活的前提下才执行解密加成 effect,逻辑上保证效果不会在部门缺失时错误触发。
  • [compare_intel_with](/wiki/trigger/compare_intel_with):配合用于判断在密码学部门激活后己方情报优势是否达到阈值,为情报博弈类事件提供完整的条件链。

常见坑

  1. 将 yes/no 混淆:新手有时写成 is_cryptology_department_active = no 来表示"没有密码学部门",逻辑上可行,但要注意该 trigger 仅适用于 COUNTRY scope,若在 state 或 character scope 下直接调用会导致脚本报错或静默失败,务必确保外层 scope 是国家。
  2. 与情报机构存在性混淆is_cryptology_department_active 检查的是密码学部门是否激活,而不是情报机构是否存在。若情报机构根本未创建,此 trigger 同样返回假,但错误提示不明显,应先用相关情报机构 trigger 确认机构已建立,再检查密码学部门状态,避免逻辑链断裂。

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

When a mod involves intelligence/cryptography systems, this trigger is commonly used to check whether a country has established and activated a cryptology department, serving as a prerequisite for unlocking specific decisions, events, or technology rewards. For example, you can restrict a certain intelligence-enhancement decision to only be available when the cryptology department is operational:

available = {
    is_cryptology_department_active = yes
    has_army_experience > 50
}

Synergy

  • [has_completed_focus](/wiki/trigger/has_completed_focus): Often paired with checking whether a country has completed the national focus for establishing an intelligence agency, then combined with verifying whether the cryptology department is activated, to double-confirm that the intelligence system is in place.
  • [agency_upgrade_number](/wiki/trigger/agency_upgrade_number): The cryptology department is typically tied to the upgrade level of the intelligence agency; using both together allows precise control over the trigger conditions for intelligence-related decisions.
  • [add_decryption](/wiki/effect/add_decryption): Execute the decryption bonus effect only when the cryptology department is activated, logically ensuring the effect won't trigger erroneously when the department is absent.
  • [compare_intel_with](/wiki/trigger/compare_intel_with): Used in combination to determine whether your intelligence advantage meets the threshold after the cryptology department is activated, providing a complete condition chain for intelligence-game events.

Common Pitfalls

  1. Confusing yes/no values: Beginners sometimes write is_cryptology_department_active = no to mean "no cryptology department exists," which is logically sound, but note that this trigger only applies to COUNTRY scope; calling it directly under state or character scope will cause script errors or silent failures. Always ensure the outer scope is a country.
  2. Confusing with intelligence agency existence: is_cryptology_department_active checks whether the cryptology department is activated, not whether the intelligence agency exists. If the intelligence agency has never been created, this trigger will also return false, but the error message is not obvious. You should first use relevant intelligence agency triggers to confirm the agency is established, then check the cryptology department status, avoiding breaks in the logic chain.