命令百科

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) 等触发器提前校验。