Wiki

effect · generate_scientist_character

Definition

  • Supported scope:COUNTRY
  • Supported target:none

Description

Generate a new character with a scientist role and recruit it in the country in scope.
Examples:
SOV = {
	generate_scientist_character = {
		portrait = GFX_portrait # optional - random portrait by default
		portrait_tag_override = CHI # optional - accepts variable and keyword - only relevant if using random portrait - by default use country in scope
		gender = male / female # optional - by default random gender
		skills = {
			# optional array
			# same format as in scientist role in character DB
			# by default all skills are at 1
			specialization_token = 2
		}
		traits = { trait_token } # optional array
	}
}

实战 · 配合 · 坑

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

实战用法

generate_scientist_character 常用于 mod 中为某国动态生成特定专精的科学家角色,例如在国策、事件或决议完成后奖励玩家一名高技能科学家,或在特殊研究链开始时为阵营注入关键人才。下方示例演示在国策完成后为苏联生成一名带有特定专精的女性科学家:

SOV = {
    generate_scientist_character = {
        gender = female
        skills = {
            specialization_nuclear = 3
        }
        traits = { scientist_trait_nuclear_specialist }
    }
}

配合关系

  • [any_scientist](/wiki/trigger/any_scientist) — 在生成科学家前用于检查当前是否已存在同类科学家,避免重复生成造成人员冗余。
  • [any_active_scientist](/wiki/trigger/any_active_scientist) — 配合判断已激活的科学家数量或专精,决定是否还需要触发生成逻辑。
  • [add_scientist_role](/wiki/effect/add_scientist_role) — 若已有通过 generate_character 创建的通用角色,可用此命令补充科学家职能,两者功能互补,覆盖不同的角色创建路径。
  • [add_research_slot](/wiki/effect/add_research_slot) — 生成高级科学家后常同步添加研究槽,作为整体"科研实力提升"事件包的组合奖励。

常见坑

  1. 忘记 scope 必须是 COUNTRY:新手容易在 STATE scope 或 character scope 下直接调用此命令,导致脚本报错或静默失败;务必通过 TAG = { ... } 或确认当前上下文已是国家 scope 后再使用。
  2. skills 块内填写了不存在的专精 token:游戏不会自动报错提示,但科学家生成后专精等级会异常或回落默认值;专精 token 必须与游戏或 mod 内 scientist_specializations 定义完全一致,建议先在原版 common/characters 中核对可用的 specialization_* 键名。

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

generate_scientist_character is commonly used in mods to dynamically create scientist characters with specific specializations for a nation—for example, rewarding the player with a high-skill scientist upon completing a national focus, event, or decision, or injecting key talent into a faction at the start of a specialized research chain. The example below demonstrates generating a female scientist with a specific specialization for the Soviet Union after completing a national focus:

SOV = {
    generate_scientist_character = {
        gender = female
        skills = {
            specialization_nuclear = 3
        }
        traits = { scientist_trait_nuclear_specialist }
    }
}

Synergy

  • [any_scientist](/wiki/trigger/any_scientist) — Use before scientist generation to check if a similar scientist already exists, preventing duplicate creation and personnel redundancy.
  • [any_active_scientist](/wiki/trigger/any_active_scientist) — Combine with logic to assess the number or specializations of activated scientists, determining whether generation logic needs to be triggered.
  • [add_scientist_role](/wiki/effect/add_scientist_role) — If a generic character has already been created via generate_character, this command can supplement the scientist function; both are complementary and cover different character creation paths.
  • [add_research_slot](/wiki/effect/add_research_slot) — After generating an advanced scientist, it is common practice to simultaneously add research slots as a combined reward within an overall "research capability boost" event package.

Common Pitfalls

  1. Forgetting that scope must be COUNTRY: Beginners often invoke this command directly under STATE scope or character scope, causing script errors or silent failures; always ensure the scope is a nation by using TAG = { ... } or confirming the current context is already at country scope before use.
  2. Filling the skills block with non-existent specialization tokens: The game will not automatically report an error, but the scientist's specialization levels will be anomalous or revert to default values after generation; specialization tokens must exactly match the scientist_specializations definitions in the base game or mod, and it is recommended to verify available specialization_* key names in the vanilla common/characters first.