Wiki

trigger · advisor_can_be_fired

Definition

  • Supported scope:CHARACTER
  • Supported target:none

Description

Return true if the character has an advisor role and they can be fired.
Warning: will return false if the character has no advisor role or it does not match the input slot. You should use has_advisor_role trigger first to really test the can_be_fired flag.

Examples:
some_character_scope = {
  advisor_can_be_fired = {
    slot = political_advisor # mandatory if the character has several advisor role
  }
}

some_character_scope = {
  advisor_can_be_fired = yes # or no
}

实战 · 配合 · 坑

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

实战用法

在顾问相关的 mod 场景中,此 trigger 常用于判断某个顾问角色是否可以被解雇,从而决定是否显示解雇按钮、触发相关事件,或在特定决议/事件中加以限制。例如在一个政治事件里,检测某位政治顾问能否被解雇,若可以则提供解雇选项:

some_character = {
    limit = {
        has_advisor_role = { slot = political_advisor }
        advisor_can_be_fired = {
            slot = political_advisor
        }
    }
    remove_advisor_role = { slot = political_advisor }
}

配合关系

  • [has_advisor_role](/wiki/trigger/has_advisor_role):在使用本 trigger 之前,应先用此 trigger 确认角色确实拥有对应顾问槽位,否则 advisor_can_be_fired 会直接返回 false,导致逻辑判断失效。
  • [remove_advisor_role](/wiki/effect/remove_advisor_role):确认顾问可以被解雇后,调用此 effect 实际执行解雇操作,两者形成"检查-执行"的标准配对。
  • [set_can_be_fired_in_advisor_role](/wiki/effect/set_can_be_fired_in_advisor_role):与本 trigger 形成读写关系——用此 effect 设置顾问能否被解雇的标志,再用本 trigger 读取并判断该标志。

常见坑

  1. 跳过 has_advisor_role 直接使用:若角色没有对应槽位的顾问角色,advisor_can_be_fired 会直接返回 false,而不会报错,导致逻辑静默失败。新手容易误以为 false 代表"有角色但不可解雇",实际上可能是"根本没有该角色",因此务必先用 has_advisor_role 做前置检查。
  2. 多顾问角色时省略 slot 字段:当角色同时拥有多个顾问角色时,不指定 slot 会导致结果不可预期。只有角色仅持有唯一一个顾问角色时,才可以使用简写的 advisor_can_be_fired = yes 形式。

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

In advisor-related mod scenarios, this trigger is commonly used to determine whether a specific advisor character can be dismissed, thereby deciding whether to display the dismiss button, trigger related events, or apply restrictions in specific decisions/events. For example, in a political event, check if a political advisor can be dismissed; if so, provide a dismiss option:

some_character = {
    limit = {
        has_advisor_role = { slot = political_advisor }
        advisor_can_be_fired = {
            slot = political_advisor
        }
    }
    remove_advisor_role = { slot = political_advisor }
}

Synergy

  • [has_advisor_role](/wiki/trigger/has_advisor_role): Before using this trigger, you should first use this trigger to confirm that the character actually possesses the corresponding advisor slot, otherwise advisor_can_be_fired will immediately return false, causing logic judgment to fail.
  • [remove_advisor_role](/wiki/effect/remove_advisor_role): After confirming the advisor can be dismissed, call this effect to actually execute the dismiss operation. Together they form a standard "check-then-execute" pairing.
  • [set_can_be_fired_in_advisor_role](/wiki/effect/set_can_be_fired_in_advisor_role): Forms a read-write relationship with this trigger—use this effect to set the flag for whether an advisor can be dismissed, then use this trigger to read and evaluate that flag.

Common Pitfalls

  1. Skipping has_advisor_role and using directly: If the character does not have an advisor role in the corresponding slot, advisor_can_be_fired will immediately return false without raising an error, causing silent logic failure. Beginners often mistake false as meaning "has the role but cannot be dismissed," when it may actually mean "doesn't have that role at all." Always perform a preliminary check with has_advisor_role first.
  2. Omitting the slot field when the character has multiple advisor roles: When a character holds multiple advisor roles simultaneously, not specifying slot will lead to unpredictable results. Only when a character holds a single, unique advisor role can you use the shorthand form advisor_can_be_fired = yes.