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
}

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.