Hands-On Usage
any_guaranteed_country is commonly used to check whether the current country has a guarantee relationship with any country of a given type — for example, in diplomatic events or national focuses, detecting whether the country "has guaranteed at least one nation currently at war," which can then trigger diplomatic warnings or changes to war support. It can also be used in the available block of achievements or decisions to restrict a decision so that it only fires when the player is actively guaranteeing at least one major power.
# Check whether the current country has guaranteed any country that is currently at war
# If so, this decision becomes available
decision_example = {
available = {
any_guaranteed_country = {
has_war = yes
}
}
}
# In an event trigger condition: a country guaranteed by the current country has had its capital occupied
trigger = {
any_guaranteed_country = {
has_capitulated = yes
}
}
Synergy
- has_guaranteed:
has_guaranteed checks whether the current scope is guaranteed by a specific country — the opposite direction from any_guaranteed_country (which checks countries I am guaranteeing). Used together, they allow bidirectional verification of guarantee chain relationships.
- has_war: Used inside the sub-scope of
any_guaranteed_country to check whether a guaranteed country has already entered a war. This is the most common inner condition for implementing guarantee-fulfillment logic.
- is_subject_of: Can be combined to exclude subjects, ensuring that guarantee logic only applies to independent sovereign nations.
- give_guarantee: Works in tandem on the effect side — used in events or national focuses to actively grant a guarantee — while
any_guaranteed_country handles the trigger side to verify whether a guarantee already exists.
Common Pitfalls
- Scope direction reversed:
any_guaranteed_country iterates over "countries that the current scope country is guaranteeing," not "countries that are guaranteeing the current country." If you need to check "who is guaranteeing me," use is_guaranteed_by instead. This distinction trips up new modders very easily.
- Used outside a COUNTRY scope: This trigger is only valid within a COUNTRY scope. If it is mistakenly used inside a STATE scope — for instance, nested within an
any_owned_state block — without switching back to a country scope first, the script will either silently error out or return false, making the bug very difficult to track down during debugging.