Hands-On Usage
add_trait is most commonly used in scripted events or after national focus completion to dynamically assign traits to specific characters. For example, you might grant a general the "brilliant_strategist" trait after completing a special mission, or attach additional abilities to a political advisor upon appointment. It can also be used at narrative junctures like civil wars or coups to bind corresponding ideological traits to newly spawned national leaders.
# Add a trait to a German general after focus completion
complete_national_focus = GER_eastern_campaign
country_event = {
id = ger.42
}
# Within an event option:
GER_manstein = {
add_trait = {
trait = brilliant_strategist
}
}
# If you need to specify the character from a country scope:
add_trait = {
character = GER_manstein
trait = brilliant_strategist
}
Synergy
[remove_trait](/wiki/effect/remove_trait): The inverse operation of add_trait, commonly used to remove an old trait before adding a new one, implementing trait "upgrades" or replacement logic.
[add_country_leader_trait](/wiki/effect/add_country_leader_trait): Used when the target is a national leader and you need to add leader-exclusive traits (rather than generic character traits); these two cover different trait pools.
[promote_character](/wiki/effect/promote_character): First promote a character to a specific position, then use add_trait to assign traits matching that role, ensuring correct logical order.
[can_select_trait](/wiki/trigger/can_select_trait): Check whether a character meets the conditions before adding a trait using this trigger, preventing script errors or logical confusion.
Common Pitfalls
- Forgetting the
character field when in a country scope: The character field can only be omitted when already within the character's own scope (such as GER_manstein = { ... }). Otherwise, you must explicitly specify it; failure to do so means the game cannot determine the target character, and the effect silently fails.
- Missing
slot or ideology fields for advisor/leader traits: When adding a trait to a character in an advisor position, you must fill in slot; when adding a trait to a national leader, you must fill in ideology. Omitting these two fields results in the UI not updating or even errors—this is the detail most commonly overlooked by newcomers.