Hands-On Usage
remove_advisor_role is commonly used in character event chains to dynamically adjust a character's position. Typical use cases include removing an advisor from their slot when they lose office due to a coup, retirement, or defection, then unbinding them from the advisor slot at the code level. Common scenarios involve national focus triggering a character transition (advisor → general), or clearing an old political advisor in an event before assigning new responsibilities via add_advisor_role.
# An advisor from a certain country is forced to leave office via event, becoming a regular character
country_event = {
id = my_mod.42
option = {
name = my_mod.42.a
remove_advisor_role = {
character = GER_heinrich_advisor
slot = political_advisor
}
}
}
Synergy
[add_advisor_role](/wiki/effect/add_advisor_role): The most direct pairing—remove the old advisor role first, then assign a new advisor role to implement advisor position "rotation" logic.
[deactivate_advisor](/wiki/effect/deactivate_advisor): Deactivate the advisor before removing their role to ensure consistent game state and avoid exceptions from forced removal while still active.
[has_advisor_role](/wiki/trigger/has_advisor_role): Use this trigger before executing removal to verify the character currently holds the target advisor slot, preventing operations on non-existent slots.
[set_can_be_fired_in_advisor_role](/wiki/effect/set_can_be_fired_in_advisor_role): Manage advisor dismissal permissions in tandem—after removing a role, use this to reset whether that character can be fired in future advisor roles.
Common Pitfalls
- Forgetting to specify the
character field: The character parameter can only be omitted when executing within CHARACTER scope. When called in COUNTRY scope without this field, the game cannot locate the target character, causing the effect to silently fail without error, making it extremely difficult to debug.
slot mismatch with actual bound slot: If the advisor slot type the character holds (e.g., army_chief) does not match the slot written in the script (e.g., political_advisor), the removal will not take effect and the character retains their original slot. Subsequent add_advisor_role calls may then fail due to conflicts.