Wiki

trigger · is_active_scientist

Definition

  • Supported scope:CHARACTER
  • Supported target:any

Description

Checks if the scientist of the character in scope is assigned to a project
is_scientist_active = <bool>
ex: my_character = {
        is_scientist_active = yes
        is_scientist_active = no
	}

实战 · 配合 · 坑

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

实战用法

is_active_scientist 常用于科研系统相关 mod 中,当你需要根据某位角色是否正在主导研究项目来决定是否允许触发事件、执行效果或解锁选项时使用。例如,防止对一个正忙于项目的科学家重复分配任务,或仅在科学家空闲时才允许受伤:

# 仅当科学家未在执行项目时才可触发受伤事件
some_scientist_character = {
    limit = {
        is_active_scientist = no
    }
    injure_scientist_for_days = 30
}

配合关系

  • [is_scientist_injured](/wiki/trigger/is_scientist_injured):与 is_active_scientist 组合使用,可同时判断科学家的"忙碌"与"受伤"两种状态,构建更精确的可用性条件。
  • [injure_scientist_for_days](/wiki/effect/injure_scientist_for_days):在确认科学家当前未参与项目(is_active_scientist = no)的前提下再执行受伤效果,避免逻辑矛盾。
  • [has_scientist_level](/wiki/trigger/has_scientist_level):常与本 trigger 共同用在 available 块中,同时检查科学家的等级与活跃状态,确保只有符合条件的闲置科学家才能触发特定机制。
  • [add_scientist_xp](/wiki/effect/add_scientist_xp):可在科学家完成项目、状态从 active 变为 inactive 后奖励经验,通过本 trigger 作为前置判断门槛。

常见坑

  1. scope 写错:本 trigger 必须在 CHARACTER scope 下使用,直接写在国家 scope 或事件根 scope 里会静默失败(不报错但永远返回假),务必先用 some_character = { } 进入角色 scope 再使用。
  2. 混淆"active"含义is_active_scientist = yes 表示该角色正在被分配到某个研究项目,并不代表角色是科学家类型本身——若角色根本没有科学家角色(未经 add_scientist_role),该 trigger 同样会返回 no,需先用 [has_advisor_role](/wiki/trigger/has_advisor_role) 或相关条件确认角色身份。

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_active_scientist is commonly used in science system-related mods. Use it when you need to decide whether to trigger events, execute effects, or unlock options based on whether a character is currently leading a research project. For example, prevent reassigning tasks to a scientist busy with a project, or only allow injuries when the scientist is idle:

# Trigger injury event only when scientist is not executing a project
some_scientist_character = {
    limit = {
        is_active_scientist = no
    }
    injure_scientist_for_days = 30
}

Synergy

  • [is_scientist_injured](/wiki/trigger/is_scientist_injured): Use in combination with is_active_scientist to simultaneously check both the "busy" and "injured" states of a scientist, building more precise availability conditions.
  • [injure_scientist_for_days](/wiki/effect/injure_scientist_for_days): Execute the injury effect only after confirming the scientist is not currently involved in a project (is_active_scientist = no), avoiding logical contradictions.
  • [has_scientist_level](/wiki/trigger/has_scientist_level): Commonly used together with this trigger in available blocks to check both the scientist's level and active status simultaneously, ensuring only idle scientists meeting the conditions can trigger specific mechanics.
  • [add_scientist_xp](/wiki/effect/add_scientist_xp): Can reward experience after a scientist completes a project and their status changes from active to inactive, using this trigger as a prerequisite validation gate.

Common Pitfalls

  1. Incorrect scope: This trigger must be used under CHARACTER scope. Placing it directly in a country scope or event root scope will fail silently (no error but always returns false). Always use some_character = { } to enter character scope before using it.
  2. Confusion about "active" meaning: is_active_scientist = yes means the character is currently assigned to a research project, not that the character is a scientist type itself. If the character has no scientist role at all (not assigned via add_scientist_role), this trigger will also return no. First confirm the character's role with [has_advisor_role](/wiki/trigger/has_advisor_role) or related conditions.