Hands-On Usage
create_operative_leader is commonly used in scenario events and focus tree completions to generate exclusive operatives for the player's nation—for example, creating preset operatives based on historical figures for specific countries, or using bypass_recruitment to skip the recruitment queue and deploy them directly. In espionage system mods, it's also frequently used to dynamically generate covert personnel with specific portraits and genders, integrating with intelligence agency growth narratives.
# Generate a historically-based operative for the Soviet Union upon focus completion
focus = {
id = SOV_famous_spy
...
completion_reward = {
create_operative_leader = {
bypass_recruitment = no
available_to_spy_master = yes
portrait_tag_override = SOV
gfx = GFX_portrait_alexander_rado
gender = male
traits = { operative_infiltrator }
name = "Alexander Rado"
}
}
}
Synergy
[create_intelligence_agency](/wiki/effect/create_intelligence_agency): Operatives depend on the existence of an intelligence agency; typically establish the agency before generating operatives, otherwise the operative will have no organizational home.
[has_completed_focus](/wiki/trigger/has_completed_focus): Used as a trigger condition to ensure historical operatives are only created after specific focus tree completion, maintaining narrative consistency.
[add_ideas](/wiki/effect/add_ideas): Often used together in the same event option, granting the nation relevant espionage idea bonuses when generating operatives, strengthening coherence in espionage-focused mods.
[any_operative_leader](/wiki/trigger/any_operative_leader): Used to check if operatives of the same type already exist, preventing duplicate generation; combine with limit blocks for pre-filtering.
Common Pitfalls
- Overlooking the interaction between
bypass_recruitment and available_to_spy_master: When bypass_recruitment = no, the operative enters the recruitment pool rather than becoming directly available. If available_to_spy_master is simultaneously set to no, the operative becomes permanently unusable—it cannot be recruited nor directly deployed, effectively vanishing. Ensure both fields work together according to your intended design.
- Calling this command without establishing an intelligence agency: If the target nation has not yet created an intelligence agency via
create_intelligence_agency, directly generating operatives may cause script errors or orphaned operative data. It's recommended to verify agency existence beforehand using [has_done_agency_upgrade](/wiki/trigger/has_done_agency_upgrade) or related triggers.