Wiki

effect · create_operative_leader

Definition

  • Supported scope:COUNTRY
  • Supported target:none

Description

create operative for country
create_operative_leader = {
	bypass_recruitment = no # whether the operative is directly added to the list of available operatives 
	available_to_spy_master = yes # whether the operative can be recruited by the spy master. Only makes sense if bypass_recruitment is 'no'.
	portrait_tag_override = TAG # when selectiong the portrait for the operative, consider that tag instead of the country the operative will operate for gfx = GFX_portrait_alexander_rado # specify the GFX entry that the portrait will be based on, otherwise a random one will be generated.
	# Additionally supports the common token to other create_x_leader effects
 gender = male # or female. If not defined in script a random gender will be applied.}

实战 · 配合 · 坑

实战内容由 AI 生成,并已对照 vanilla 命令词表校验 —— 请当作起点而非权威依据。上方的定义节才是游戏自带文档原文。

实战用法

create_operative_leader 常用于剧本事件、国策完成后为玩家国家生成一名专属特工,例如根据历史人物为特定国家添加预设特工,或通过 bypass_recruitment 直接跳过招募队列将其投入行动。在谍报系统 mod 中也常用于动态生成具有特定画像和性别的隐秘人员,配合情报机构成长叙事。

# 国策完成后,为苏联生成一名历史原型特工
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 = "亚历山大·拉多"
        }
    }
}

配合关系

  • [create_intelligence_agency](/wiki/effect/create_intelligence_agency):特工的存在依赖情报机构,通常先建立机构再生成特工,否则特工无处归属。
  • [has_completed_focus](/wiki/trigger/has_completed_focus):作为触发条件,确保只在特定国策完成后才生成历史特工,保证叙事逻辑。
  • [add_ideas](/wiki/effect/add_ideas):常在同一事件选项中一起使用,生成特工的同时赋予国家相关情报理念加成,强化谍报方向 mod 的连贯性。
  • [any_operative_leader](/wiki/trigger/any_operative_leader):用于检查是否已存在同类特工,避免重复生成,结合 limit 块做前置过滤。

常见坑

  1. 忽略 bypass_recruitmentavailable_to_spy_master 的联动关系:当 bypass_recruitment = no 时,特工进入招募池而非直接可用,此时若同时将 available_to_spy_master 设为 no,会导致该特工永远无法被招募也无法直接使用,相当于凭空消失;应确认两个字段的配合意图一致。
  2. 未建立情报机构就调用此命令:若目标国家尚未通过 create_intelligence_agency 建立情报机构,直接生成特工可能导致脚本报错或特工数据挂空,建议在执行前用 [has_done_agency_upgrade](/wiki/trigger/has_done_agency_upgrade) 或相关 trigger 先确认机构存在。

Hands-On Notes

Hands-on notes are AI-generated and checked against the vanilla command vocabulary — treat them as a starting point, not authoritative reference. The definition above is the game's own documentation.

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

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