Wiki

trigger · is_special_project_being_researched

Definition

  • Supported scope:COUNTRY
  • Supported target:none

Description

Checks if the country in scope is currently researching the special project in input.
ex:
SOV = {
	is_special_project_being_researched = sp:my_project
	is_special_project_being_researched = var:my_project_var
	is_special_project_being_researched = PREV # accepts variables and keywords
}

实战 · 配合 · 坑

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

实战用法

当你制作一个特殊项目系统相关的 mod 时,常需要根据某项目是否正在被研究来决定其他决议或焦点是否可用——例如禁止同时启动两个互斥的特殊项目,或在项目研究期间才激活某个辅助决策。下面是一个典型用法:

# 当某互斥项目正在研究时,禁止另一个项目被选取
available = {
    NOT = {
        is_special_project_being_researched = sp:nuclear_bomb_project
    }
}

配合关系

  • has_completed_focus:常与之搭配,先检查是否完成了解锁特殊项目的国策,再判断该项目是否正在研究,形成前置条件链。
  • complete_special_project:在 effect 块中使用,当 trigger 检测到项目正在研究后触发强制完成,可用于事件奖励或调试脚本。
  • has_country_flag:在项目研究期间设置国家标志,然后通过该 trigger 组合判断当前研究状态,实现更精细的流程控制。
  • any_active_scientist:特殊项目通常需要科学家参与,配合此 trigger 可同时验证科学家状态与项目进行状态,防止逻辑漏洞。

常见坑

  1. 忘记使用 sp: 前缀:直接写项目名(如 = my_project)而不加 sp: 前缀会导致脚本无法识别目标,trigger 始终返回假且不报错,极难排查;必须写成 sp:my_project 或使用变量形式 var:my_project_var
  2. 在非 COUNTRY scope 下调用:此 trigger 仅支持 COUNTRY scope,若在 STATE 或 CHARACTER 等 scope 内直接使用,游戏不会正确求值,需要用 ROOT/FROM 等关键字先切换回正确的国家 scope 再调用。

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 creating a mod related to special project systems, you often need to decide whether other decisions or focuses are available based on whether a particular project is being researched—for example, preventing two mutually exclusive special projects from being activated simultaneously, or only enabling a supporting decision while a project is being researched. Below is a typical usage pattern:

# Prevent another project from being selected when a mutually exclusive project is being researched
available = {
    NOT = {
        is_special_project_being_researched = sp:nuclear_bomb_project
    }
}

Synergy

  • has_completed_focus: Commonly paired together; first check if the focus unlocking the special project has been completed, then determine if the project is being researched, forming a chain of prerequisites.
  • complete_special_project: Used within effect blocks; after the trigger detects that a project is being researched, trigger forced completion, useful for event rewards or debugging scripts.
  • has_country_flag: Set a country flag during project research, then use this trigger in combination to judge the current research status, enabling more granular control flow.
  • any_active_scientist: Special projects typically require scientist participation; pairing with this trigger allows simultaneous verification of scientist status and project progress status, preventing logical gaps.

Common Pitfalls

  1. Forgetting the sp: prefix: Writing the project name directly (such as = my_project) without the sp: prefix causes the script to fail to recognize the target, the trigger always returns false without error reporting, and is extremely difficult to debug; must be written as sp:my_project or use variable form var:my_project_var.
  2. Calling outside COUNTRY scope: This trigger only supports COUNTRY scope; if used directly within STATE or CHARACTER scope, the game will not evaluate correctly. You must use keywords like ROOT/FROM to switch back to the correct country scope before calling it.