Wiki

effect · activate_targeted_decision

Definition

  • Supported scope:STATE, COUNTRY
  • Supported target:none

Description

Activates targeted decisions or mission, ignoring its normal trigger conditions, cooldown and fire only once. Cannot activate if active in interface. 
Example: activate_targeted_decision = { target = TAG/STATE decision = decision_id_here

实战 · 配合 · 坑

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

实战用法

activate_targeted_decision 常用于 mod 中通过事件或国策完成某个条件后,强制为玩家或 AI 开启一个原本需要满足前置 trigger 才能出现的决议或任务,典型场景包括剧情链推进(如完成某项外交行动后解锁秘密任务)或给特定州立即激活占领/管理类决议。注意该命令会绕过决议的 visible/available 条件及冷却,但不能激活当前已在界面中处于激活状态的决议。

# 在一个国策完成后,强制为目标州激活一个特殊管理决议
complete_national_focus = my_secret_project_focus
hidden_effect = {
    every_controlled_state = {
        limit = { is_core_of = ROOT }
        activate_targeted_decision = {
            target = ROOT
            decision = decision_establish_secret_facility
        }
    }
}

配合关系

  • [remove_targeted_decision](/wiki/effect/remove_targeted_decision):与 activate_targeted_decision 相对,用于在决议完成或条件变化后手动移除已激活的决议,配合构成决议的完整生命周期管理。
  • [has_active_mission](/wiki/trigger/has_active_mission):在激活决议/任务前先检查是否已有同类任务处于激活状态,避免重复激活导致逻辑冲突。
  • [activate_mission_tooltip](/wiki/effect/activate_mission_tooltip):用于在 UI 层面提示玩家某任务已被激活,与 activate_targeted_decision 配合可提升玩家对剧情推进的感知。
  • [add_days_mission_timeout](/wiki/effect/add_days_mission_timeout):激活任务后立即设置其倒计时时限,适用于有时效限制的剧情决议场景。

常见坑

  1. 在决议已显示于界面时调用无效:若目标决议当前已对玩家可见并处于激活状态(即 has_active_mission 为真),该命令会静默失败,不会报错但也不会重置决议状态,新手容易误以为是 scope 写错而反复调试。
  2. scope 与 target 混淆:该命令的 target 字段填写的是决议的执行主体(TAG 或 STATE),而命令本身所在的 scope 决定了"谁来触发激活",两者不一致时决议可能挂载到错误对象上,尤其在州级决议中极易将 COUNTRY scope 与 STATE 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_targeted_decision is commonly used in mods to forcibly enable a decision or mission for the player or AI after certain conditions are met through events or national focuses, bypassing the need to satisfy the decision's prerequisite triggers. Typical scenarios include advancing narrative chains (such as unlocking secret missions after completing diplomatic actions) or immediately activating occupation/management decisions for specific states. Note that this command bypasses the decision's visible/available conditions and cooldowns, but cannot activate decisions that are already in an active state in the UI.

# After completing a national focus, forcibly activate a special management decision for target states
complete_national_focus = my_secret_project_focus
hidden_effect = {
    every_controlled_state = {
        limit = { is_core_of = ROOT }
        activate_targeted_decision = {
            target = ROOT
            decision = decision_establish_secret_facility
        }
    }
}

Synergy

  • [remove_targeted_decision](/wiki/effect/remove_targeted_decision): The counterpart to activate_targeted_decision, used to manually remove activated decisions after completion or when conditions change, together forming a complete lifecycle management system for decisions.
  • [has_active_mission](/wiki/trigger/has_active_mission): Check whether a similar mission is already active before activating a decision/mission to avoid duplicate activation causing logical conflicts.
  • [activate_mission_tooltip](/wiki/effect/activate_mission_tooltip): Provides UI-level feedback to the player that a mission has been activated; combined with activate_targeted_decision, it enhances player awareness of narrative progression.
  • [add_days_mission_timeout](/wiki/effect/add_days_mission_timeout): Immediately set a countdown timer for an activated mission, suitable for narrative decisions with time constraints.

Common Pitfalls

  1. Calling the command when the decision is already visible in the UI is ineffective: If the target decision is currently visible to the player and in an active state (i.e., has_active_mission is true), this command will silently fail without errors or state reset. Beginners often mistakenly assume the scope is written incorrectly and debug repeatedly.
  2. Confusion between scope and target: The target field in this command specifies the execution subject of the decision (TAG or STATE), while the scope in which the command resides determines "who triggers the activation". When these are inconsistent, the decision may be attached to the wrong object. This is especially common in state-level decisions where COUNTRY scope and STATE scope are easily reversed.