Wiki

effect · remove_scientist_role

Definition

  • Supported scope:COUNTRY, CHARACTER
  • Supported target:none

Description

Remove the scientist role from a character.The character can come from the scope or from an input parameter.
The scientist role format is the same as in the character DB.
Except the visible trigger - a scientist role created via effect cannot have triggers.
Examples:
# From character scope
my_character = {
	remove_scientist_role = yes
}

# From country scope
SOV = {
	remove_scientist_role = {
		character = my_character / var:my_char_var / PREV # accepts variables and keywords
	}
}

实战 · 配合 · 坑

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

实战用法

当你需要通过事件或决策动态调整某角色的职能时(例如角色因剧情转职、死亡前清理角色状态、或 mod 中的科研系统重构),可使用此 effect 移除已附加的科学家角色。在国家 scope 下配合变量指定角色更灵活,适合管理大型角色池。

# 某角色因事件失去科学家资质,从国家 scope 移除
country_event = {
    option = {
        SOV = {
            remove_scientist_role = {
                character = var:current_lead_scientist
            }
        }
    }
}

配合关系

  • [add_scientist_role](/wiki/effect/add_scientist_role):移除旧科学家角色后立即赋予新角色,实现角色职能的无缝切换或升级改造。
  • [remove_advisor_role](/wiki/effect/remove_advisor_role):若角色同时担任顾问与科学家,两者常需同步移除,保持角色状态一致性。
  • [any_scientist](/wiki/trigger/any_scientist):在执行移除前先判断当前是否存在可操作的科学家,避免对不符合条件的角色触发无效指令。
  • [remove_unit_leader_role](/wiki/effect/remove_unit_leader_role):在需要完整清除角色所有职责的剧情节点(如退役、叛变)中与本 effect 同步使用。

常见坑

  1. 在角色 scope 下误传入 character 参数:当已处于 CHARACTER scope 时,直接写 remove_scientist_role = yes 即可;若此时仍写成带 character = ... 的块状写法会导致解析错误或意外行为,两种写法不能混用。
  2. 移除不存在的科学家角色不会报错但也无任何效果:新手常误以为只要角色存在就能移除,实际上角色必须当前持有科学家角色,否则指令静默失效,调试时需用 [any_scientist](/wiki/trigger/any_scientist) 等触发器提前校验。

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

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

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