Wiki

effect · every_scientist

Definition

  • Supported scope:any
  • Supported target:none

Description

Executes children effects on every scientist (or \"random_select_amount\" of random character if specified) of the country in scope, that fulfills the \"limit\" trigger.
	tooltip=key can be added to override tooltip title.
	By default the effects are only displayed once, you may display them for each matching character with display_individual_scopes.
	ex: GER = {
	  every_scientist = {
		tooltip = my_loc_key # Optional
		random_select_amount = 3 # Optional
		include_invisible = yes # Optional - default = no
		display_individual_scopes = yes # Optional - default = no
		... character scope effects ...
	  }
	}

实战 · 配合 · 坑

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

实战用法

every_scientist 常用于 mod 中批量给某国所有科学家添加特质、提升等级或清除旗标,例如在科研系统重构 mod 里一键强化特定意识形态国家的科研人员。也可配合 random_select_amount 实现"随机抽取若干科学家受益"的事件效果,增加随机性。

# 给德国所有科学家添加一个科研特质,并提升等级(仅限未受伤的科学家)
GER = {
    every_scientist = {
        limit = {
            NOT = { is_scientist_injured = yes }
        }
        add_scientist_trait = { slot = research_speed }
        add_scientist_level = 1
    }
}

# 随机抽取2名科学家设置旗标,用于后续事件判断
every_scientist = {
    random_select_amount = 2
    set_character_flag = selected_for_event
}

配合关系

  • is_scientist_injured — 在 limit 中过滤掉受伤科学家,确保效果只作用于可用人员。
  • add_scientist_trait — 最常见的配套效果,用于批量给符合条件的科学家添加专业特质。
  • add_scientist_level — 与 every_scientist 搭配实现批量升级,常见于剧本奖励或国策完成后的批量强化。
  • set_character_flag — 为匹配的科学家打上旗标,供后续 has_character_flag 触发器识别,实现"标记后处理"的两阶段逻辑。

常见坑

  1. 忘记 limit 导致误伤:不加 limit 块时效果作用于该国所有科学家,若效果具有破坏性(如 injure_scientist_for_days),会影响全部科研人员,务必用 limit 精确筛选目标。
  2. random_scientist 混淆every_scientist 作用于全部符合条件的科学家(或 random_select_amount 指定数量),而 random_scientist 只随机选取一名;需要精确数量控制时应使用 random_select_amount 参数,而不是把两个 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

every_scientist is commonly used in mods to bulk-add traits, raise levels, or clear flags on all scientists belonging to a country. For example, a research-system overhaul mod might use it to instantly boost the researchers of nations with a specific ideology. It also pairs well with random_select_amount to create event effects where only a random subset of scientists benefit, adding an element of unpredictability.

# Add a research trait and raise the level of every uninjured German scientist
GER = {
    every_scientist = {
        limit = {
            NOT = { is_scientist_injured = yes }
        }
        add_scientist_trait = { slot = research_speed }
        add_scientist_level = 1
    }
}

# Randomly select 2 scientists and set a flag for use in follow-up event checks
every_scientist = {
    random_select_amount = 2
    set_character_flag = selected_for_event
}

Synergy

  • is_scientist_injured — Use inside limit to filter out injured scientists so the effect only applies to available personnel.
  • add_scientist_trait — The most common companion effect; bulk-assigns a specialist trait to all scientists who meet the conditions.
  • add_scientist_level — Pairs with every_scientist for mass level-ups, typically as a reward after completing a focus or scripted event.
  • set_character_flag — Stamps a flag on every matched scientist so a subsequent has_character_flag trigger can identify them, enabling a two-phase "mark then process" logic pattern.

Common Pitfalls

  1. Forgetting limit and hitting unintended targets: Without a limit block the effect applies to every scientist in the country. If the effect is destructive (e.g. injure_scientist_for_days), it will affect your entire research staff — always use limit to narrow the target pool precisely.
  2. Confusing every_scientist with random_scientist: every_scientist acts on all scientists that pass the limit (or the number specified by random_select_amount), whereas random_scientist picks only one at random. When you need exact quantity control, use the random_select_amount parameter rather than mixing the two scopes together.