Wiki

effect · add_scientist_role

Definition

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

Description

Add scientist role to 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 = {
	add_scientist_role = {
		scientist = {
			desc = desc_loc_key # Optional
			traits = { scientist_trait_token ... } # Optional
			skills = { specialization_token = 2 ... }
			# cf. game/common/characters/_documentation/md for full explanation
		}
	}
}

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

实战 · 配合 · 坑

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

实战用法

add_scientist_role 最常用于剧情事件或国策完成时,动态为某个角色解锁科学家职能,例如让一位特定历史人物在研究项目开启后成为专项科学家。在需要从国家 scope 操作特定角色时,可通过 character = 参数精确指定目标;若已处于角色自身 scope 则可省略该参数,直接写 scientist = { ... } 块。

# 国策完成后,从国家 scope 为指定角色添加科学家职能
complete_national_focus = {
    SOV = {
        add_scientist_role = {
            character = sov_igor_kurchatov
            scientist = {
                desc = kurchatov_scientist_desc
                traits = { nuclear_specialist }
                skills = { nuclear = 3 }
            }
        }
    }
}

配合关系

  • [remove_scientist_role](/wiki/effect/remove_scientist_role):与之对称,当剧情需要角色退出科研岗位时用于撤销职能,两者通常成对出现在事件选项中。
  • [add_scientist_trait](/wiki/effect/add_scientist_trait):在赋予科学家职能后追加专属特质,弥补 scientist = { traits = {} } 只能写初始特质的情况,适合动态成长系统。
  • [add_scientist_xp](/wiki/effect/add_scientist_xp):给新科学家立即注入经验值,让其起步时就有一定等级,避免初期能力过低影响玩家体验。
  • [any_scientist](/wiki/trigger/any_scientist):在条件块中检测国家现有科学家状态,可用来判断是否已存在同类角色,防止重复添加科学家职能。

常见坑

  1. 忘记 skills 字段导致脚本报错或科学家无法正常运作scientist = { } 块中 skills 并非可选——至少需要声明一个专业化方向的技能值,否则角色可能无法被分配到研究项目,甚至在读档时引发警告。
  2. 在 CHARACTER scope 下多写了 character = 参数:当 scope 本身已经是目标角色时再填写 character = ... 会造成指向混乱或被忽略,只需在国家 scope 下才需要通过 character = 参数指定目标角色。

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

add_scientist_role is most commonly used in flavor events or upon national focus completion to dynamically unlock the scientist role for a character—for example, enabling a specific historical figure to become a specialized scientist after a research project begins. When operating on a specific character from the national scope, you can use the character = parameter to precisely target them; if you're already within the character's own scope, you can omit this parameter and simply write the scientist = { ... } block directly.

# After national focus completion, add scientist role to a specified character from country scope
complete_national_focus = {
    SOV = {
        add_scientist_role = {
            character = sov_igor_kurchatov
            scientist = {
                desc = kurchatov_scientist_desc
                traits = { nuclear_specialist }
                skills = { nuclear = 3 }
            }
        }
    }
}

Synergy

  • [remove_scientist_role](/wiki/effect/remove_scientist_role): The symmetric counterpart—used to revoke the role when a character needs to exit the research position. Both typically appear in paired fashion within event options.
  • [add_scientist_trait](/wiki/effect/add_scientist_trait): Append exclusive traits after granting the scientist role, compensating for the limitation that scientist = { traits = {} } only sets initial traits. Ideal for dynamic progression systems.
  • [add_scientist_xp](/wiki/effect/add_scientist_xp): Immediately inject experience points into a newly appointed scientist, giving them an acceptable rank at the start to avoid low early-game competency harming player experience.
  • [any_scientist](/wiki/trigger/any_scientist): Check the nation's current scientist status within condition blocks. Can be used to determine whether a similar character already exists, preventing duplicate scientist role assignments.

Common Pitfalls

  1. Forgetting the skills field causes script errors or scientists to malfunction: The skills field in the scientist = { } block is not optional—you must declare at least one specialization direction with a skill value, otherwise the character may fail to be assigned to research projects or even trigger warnings upon save load.
  2. Writing the character = parameter when already in CHARACTER scope: If the scope is already the target character and you then fill in character = ..., it causes targeting confusion or gets ignored. Only use the character = parameter when you're in the national scope to specify the target character.