Hands-On Usage
every_active_scientist is commonly used in research-system mods to batch-apply traits, grant experience, or adjust levels to all currently active (assigned) scientists in a country — for example, rewarding all on-duty scientists upon completing a focus. You can also use random_select_amount to implement a limited-reward mechanic that randomly selects only a certain number of scientists to benefit.
# After a focus completes, add a research trait and grant XP to at most 2 active scientists
GER = {
every_active_scientist = {
tooltip = ger_scientist_bonus_tt
random_select_amount = 2
limit = {
is_active_scientist = yes
}
add_scientist_trait = {
slot = scientist_trait_slot_1
}
add_scientist_xp = 50
}
}
Synergy
- is_active_scientist: Use inside a
limit block to ensure only scientists who are genuinely active are selected, preventing unintended effects on unassigned characters.
- add_scientist_trait: The most common batch-operation target — uniformly assigns a specific research trait to all qualifying scientists.
- add_scientist_xp: Grants experience to active scientists in bulk; ideal for triggering rewards at research milestones or focus nodes.
- has_trait: Further filters inside a
limit block to apply effects only to scientists who do (or do not) possess a specific trait, enabling precise targeted operations.
Common Pitfalls
- Omitting
limit leads to an overly broad scope: Without a limit block, the effect applies to every active scientist. When combined with random_select_amount and a small pool, the result may not feel as "random" as intended. It is recommended to always specify limit conditions explicitly — even just is_active_scientist = yes improves both readability and safety.
- Using
every_active_scientist outside a country scope: Although this effect supports any scope, it searches the scientist list belonging to the current country scope. If the outer scope has inadvertently switched to a state or province level without switching back, no scientists will be found and the effect will silently do nothing — no error is thrown.