Hands-On Usage
all_unit_leader is commonly used to check whether all unit leaders of a country meet certain conditions — for example, requiring every commander to reach a specific skill threshold in a decision's available block, or checking whether all leaders already possess a particular trait in a focus's bypass block.
# Example: the decision is only available when all German unit leaders have the "trickster" trait
GER = {
available = {
all_unit_leader = {
has_trait = trickster
}
}
}
# Example: check whether all unit leaders in the current country have an attack skill level of 3 or higher
all_unit_leader = {
attack_skill_level > 2
}
Synergy
- has_trait: The most common inner check — used to determine whether each leader holds a specific trait. Pair it with
all_unit_leader to enforce a "all-leaders trait check".
- skill: Checks a leader's overall skill level. Combined with
all_unit_leader, this lets you verify whether every leader in the country meets a minimum competency threshold.
- is_field_marshal: Filters by leader type inside
all_unit_leader. Use it with not to exclude field marshals and apply batch checks only to army commanders.
- has_unit_leader_flag: Checks whether a leader has been assigned a specific flag. Paired with
all_unit_leader, this lets you track custom states across all leaders in a country.
Common Pitfalls
- Confusing it with
any_unit_leader: all_unit_leader returns true only when every leader satisfies the condition simultaneously. If your intent is "at least one leader satisfies the condition", use any_unit_leader instead — otherwise the condition will either never trigger or be far too restrictive.
- Forgetting that the scope must be COUNTRY: This trigger can only be called from within a country scope. If it is written inside a character scope (for example, directly inside an event option of a
unit_leader_event without first switching scope), the script will either throw an error or silently fail. Use a construct such as owner = { all_unit_leader = { ... } } to enter the country scope first.