Hands-On Usage
When you need to dynamically adjust a character's role through events or decisions (for example, when a character changes profession due to story, needs cleanup before death, or your mod overhauls the research system), use this effect to remove an attached scientist role from a character. Using variables to specify the character within the country scope provides greater flexibility, making it suitable for managing large character pools.
# A character loses their scientist qualification due to an event, removed from the country scope
country_event = {
option = {
SOV = {
remove_scientist_role = {
character = var:current_lead_scientist
}
}
}
}
Synergy
[add_scientist_role](/wiki/effect/add_scientist_role): Immediately assign a new character to a scientist role after removing the old one, enabling seamless role transitions or position upgrades.
[remove_advisor_role](/wiki/effect/remove_advisor_role): When a character serves as both advisor and scientist simultaneously, both roles typically need synchronized removal to maintain character state consistency.
[any_scientist](/wiki/trigger/any_scientist): Check whether an operable scientist currently exists before executing removal to avoid triggering ineffective commands on ineligible characters.
[remove_unit_leader_role](/wiki/effect/remove_unit_leader_role): Use this effect in sync with that one at narrative checkpoints requiring complete removal of all character responsibilities (such as retirement or defection).
Common Pitfalls
- Mistakenly passing the
character parameter under character scope: When already within CHARACTER scope, simply write remove_scientist_role = yes; if you still use the block syntax with character = ..., it will cause parsing errors or unexpected behavior. The two syntaxes cannot be mixed.
- Removing a non-existent scientist role produces no error but also has no effect: Beginners often mistakenly believe that removing works as long as the character exists, but in reality the character must currently hold the scientist role; otherwise the command silently fails. During debugging, use triggers like
[any_scientist](/wiki/trigger/any_scientist) to validate conditions beforehand.