Wiki

effect · activate_mission

Definition

  • Supported scope:COUNTRY
  • Supported target:none

Description

Activates mission, ignoring its normal trigger conditions. Cannot activate a mission that is already active. 
Example: activate_mission = some_mission_here

实战 · 配合 · 坑

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

实战用法

activate_mission 常用于剧本 mod 中,通过事件或国策完成后绕过任务自身的触发条件,强制激活某个限时任务(mission),适合那些需要在特定剧情节点推进任务链而又无法保证触发条件满足的场景。例如,玩家完成某个国策后立刻激活一个外交限时任务:

focus = {
    id = GER_activate_diplomatic_mission
    ...
    completion_reward = {
        activate_mission = GER_ultimatum_mission
    }
}

配合关系

  • [has_active_mission](/wiki/trigger/has_active_mission):激活任务前或任务期间,常用此触发器检测该任务是否已处于激活状态,防止重复触发逻辑或给出提示。
  • [activate_mission_tooltip](/wiki/effect/activate_mission_tooltip):在 UI 提示块(如 custom_effect_tooltip)中配合使用,向玩家显示即将激活的任务信息,提升可读性。
  • [add_days_mission_timeout](/wiki/effect/add_days_mission_timeout):任务激活后可配合此命令动态延长或调整任务的倒计时天数,灵活控制任务时限。
  • [country_event](/wiki/effect/country_event):任务激活时通常同步触发一个事件,给玩家交代背景叙事或提供额外选项。

常见坑

  1. 对已激活的任务再次调用会静默失效:官方明确指出不能激活一个已经处于激活状态的任务,但游戏不会报错,只会什么都不做,新手常因此误以为脚本有 bug,应在调用前用 [has_active_mission](/wiki/trigger/has_active_mission) 加条件判断。
  2. 任务本体必须存在于 missions 文件夹中activate_mission 填入的任务 ID 必须在 common/missions/ 下有完整定义,且所属国家 scope 必须正确对应;若任务归属国家与当前 scope 不匹配,任务同样不会被激活,不会有任何报错提示。

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

activate_mission is commonly used in scenario mods to bypass a mission's own trigger conditions via events or national focuses, forcing activation of a time-limited mission. This is ideal for situations where you need to advance a mission chain at a specific narrative checkpoint but cannot guarantee the trigger conditions will be met. For example, immediately activating a diplomatic time-limited mission upon completing a national focus:

focus = {
    id = GER_activate_diplomatic_mission
    ...
    completion_reward = {
        activate_mission = GER_ultimatum_mission
    }
}

Synergy

  • [has_active_mission](/wiki/trigger/has_active_mission): Before or during mission activation, use this trigger to detect whether the mission is already active, preventing duplicate logic or providing notifications.
  • [activate_mission_tooltip](/wiki/effect/activate_mission_tooltip): Used together in UI hint blocks (such as custom_effect_tooltip) to display mission information to the player upon activation, improving readability.
  • [add_days_mission_timeout](/wiki/effect/add_days_mission_timeout): After mission activation, combine with this command to dynamically extend or adjust the mission's countdown timer, giving flexible control over the mission deadline.
  • [country_event](/wiki/effect/country_event): Mission activation typically triggers an associated event simultaneously, providing narrative context to the player or offering additional choices.

Common Pitfalls

  1. Calling activate_mission on an already-active mission fails silently: The engine explicitly does not support activating a mission that is already in an active state. The game will not throw an error—it simply does nothing. New modders often mistake this for a scripting bug. Always guard your calls with [has_active_mission](/wiki/trigger/has_active_mission) to check beforehand.
  2. The mission must exist in the missions folder: The mission ID passed to activate_mission must have a complete definition under common/missions/, and its owning country scope must match correctly. If the mission's assigned country does not match the current scope, the mission will not activate, and no error will be logged.