Hands-On Usage
set_country_leader_name is commonly used in scenarios where a leader's name needs to be dynamically modified following an event or decision trigger, such as when a leader adopts an alias after a specific event, restores their true name, or when the displayed name of the ruling figure is updated after a civil war concludes. The following example demonstrates renaming the current ruling leader within a country event:
country_event = {
id = my_mod.1
title = my_mod.1.t
desc = my_mod.1.d
option = {
name = my_mod.1.a
set_country_leader_name = {
ideology = neutrality
name = "Johann von Neumann"
}
}
}
Synergy
[add_country_leader_trait](/wiki/effect/add_country_leader_trait): Adding new traits to the leader while renaming them allows both effects to work together and completely craft a "character transformation" event.
[create_country_leader](/wiki/effect/create_country_leader): When a complete leader replacement is needed, first create a new leader; set_country_leader_name is better suited for lightweight scenarios where you only want to rename while preserving existing traits and ideology, forming a complementary choice between the two.
[has_country_leader](/wiki/trigger/has_country_leader): Use this trigger to verify the target leader exists before executing the rename, preventing silent failures from attempting to rename non-existent leaders.
[has_country_leader_ideology](/wiki/trigger/has_country_leader_ideology): Combine with ideology conditions to ensure the rename logic only triggers when the correct ruling party/ideology leader is in office.
Common Pitfalls
- Misunderstanding when the
ideology field is omitted: When ideology is omitted, the effect applies to the "current ruling leader" only, not all leaders. If the target leader is not from the current ruling party, you must explicitly specify ideology, otherwise the rename will incorrectly apply to the current leader and produce no error message.
- Expecting player visibility without generating tooltips: This effect generates no UI tooltip (no tooltip), and if you want players to perceive the name change, you must add additional text descriptions or custom effect tooltips within the same option/event, otherwise the rename will be completely silent to the player.