Wiki

trigger · all_scientists

Definition

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

Description

Checks if all scientists of the Country in scope matches the triggers.
tooltip=key can be defined to override title.
ex: GER = {
  all_scientists = {
	tooltip = my_loc_key # Optional
     ... Character scope triggers ...
  }
}

实战 · 配合 · 坑

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

实战用法

all_scientists 常用于判断某国所有科学家是否满足特定条件,例如验证某个成就解锁条件(全员达到指定等级)、或在事件/决策的 available 块中确保没有任何科学家处于受伤状态再触发某项研究加速奖励。

# 决策:仅当德国所有科学家均未受伤且至少达到2级时才可用
GER_elite_science_decision = {
    available = {
        GER = {
            all_scientists = {
                NOT = { is_scientist_injured = yes }
                has_scientist_level = {
                    level > 1
                }
            }
        }
    }
}

配合关系

  • is_scientist_injured — 与 all_scientists 联用,检查是否存在任何受伤科学家,常用于保护性条件判断。
  • has_scientist_level — 在 all_scientists 内部检查每位科学家的等级,用于解锁需要全员达标的特殊事件或决策。
  • is_active_scientist — 配合 all_scientists 确认所有科学家均处于激活状态,避免对未激活角色的误判。
  • has_trait — 在 all_scientists 内部验证全员是否持有某一特定特质,常见于成就类 mod 的完成条件检查。

常见坑

  1. 作用域混淆all_scientists 只能在 COUNTRY scope 下调用,若在 character scope(如 every_scientist 的循环体内)直接再嵌套 all_scientists,会导致 scope 不正确甚至报错,需先用 ROOT/PREV 等跳回国家 scope 再调用。
  2. any_scientist 语义相反all_scientists 要求所有科学家满足条件才返回真,新手常误将"至少有一个科学家满足条件"的需求写成 all_scientists,正确做法应改用 any_of_scopes 搭配 every_scientist 或使用对应的 any_scientist 系列触发器。

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

all_scientists is commonly used to check whether all scientists of a country meet specific conditions — for example, verifying an achievement unlock requirement (all scientists reaching a specified level), or ensuring that no scientist is injured before triggering a research speed bonus in an event or decision's available block.

# Decision: only available when all German scientists are uninjured and at least level 2
GER_elite_science_decision = {
    available = {
        GER = {
            all_scientists = {
                NOT = { is_scientist_injured = yes }
                has_scientist_level = {
                    level > 1
                }
            }
        }
    }
}

Synergy

  • is_scientist_injured — Used alongside all_scientists to check whether any scientist is injured; commonly used as a protective condition guard.
  • has_scientist_level — Used inside all_scientists to check each scientist's level, enabling special events or decisions that require all scientists to meet a minimum threshold.
  • is_active_scientist — Combined with all_scientists to confirm that all scientists are in an active state, preventing false positives against inactive characters.
  • has_trait — Used inside all_scientists to verify that every scientist holds a specific trait; frequently seen in achievement-oriented mods as a completion condition check.

Common Pitfalls

  1. Scope confusion: all_scientists can only be called within a COUNTRY scope. If you nest all_scientists directly inside a character scope (e.g., inside the loop body of every_scientist), the scope will be incorrect and may cause errors. You must first return to the country scope using ROOT, PREV, or similar before calling it.
  2. Opposite semantics to any_scientist: all_scientists returns true only when every scientist satisfies the condition. Beginners often mistakenly use all_scientists when they actually mean "at least one scientist meets the condition." The correct approach is to use any_of_scopes with every_scientist, or use the corresponding any_scientist series trigger instead.