Wiki

effect · add_scientist_xp

Definition

  • Supported scope:CHARACTER
  • Supported target:none

Description

Add experience to a special project specialization for a scientist character in scope.
The `experience` parameter is a scoped variable.

#### Example

ex: my_character = { add_scientist_xp = { experience = 2 # accepts variables specialization = specialization_nuclear } }

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_xp is commonly used in nuclear weapons, rocket, or special project mods to accumulate specialized experience for scientists when they complete milestone tasks or trigger specific events, thereby accelerating special project progress. For example, you can add nuclear physics specialization experience to a designated scientist after a national focus completes:

# In national focus completion_reward
my_nuclear_scientist = {
    add_scientist_xp = {
        experience = 5
        specialization = specialization_nuclear
    }
}

Synergy

  • [is_active_scientist](/wiki/trigger/is_active_scientist) — Check whether the character is an active scientist before execution, preventing erroneous calls on non-scientist characters.
  • [add_scientist_level](/wiki/effect/add_scientist_level) — After experience accumulates to a certain threshold, pair with this command to directly promote scientist level, creating coherent "experience → promotion" logic.
  • [add_scientist_trait](/wiki/effect/add_scientist_trait) — Once a scientist acquires sufficient experience, commonly grant exclusive traits in tandem to enhance narrative impact in specific research directions.
  • [has_scientist_level](/wiki/trigger/has_scientist_level) — Check the scientist's current level and use conditional logic to determine whether additional experience needs to be awarded.

Common Pitfalls

  1. Incorrect scope targeting: This command must execute within CHARACTER scope; beginners often call it directly in COUNTRY scope, causing script errors or silent failures. Always enter the appropriate character scope first using my_character = { ... }.
  2. Invalid specialization values: The specialization field must use a valid specialization tag defined in the game (such as specialization_nuclear); entering arbitrary strings won't error but the experience will be discarded and difficult to debug.