Hands-On Usage
all_navy_leader is commonly used to check whether every naval leader of a given country meets specific conditions — for example, verifying that all naval commanders possess a certain trait, have reached a particular skill level, or satisfy prerequisites for a focus or event. Typical use cases include ensuring that all elite naval commanders are in place before triggering a special event, or setting unlock thresholds for a "naval superpower" achievement in a mod.
# Check whether all of Germany's naval leaders have the bold trait and skill >= 3
GER = {
all_navy_leader = {
has_trait = bold
skill > 2
}
}
Synergy
- any_of_scopes — Used when you need "at least one" naval leader to satisfy a condition, forming a natural counterpart to
all_navy_leader. The two are often paired within the same trigger block to cover both "all" and "any" evaluation logic.
- is_navy_leader — Used after entering a character scope to confirm that the character is indeed a naval leader, preventing false positives for characters who hold multiple roles simultaneously.
- has_trait — The most common inner condition, used to check whether a leader possesses a specific trait. It is the most essential sub-condition inside an
all_navy_leader block.
- skill — Paired with
all_navy_leader to check a leader's overall skill value. Frequently appears alongside attack_skill_level, defense_skill_level, and similar fields to precisely define a minimum quality threshold for leaders.
Common Pitfalls
- Silent failure caused by wrong scope:
all_navy_leader can only be called within a COUNTRY scope. If used directly inside a state scope or character scope, the script will not throw an error, but the condition will never evaluate as expected. When debugging, always confirm that the enclosing scope is a country.
- Empty set defaults to true: If a country currently has no naval leaders at all,
all_navy_leader returns true over the empty set (vacuous truth — "all members satisfy the condition" holds trivially when there are no members). Beginners often mistake this for a valid trigger firing. It is recommended to pair this trigger with count_triggers or a prior check that ensures the leader count is greater than 0 before relying on its result.