Wiki

effect · operative_leader_event

Definition

  • Supported scope:CHARACTER
  • Supported target:none

Description

Fires a operative leader event for owner country.
Example:
operative_leader_event = {
	id = mtg_exile_leader_added.1 # The event to fire.
	# Optional Fields:
	originator = TAG # The originator of the event (default to the owner of the operative)
	recipient = TAG # The recipient of the event (default to the owner of the operative)
	hours = 12 # The number of hours to wait before firing the event.
	days = 5 # The number of days to wait before firing the event.
	months = 1 # The number of months to wait before firing the event, where a month is treated as 30 days.
		# Note:  hours, days, and months can all be used and will simply be added together.
	random_hours = 18 # A random amount of hours to be added to the delay before firing, from 0 up to but not including random_hours.
	random_days = 2 # A random amount of days to be added to the delay before firing, from 0 up to but one hour less than random_days.
		# Note:  random_hours and random_days can both be used and will simply be added together.
	random = 6 # Equivalent to random_hours; preserverd for backwards compatibility.
	random = { chance = 50 ... } # Specify a set of child effects to execute as part of this effect, with a percentage chance of randomly happening or not (as a group, not individually).
	tooltip = mtg_exile_leader_added.1.t # Manually specify which tooltip to use for this effect.
	set_from = TAG # Set the scope of the From in the scripted localization
	set_from_from = TAG # Set the scope of the From.From in the scripted localization
	set_root = TAG # Set the scope of the Root in the scripted localization
}

实战 · 配合 · 坑

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

实战用法

operative_leader_event 常用于情报 mod 中,当特工执行特定任务(如渗透、破坏、反间谍)后触发剧情事件,向玩家反馈任务结果或推进情节。例如在特工被捕或完成渗透任务时,为其宿主国家弹出对应事件,配合 hoursdays 字段制造延迟感,模拟情报传递的真实性。

# 在特工任务完成后触发,向宿主国延迟播报结果
operative_leader_event = {
    id = spy_ops.5
    days = 2
    random_hours = 12
    originator = FROM
    tooltip = spy_ops.5.t
}

配合关系

  • [operative_leader_mission](/wiki/trigger/operative_leader_mission):用于在 limit 块中判断特工当前执行的任务类型,确保只有特定任务才触发本事件,避免事件被滥发。
  • [harm_operative_leader](/wiki/effect/harm_operative_leader):在触发事件前先对特工造成伤害(如降低技能),再通过事件向玩家说明后果,形成"行动—后果—通知"的完整流程。
  • [capture_operative](/wiki/effect/capture_operative):在特工被捕逻辑分支中先执行捕获效果,随后用本 effect 触发被捕剧情事件,两者语义上紧密相连。
  • [is_operative_captured](/wiki/trigger/is_operative_captured):配合作为触发条件,确认特工已被捕状态后再决定是否发送对应事件,避免状态错配导致叙事矛盾。

常见坑

  1. scope 写错导致事件无法触发:本 effect 必须置于 CHARACTER scope 下(即当前作用域为特工角色),若错误地写在 COUNTRY scope 中将直接报错或静默失效,新手常在 country_eventoption 块里直接调用而忘记先切换到特工角色的 scope。
  2. originator/recipient 默认行为产生意外接收方:不显式指定时两者均默认为特工宿主国,若事件逻辑需要区分"发起方"与"接收方"(如跨国间谍事件)而忘记手动赋值,会导致事件被错误的国家接收,且该错误在日志中不会报警,极难排查。

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

operative_leader_event is commonly used in intelligence mods to trigger narrative events after a spy executes a specific mission (such as infiltration, sabotage, or counter-intelligence), providing player feedback on mission outcomes or advancing the story. For example, when a spy is captured or completes an infiltration task, the corresponding event pops for the host country. Combined with the hours or days fields, you can create a sense of delay that simulates the realism of intelligence transmission.

# Triggers after a spy mission completes, with delayed reporting to the host country
operative_leader_event = {
    id = spy_ops.5
    days = 2
    random_hours = 12
    originator = FROM
    tooltip = spy_ops.5.t
}

Synergy

  • [operative_leader_mission](/wiki/trigger/operative_leader_mission): Used in limit blocks to check the type of mission the operative is currently executing, ensuring only specific missions trigger this event and preventing event spam.
  • [harm_operative_leader](/wiki/effect/harm_operative_leader): Apply damage to the operative before triggering the event (such as reducing skill), then use this event to inform the player of the consequences, forming a complete "action—consequence—notification" flow.
  • [capture_operative](/wiki/effect/capture_operative): Execute the capture effect in the operative capture logic branch first, then use this effect to trigger the capture narrative event afterward; the two are semantically intertwined.
  • [is_operative_captured](/wiki/trigger/is_operative_captured): Use as a triggering condition to confirm the operative's captured status before deciding whether to send the corresponding event, avoiding narrative contradictions from state mismatches.

Common Pitfalls

  1. Incorrect scope prevents event from firing: This effect must be placed under CHARACTER scope (i.e., the current scope is the operative character). If incorrectly placed in COUNTRY scope, it will error out or silently fail. Beginners often call this directly in the option block of a country_event and forget to switch to the operative's scope first.
  2. Unexpected recipient caused by default originator/recipient behavior: When not explicitly specified, both default to the operative's host country. If the event logic requires distinguishing between "originator" and "recipient" (such as in cross-national spy events) but you forget to manually assign values, the event will be received by the wrong country, and this error won't trigger warnings in the logs, making it extremely difficult to debug.