Wiki

trigger · any_scientist

Definition

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

Description

Checks if at least one scientist of the Country in scope matches the triggers. 
tooltip=key can be defined to override title.
ex: GER = {
  any_scientist = {
	tooltip = my_loc_key # Optional
    ... Character scope triggers ...
  }
}

实战 · 配合 · 坑

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

实战用法

常用于检测某国是否拥有具备特定特质或等级的科学家,例如解锁科研事件或判断某项目是否可启动。也可在 available 块中限制决策,要求至少有一名科学家满足条件才能触发。

# 检测德国是否有一名拥有特定特质且达到一定等级的科学家
GER = {
    any_scientist = {
        has_scientist_level = {
            level > 3
        }
        has_trait = scientist_trait_rocketry_specialist
    }
}

配合关系

  • has_trait:与 any_scientist 内部配合,筛选具有特定科学家特质的角色,是最常见的内层条件。
  • has_scientist_level:在 any_scientist 内部判断科学家等级,用于区分高级与低级科学家。
  • is_active_scientist:配合使用可进一步限定科学家必须处于激活状态,避免将未分配的科学家纳入判断。
  • every_scientist:当 any_scientist 确认存在目标科学家后,常在 effect 侧使用 every_scientist 对所有符合条件的科学家批量施加效果。

常见坑

  1. scope 用错any_scientist 只能在 COUNTRY scope 下使用,直接写在 state scope 或 character scope 中会导致触发器静默失败或报错,需先切换到国家 scope。
  2. 内层 trigger 与 effect 混用any_scientist = { ... } 内部只能写 character scope 的 trigger,新手容易把 add_scientist_trait 等 effect 命令误写进去,正确做法是把 effect 放到 every_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

Commonly used to check whether a country has a scientist with a specific trait or level — for example, to unlock research events or determine whether a project can be initiated. It can also be used inside an available block to restrict a decision, requiring at least one scientist to meet the conditions before it can trigger.

# Check whether Germany has a scientist with a specific trait and above a certain level
GER = {
    any_scientist = {
        has_scientist_level = {
            level > 3
        }
        has_trait = scientist_trait_rocketry_specialist
    }
}

Synergy

  • has_trait: Used inside any_scientist to filter characters with a specific scientist trait — the most common inner condition.
  • has_scientist_level: Used inside any_scientist to evaluate a scientist's level, allowing you to distinguish between senior and junior scientists.
  • is_active_scientist: Can be combined to further restrict the check to scientists who are currently active, preventing unassigned scientists from being counted.
  • every_scientist: Once any_scientist confirms that a matching scientist exists, every_scientist is typically used on the effect side to apply effects in bulk to all scientists meeting the criteria.

Common Pitfalls

  1. Wrong scope: any_scientist can only be used within a COUNTRY scope. Writing it directly inside a state scope or character scope will cause the trigger to silently fail or throw an error — you must switch to a country scope first.
  2. Mixing triggers and effects in the inner block: The contents of any_scientist = { ... } must be trigger conditions scoped to a character. Beginners often mistakenly write effect commands such as add_scientist_trait inside it. The correct approach is to handle effects in an every_scientist block instead.