Hands-On Usage
all_guaranteed_country is commonly used to check whether every country that the current country has guaranteed meets certain conditions — for example, verifying in an event or decision that "all of my guaranteed countries have joined the faction" or "all guaranteed countries still exist" before triggering follow-up logic. A typical use case in diplomacy-focused mods is unlocking a special decision once the player has fulfilled their guarantee obligations to all smaller nations.
# Check that every country currently guaranteed by this country exists and is not at war
activate_decision = {
decision = my_special_decision
available = {
all_guaranteed_country = {
exists = yes
has_war = no
}
}
}
Synergy
- is_guaranteed_by: The reverse-perspective check. While
all_guaranteed_country iterates over guaranteed countries from the guarantor's scope, is_guaranteed_by confirms the guarantee relationship from within the guaranteed country's scope. The two are often paired for bidirectional validation.
- has_war: Used inside an
all_guaranteed_country block to check whether any guaranteed country is at war, helping detect whether the guarantee chain is at risk of being triggered.
- exists: The most fundamental check when iterating over guaranteed countries — prevents the script from evaluating tags that no longer exist (i.e., already-annexed nations) and causing errors.
- give_guarantee: Used in an effect block after the trigger check passes to issue a guarantee to a target country, completing a "check → fill in the gap" diplomatic logic loop.
Common Pitfalls
- Scope direction confusion:
all_guaranteed_country iterates over the countries guaranteed by the current scope country, not the countries that guarantee the current country. Beginners frequently mix up its semantics with is_guaranteed_by, resulting in conditions that are always false or unexpectedly true.
- Empty-set trap: If the current country has not guaranteed any other country,
all_guaranteed_country returns true over the empty set (a universal quantifier over an empty set is vacuously true). Beginners often assume the condition should be false in this case and end up writing inverted logic. The correct approach is to first use an any_* variant to confirm that at least one guaranteed country exists, then use all_guaranteed_country to perform the full check.