Wiki

effect · activate_advisor

Definition

  • Supported scope:COUNTRY
  • Supported target:none

Description

Place an advisor in their respective role slot

Example:
activate_advisor = GER_character_token_air_chief

实战 · 配合 · 坑

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

实战用法

activate_advisor 常用于国策完成后自动上任顾问、事件触发时解锁特定角色,以及 DLC 人物系统中在满足条件后将已定义的角色推入对应槽位。例如在某国家专注树完成时,直接激活预设的空军总司令:

focus = {
    id = GER_build_luftwaffe
    ...
    completion_reward = {
        activate_advisor = GER_character_token_air_chief
    }
}

配合关系

  • [add_advisor_role](/wiki/effect/add_advisor_role):先用 add_advisor_role 为角色挂载顾问角色定义,再用 activate_advisor 将其实际激活上岗,两者形成"定义→启用"的完整流程。
  • [deactivate_advisor](/wiki/effect/deactivate_advisor):需要替换顾问时,先调用 deactivate_advisor 卸下旧顾问,再激活新顾问,避免同槽冲突。
  • [has_character](/wiki/trigger/has_character):激活前用 has_character 确认目标角色存在于本国,防止因角色不存在或已阵亡导致激活失败。
  • [has_available_idea_with_traits](/wiki/trigger/has_available_idea_with_traits):可在激活前检测对应顾问槽位是否有可用候选,配合条件判断让脚本更健壮。

常见坑

  1. Token 必须归属于当前国家activate_advisor 的参数是角色 token,若该角色当前不属于执行 scope 的国家(例如已流亡或从未生成),指令会静默失败,不会报错,新手往往误以为脚本正常执行。
  2. 顾问槽位未清空就重复激活:同一槽位已有激活的顾问时直接再次激活另一个同类顾问,并不会自动顶替旧顾问,需先用 deactivate_advisor 显式移除,否则新顾问无法进入槽位。

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_advisor is commonly used to automatically appoint an advisor upon focus completion, unlock specific characters when events are triggered, and in DLC character systems, push pre-defined characters into corresponding slots once conditions are met. For example, when a nation's focus tree is completed, directly activate a preset air force chief:

focus = {
    id = GER_build_luftwaffe
    ...
    completion_reward = {
        activate_advisor = GER_character_token_air_chief
    }
}

Synergy

  • [add_advisor_role](/wiki/effect/add_advisor_role): First use add_advisor_role to attach an advisor role definition to a character, then use activate_advisor to actually activate and appoint them, forming a complete "define → enable" workflow.
  • [deactivate_advisor](/wiki/effect/deactivate_advisor): When replacing an advisor, first call deactivate_advisor to remove the old advisor, then activate the new one, avoiding slot conflicts.
  • [has_character](/wiki/trigger/has_character): Use has_character before activation to confirm the target character exists in your country, preventing activation failures due to missing or deceased characters.
  • [has_available_idea_with_traits](/wiki/trigger/has_available_idea_with_traits): Can check whether the corresponding advisor slot has available candidates before activation, combined with conditional logic to make scripts more robust.

Common Pitfalls

  1. Token must belong to the current country: The parameter for activate_advisor is a character token. If the character does not currently belong to the country executing the scope (e.g., already exiled or never generated), the command will silently fail without error reporting. Beginners often mistakenly believe the script executed normally.
  2. Repeated activation without clearing the advisor slot: When the same slot already has an activated advisor, directly activating another advisor of the same type will not automatically replace the old one. You must first explicitly remove it with deactivate_advisor, otherwise the new advisor cannot enter the slot.