Hands-On Usage
add_country_leader_trait is commonly used in scripted events or upon completion of national focuses to dynamically assign traits to a leader. For example, after a player completes a national focus along a certain ideological path, you can grant the current nation's leader a trait that symbolizes their policy style. When a character simultaneously holds multiple leader roles (such as serving as leader for different ideological paths), you must specify the target ideology via the ideology field; otherwise, the script will error or behave unexpectedly.
# After completing a national focus, add the anti-communist trait to Hungary's Horthy under oligarchism ideology
complete_national_focus = HUN_anti_communist_pact
HUN_miklos_horthy = {
add_country_leader_trait = {
ideology = oligarchism
trait = anti_communist
}
}
Synergy
[remove_country_leader_trait](/wiki/effect/remove_country_leader_trait): The counterpart to this command, used for dynamically switching leader traits. For example, when an event triggers, remove the old trait first and then add the new one to implement trait replacement logic.
[add_country_leader_role](/wiki/effect/add_country_leader_role): When a character does not yet possess a leader role for a certain ideology, you must first grant them that role identity before using this command to add the corresponding trait. The order of these two operations has a clear dependency.
[can_be_country_leader](/wiki/trigger/can_be_country_leader): Use before adding traits as a conditional check to confirm the target character can currently serve as a national leader, avoiding applying effects to invalid characters.
[create_country_leader](/wiki/effect/create_country_leader): In scenarios where you create a leader from scratch, you can first use create_country_leader to establish the character, then use this command to append additional traits, building up the complete leader attributes step by step.
Common Pitfalls
- Forgetting the
ideology field for multi-ideology characters: If a character holds multiple country_leader roles (corresponding to different ideologies), writing add_country_leader_trait = some_trait directly without specifying ideology will cause the game to be unable to determine the target character's identity, and the trait may be applied to the wrong character or be completely ineffective. Always use the block syntax with the ideology field.
- Expecting precise control of a specific character within a country scope: When used under a country scope like
SOV = { ... }, the effect applies to the leader of the currently executing government, not a designated character. If you need precise control over a specific character (especially a non-ruling leader), you must switch to a character scope (such as SOV_joseph_stalin = { ... }) to invoke the command.