effect · random_operative
Definition
- Supported scope:
COUNTRY,OPERATION - Supported target:
none
Description
Executes children effects on a random operatives that fulfills the "limit" trigger.
random_operativeCOUNTRY, OPERATIONnoneExecutes children effects on a random operatives that fulfills the "limit" trigger.
实战内容由 AI 生成,并已对照 vanilla 命令词表校验 —— 请当作起点而非权威依据。上方的定义节才是游戏自带文档原文。
random_operative 常用于特工系统相关的 mod 场景,例如随机为某国一名未被捕的特工升级技能或添加特质,实现"情报事件触发随机奖励"的效果。也可在行动结束后用于随机惩罚一名正在执行任务的特工,增加情报战的不确定性。
# 某国完成情报事件后,随机提升一名未被捕特工的技能
country_event = {
id = my_intel.1
option = {
name = my_intel.1.a
random_operative = {
limit = {
is_operative_captured = no
has_nationality = ROOT
}
add_skill_level = 1
add_trait = { token = operative_resourceful }
}
}
}
limit 块中过滤被捕状态,确保效果只作用于自由行动的特工,避免逻辑错误。limit 块中进一步筛选正在执行特定任务的特工,使随机选取更精准。random_operative 配合实现"随机牺牲一名特工"的高风险情报事件叙事。limit 写在外部而非内部:limit 必须作为 random_operative 的子块存在,若写在外层 option 或 immediate 的条件判断位置,筛选将完全不生效,导致效果作用于任意一名特工(包括被捕或敌方的)。COUNTRY 和 OPERATION scope 下有效;若在 STATE 或其他 scope 中调用,游戏会静默忽略或报错,新手容易因为 scope 切换不当(如直接在 every_state 块内调用)而导致效果失效。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.
random_operative is commonly used in mod scenarios involving the operative system — for example, randomly upgrading a skill or adding a trait to one uncaptured operative belonging to a country, achieving a "random reward triggered by an intelligence event" effect. It can also be used after a mission concludes to randomly penalize an operative currently on assignment, adding uncertainty to intelligence warfare.
# After a country completes an intelligence event, randomly increase the skill of one uncaptured operative
country_event = {
id = my_intel.1
option = {
name = my_intel.1.a
random_operative = {
limit = {
is_operative_captured = no
has_nationality = ROOT
}
add_skill_level = 1
add_trait = { token = operative_resourceful }
}
}
}
limit block to ensure the effect only applies to operatives who are free, preventing logic errors.limit to operatives currently executing a specific mission, making the random pick more precise.random_operative to craft high-stakes intelligence event narratives where a random operative is sacrificed.limit outside instead of inside: limit must exist as a child block of random_operative. If it is written at the outer option or immediate level as a condition check, the filter will have no effect whatsoever, causing the effect to apply to any operative at random — including captured ones or those belonging to the enemy.COUNTRY and OPERATION scopes. Calling it from a STATE scope or any other unsupported scope will cause the game to silently ignore it or throw an error. Beginners often run into this by inadvertently switching scopes — for instance, calling it directly inside an every_state block — and then wondering why the effect never fires.