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
- 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.
- 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.