Hands-On Usage
num_free_operative_slots is commonly used in the available block of intelligence agency–related events or decisions to ensure the player actually has available operative slots before executing "deploy operative" type decisions, preventing logic breaks when recruitment fails after triggering. It can also be used in AI strategy triggers, allowing the AI to attempt recruiting new operatives only when capacity is available.
# Decision: Deploy Secret Operative
available = {
has_intelligence_agency = yes
num_free_operative_slots > 0
}
Synergy
[any_operative_leader](/wiki/trigger/any_operative_leader) — Often paired together; first check if free slots are available, then use any_operative_leader to filter operatives by specific type or traits, ensuring both conditions are met before unlocking subsequent logic.
[create_operative_leader](/wiki/effect/create_operative_leader) — Execute the operative creation effect only when free slots are greater than zero; otherwise the creation operation will silently fail or produce unexpected behavior.
[has_intelligence_agency](/wiki/trigger/has_intelligence_agency) — Slots depend on the intelligence agency's existence; these two almost always appear together in prerequisite blocks. Without the intelligence agency, slot checks become meaningless.
[free_operative](/wiki/effect/free_operative) — When requiring a "free then replenish" logic pattern, first use this trigger to check if slots are already available; if not, use free_operative to vacate slots before proceeding.
Common Pitfalls
- Confusing "total slots" with "free slots":
num_free_operative_slots returns the number of slots immediately available for recruitment, not equal to the total slot limit. If all slots are occupied by active operatives, even if num_operative_slots returns a large value, this trigger may still evaluate to 0. Beginners often mistakenly treat the two as equivalent and skip this check.
- Using outside COUNTRY scope: This trigger only works in country scope. If accidentally placed inside sub-scopes like
any_operative_leader or any_owned_state, the game won't error but evaluation results become unpredictable. Always ensure it's called at the top-level country scope.