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
- 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.
- 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.