Hands-On Usage
every_possible_country is typically used when you need to apply effects to all potential countries in bulk — including those that have not yet been spawned on the map — such as in global events, technology diffusion, or granting every country an ideology modifier under certain conditions. The key distinction from every_country is that it covers countries that have not yet appeared, making it well-suited for resetting global state or broadcasting diplomatic relationships across a mod.
# Example: add an idea to all existing countries that are at war
every_possible_country = {
limit = {
exists = yes
has_war = yes
}
add_ideas = war_economy_boost
}
Synergy
- exists — Typically paired inside a
limit block to filter out countries that have not yet actually appeared on the map, preventing meaningless operations from being applied to ghost countries.
- has_government — Used inside
limit to filter target countries by government type, allowing bulk effects to be applied only to countries of a specific ideology.
- set_country_flag — Combine with
every_possible_country to set flags in bulk, which can then be checked as conditions in subsequent event triggers.
- add_stability — A commonly used bulk effect command, often seen in global stability adjustment events or mod script initialization.
Common Pitfalls
- Forgetting to add
limit = { exists = yes }: Without a limiting condition, this command iterates over every country tag that could possibly exist in the game — including ones that never appear. In large mods this can easily cause severe performance stutters or even crashes. Always add filter conditions such as exists = yes as appropriate.
- Confusing the use cases of
every_possible_country and every_country: If your logic only needs to handle countries currently present on the map, prefer every_country over this command. The extra iteration overhead of every_possible_country is pure waste when you have no need to cover countries that have not yet spawned.