Wiki

effect · remove_mission

Definition

  • Supported scope:COUNTRY
  • Supported target:none

Description

Removes mission without running complete or timeout effects. 
Example: remove_mission = some_mission_here

实战 · 配合 · 坑

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

实战用法

remove_mission 常用于 mod 中需要手动中止某个限时任务的场景,例如玩家做出某个选择后任务分支切换、或剧情事件触发时需要清除旧的任务而不触发其超时惩罚或完成奖励。典型场景是当一个互斥任务组中玩家选择了路线 A,需要静默移除路线 B 对应的激活任务。

# 玩家在事件选项中选择外交路线,中止军事任务,不触发其超时效果
option = {
    name = my_event.1.a
    remove_mission = GER_military_intervention_mission
    activate_mission = GER_diplomatic_solution_mission
}

配合关系

  • [has_active_mission](/wiki/trigger/has_active_mission):在调用 remove_mission 前先用此触发器检测目标任务是否处于激活状态,避免对不存在的任务执行移除而产生日志报错。
  • [activate_mission](/wiki/effect/activate_mission):移除旧任务后通常紧接着激活新任务,实现任务分支切换的标准搭配。
  • [add_days_mission_timeout](/wiki/effect/add_days_mission_timeout):若只是想延迟任务而非彻底移除,可用此命令代替,理解两者的不同用途有助于做出正确选择。
  • [country_event](/wiki/effect/country_event)remove_mission 执行后常触发一个事件来向玩家说明任务被取消的剧情原因,保证叙事连贯性。

常见坑

  1. 误以为会执行超时或完成逻辑:新手常将 remove_mission 与任务自然到期混淆,实际上该命令会跳过所有 complete_effecttimeout_effect 块,若希望结算奖励应先手动调用相关 effect 再执行移除。
  2. 在任务未激活时直接调用:对一个当前未激活的任务执行 remove_mission 不会产生实际效果,但可能在游戏日志中留下警告,建议配合 [has_active_mission](/wiki/trigger/has_active_mission) 做保护性判断。

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

remove_mission is commonly used in mods when you need to manually cancel a time-limited mission, such as when the mission branch switches after a player makes a choice, or when an event triggers and you need to clear an old mission without triggering its timeout penalty or completion reward. A typical scenario is when a player chooses path A in a mutually exclusive mission group and you need to silently remove the active mission corresponding to path B.

# Player selects diplomatic route in event option, cancels military mission without triggering its timeout effect
option = {
    name = my_event.1.a
    remove_mission = GER_military_intervention_mission
    activate_mission = GER_diplomatic_solution_mission
}

Synergy

  • [has_active_mission](/wiki/trigger/has_active_mission): Use this trigger before calling remove_mission to check whether the target mission is in an active state, avoiding log errors from attempting to remove non-existent missions.
  • [activate_mission](/wiki/effect/activate_mission): After removing an old mission, you typically activate a new one immediately afterward—this is the standard pairing for implementing mission branch switching.
  • [add_days_mission_timeout](/wiki/effect/add_days_mission_timeout): If you only want to delay a mission rather than remove it entirely, use this command instead. Understanding the different purposes of both helps you make the right choice.
  • [country_event](/wiki/effect/country_event): After remove_mission executes, it's common to trigger an event to explain to the player the narrative reason why the mission was cancelled, ensuring narrative continuity.

Common Pitfalls

  1. Mistakenly thinking it will execute timeout or completion logic: Newcomers often confuse remove_mission with natural mission expiration, but this command actually skips all complete_effect and timeout_effect blocks. If you want to settle rewards, you should manually call the relevant effects before executing the removal.
  2. Calling it directly when the mission is not active: Executing remove_mission on a mission that is currently inactive will have no practical effect, but may leave a warning in the game log. It's recommended to use [has_active_mission](/wiki/trigger/has_active_mission) as a protective check.