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
	}
}

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.