Wiki

effect · set_can_be_fired_in_advisor_role

Definition

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

Description

Set the value (yes/no) to the "can be fired" flag in Advisor Role. When set to No, the advisor cannot be fired once hired.

Example:
some_country_scope = {
  set_can_be_fired_in_advisor_role = {
    character = my_character_token # or keyword, variable...
    slot = political_advisor # mandatory if the character has several advisor role
    value = no
  }
}

some_character_scope = {
  set_can_be_fired_in_advisor_role = {
    slot = political_advisor # mandatory if the character has several advisor role
    value = no
  }
}

实战 · 配合 · 坑

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

实战用法

此 effect 常用于设计"不可解雇"的关键顾问角色,例如剧情向 mod 中某位对国家命运至关重要的政治顾问,或者玩家在特定国策完成后强制雇用且不允许开除的历史人物。当 value = no 时,顾问一旦入职便被锁定,适合配合剧情触发点强化叙事压迫感。

# 国策完成后,锁定某顾问使其无法被解雇
focus = {
    id = appoint_iron_chancellor
    ...
    completion_reward = {
        activate_advisor = {
            character = GER_otto_von_bismarck
            slot = political_advisor
        }
        set_can_be_fired_in_advisor_role = {
            character = GER_otto_von_bismarck
            slot = political_advisor
            value = no
        }
    }
}

配合关系

  • [activate_advisor](/wiki/effect/activate_advisor):先激活顾问,再调用本 effect 设置锁定标志,两者几乎是固定搭档,顺序不能颠倒。
  • [add_advisor_role](/wiki/effect/add_advisor_role):若顾问角色是动态添加的,需先用此 effect 挂载顾问 role,再用本 effect 锁定,确保 slot 字段已存在。
  • [deactivate_advisor](/wiki/effect/deactivate_advisor):在某些解锁条件达成后,可先用本 effect 将 value 改回 yes,再调用此 effect 解雇顾问,实现"有条件可开除"的双向控制。
  • [advisor_can_be_fired](/wiki/trigger/advisor_can_be_fired):用于检测当前顾问是否处于可解雇状态,可在 if/else 逻辑中判断后再决定是否调用本 effect 修改标志。

常见坑

  1. 忘记指定 slot 导致脚本报错或行为异常:当一个角色同时拥有多个顾问 role(如既是 political_advisor 又是其他类型顾问)时,slot 字段是必填的,遗漏会导致游戏无法确定作用于哪个 role,轻则静默失效,重则报错。
  2. 在顾问未被雇用时调用本 effect 无效:本 effect 修改的是"已在职顾问 role"上的标志位,若目标角色尚未通过 activate_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

This effect is commonly used to design "non-dismissible" key advisor roles, such as a political advisor crucial to a nation's fate in story-driven mods, or historical figures that players are forced to hire upon completing a specific focus and are not permitted to fire. When value = no, the advisor becomes locked upon appointment, making it ideal for pairing with story triggers to reinforce narrative tension.

# After focus completion, lock an advisor to prevent dismissal
focus = {
    id = appoint_iron_chancellor
    ...
    completion_reward = {
        activate_advisor = {
            character = GER_otto_von_bismarck
            slot = political_advisor
        }
        set_can_be_fired_in_advisor_role = {
            character = GER_otto_von_bismarck
            slot = political_advisor
            value = no
        }
    }
}

Synergy

  • [activate_advisor](/wiki/effect/activate_advisor): Activate the advisor first, then invoke this effect to set the lock flag. These two are nearly inseparable partners, and their order cannot be reversed.
  • [add_advisor_role](/wiki/effect/add_advisor_role): If the advisor role is dynamically added, use this effect first to attach the advisor role, then use this effect to lock it, ensuring the slot field already exists.
  • [deactivate_advisor](/wiki/effect/deactivate_advisor): Once certain unlock conditions are met, you can use this effect to change value back to yes, then call this effect to dismiss the advisor, enabling "conditional dismissal" with bidirectional control.
  • [advisor_can_be_fired](/wiki/trigger/advisor_can_be_fired): Used to detect whether the current advisor is in a dismissible state. You can make decisions based on if/else logic before deciding whether to invoke this effect to modify the flag.

Common Pitfalls

  1. Forgetting to specify slot causes script errors or unexpected behavior: When a character has multiple advisor roles simultaneously (such as being both a political_advisor and another advisor type), the slot field is mandatory. Omitting it prevents the game from determining which role to target, resulting in silent failure at best or errors at worst.
  2. Invoking this effect when the advisor is not hired has no effect: This effect modifies flags on "active advisor roles". If the target character has not been appointed via activate_advisor, the setting will not be retained. Always ensure the advisor is in an activated state when calling this effect.