Hands-On Usage
random_army_leader is commonly used in country events or focus effects to apply buffs or traits to a randomly selected army leader, without needing to target a specific character. This makes it ideal for "random leader reward" narrative designs. For example, after a country completes a focus, you can add a trait and increase the skill level of a leader who meets certain conditions:
GER = {
random_army_leader = {
limit = {
is_corps_commander = yes
has_trait = skilled_staffer
}
add_trait = brilliant_strategist
add_skill_level = 1
}
}
Synergy
- is_corps_commander — Use inside a
limit block to filter for corps commanders, preventing field marshals from being accidentally selected.
- has_trait — Use inside a
limit block to further narrow down leaders who already possess a specific trait, allowing precise targeting.
- add_unit_leader_trait — Pair with this effect to grant a unit leader trait to the randomly selected leader; this is the most common form of reward.
- add_skill_level — Combine with the above to simultaneously boost the leader's overall skill level alongside the trait grant, making the reward feel more impactful.
Common Pitfalls
- Forgetting
limit and selecting an unintended character: Without a limit block, the effect picks from all army leaders at random, including field marshals currently commanding critical operations or characters who have already retired. Always use limit with triggers such as is_corps_commander or is_field_marshal to constrain the selection pool.
- Wrong scope:
random_army_leader must be called within a country scope. Using it directly inside a state or character scope will cause a script error or silent failure. Make sure the enclosing scope resolves to the intended country tag, or that THIS/ROOT points to a country.