Hands-On Usage
every_operative is commonly used in spy-system mods — for example, bulk-upgrading skills, adding traits, or clearing specific flags for all of a country's operatives when an event fires. It also works with random_select_amount to randomly select a subset of operatives for rewards or punishments, making it well-suited for storylines like "some operatives are recalled after an intelligence leak."
GER = {
every_operative = {
tooltip = ger_operative_purge_tt
random_select_amount = 3
limit = {
is_operative = yes
has_trait = operative_tough
}
add_trait = { trait = operative_well_connected }
add_skill_level = 1
}
}
Synergy
- is_operative — Used inside a
limit block to ensure only operative characters are targeted, preventing accidental hits when other character scopes are in play.
- has_trait — Commonly placed in
limit to filter operatives precisely by traits they already possess.
- add_unit_leader_trait — Pairs with
every_operative to bulk-add unit leader traits to qualifying operatives, enabling collective capability upgrades.
- kill_operative — Used in event punishment logic to eliminate operatives who meet certain conditions; combine with
limit to control scope and avoid unintended removals.
Common Pitfalls
- Forgetting the
is_operative restriction causes scope errors: every_operative in a COUNTRY scope iterates over all characters. If limit does not include is_operative = yes, operative-exclusive effects such as kill_operative applied to non-operative characters will either fail silently or throw an error. Always explicitly restrict the scope inside limit.
- Assuming OPERATION scope behaves the same as COUNTRY scope: When
every_operative is called from an OPERATION scope, it only iterates over the operatives participating in that specific operation — not all operatives belonging to the country. Never swap scripts written for one scope directly into the other, as the resulting selection sets will be entirely different.