命令百科

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 默认行为产生意外接收方:不显式指定时两者均默认为特工宿主国,若事件逻辑需要区分"发起方"与"接收方"(如跨国间谍事件)而忘记手动赋值,会导致事件被错误的国家接收,且该错误在日志中不会报警,极难排查。