Wiki

trigger · is_researching_technology

Definition

  • Supported scope:COUNTRY
  • Supported target:none

Description

Checks if the country is currently researching a specific technology.
Example: is_researching_technology = mechanised_infantry

实战 · 配合 · 坑

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

实战用法

is_researching_technology 常用于在某项研究进行中时动态解锁决策、触发事件或给予奖励,例如当国家正在研究某一坦克科技时弹出情报事件或加速进度。也可用于 AI 策略的 limit 块,避免 AI 重复触发与研究相关的行为。

# 当国家正在研究机械化步兵时,才允许激活某个特定决策
available = {
    is_researching_technology = mechanised_infantry
}

配合关系

  • [can_research](/wiki/trigger/can_research):先用 can_research 确认该科技是否合法可研,再用 is_researching_technology 确认是否已经在队列中,两者配合避免逻辑空洞。
  • [add_tech_bonus](/wiki/effect/add_tech_bonus):在研究进行中奖励科研加成,配合 is_researching_technology 作为触发条件,实现"研究中追加 buff"的设计。
  • [has_completed_focus](/wiki/trigger/has_completed_focus):常见组合是先判断某国策已完成,再判断是否正在研究对应科技,构建层级解锁条件。
  • [amount_research_slots](/wiki/trigger/amount_research_slots):与研究槽数量条件并列使用,确保国家在资源充足时才触发相关奖励或事件。

常见坑

  1. 把它当"已研究完成"来用is_researching_technology 只检查正在研究中(即占用研究槽),不代表该科技已经解锁完毕;若要判断科技是否已研完,应使用 has_tech(注意:has_tech 不在本 scope 白名单内,但属于游戏内置 trigger,请勿与本 trigger 混淆)。
  2. 填写科技 key 错误:科技名必须与 technologies 文件夹中定义的 token 完全一致(区分大小写),填写显示名称或本地化字符串会导致条件永远返回假且不报错,极难排查。

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

is_researching_technology is commonly used to dynamically unlock decisions, trigger events, or grant rewards while a particular technology is being researched. For example, you can pop an intelligence event or accelerate research progress when a nation is researching a specific tank technology. It can also be used in the limit block of AI strategies to prevent the AI from repeatedly triggering research-related behaviors.

# Only allow activating a specific decision when the country is researching mechanised infantry
available = {
    is_researching_technology = mechanised_infantry
}

Synergy

  • [can_research](/wiki/trigger/can_research): First use can_research to confirm whether the technology is legally researchable, then use is_researching_technology to confirm whether it's already in the queue. Using both together avoids logical gaps.
  • [add_tech_bonus](/wiki/effect/add_tech_bonus): Award research bonuses while research is in progress, using is_researching_technology as the trigger condition to implement the "add buff during research" design pattern.
  • [has_completed_focus](/wiki/trigger/has_completed_focus): A common combination is to first check if a certain national focus is completed, then check whether the corresponding technology is being researched, creating hierarchical unlock conditions.
  • [amount_research_slots](/wiki/trigger/amount_research_slots): Use alongside research slot quantity conditions to ensure the nation triggers relevant rewards or events only when resources are sufficient.

Common Pitfalls

  1. Using it as "already researched": is_researching_technology only checks if a technology is currently being researched (i.e., occupying a research slot), not whether it has been fully unlocked. To determine if a technology has been completed, use has_tech instead (note: has_tech is not on this scope's whitelist, but it is a built-in game trigger—do not confuse it with this trigger).
  2. Incorrect technology key: The technology name must exactly match the token defined in the technologies folder (case-sensitive). Using display names or localization strings will cause the condition to always return false without error, making it extremely difficult to debug.