Hands-On Usage
every_country is commonly used in event or focus effects to batch-apply operations to all countries that meet certain conditions — for example, stripping a shared idea from every member when a faction dissolves, or simultaneously applying war support changes to multiple countries when a global event fires.
# Example: add threat to every country that is at war, is AI-controlled, and has war support above 50%
every_country = {
limit = {
has_war = yes
is_ai = yes
has_war_support > 0.5
}
add_named_threat = {
threat = 1
name = global_war_escalation
}
add_war_support = -0.05
}
Synergy
- has_war: Used as a filter inside
limit to restrict effects to countries currently at war, preventing unintended changes to peaceful nations.
- has_government: Filters target countries by government type inside
limit; commonly used in ideology-spread mod scenarios.
- add_ideas: Batch-adds national ideas to all matched countries — one of the most frequently used child effects inside
every_country.
- set_country_flag: Stamps a flag on each matched country so that subsequent events or triggers can track which countries have already been processed.
Common Pitfalls
- Forgetting
limit, causing the effect to apply to every country in the game: Without a limit, every_country iterates over all countries — including those that have been defeated but still have an existing tag — resulting in significant performance overhead and potential unintended side effects. It is strongly recommended to always include limit = { exists = yes } as a bare-minimum filter.
- Assuming the scope switches automatically: Inside
every_country, the scope is already the country being iterated; you can write child effects directly against it. A common beginner mistake is nesting ROOT or THIS references inside the loop and getting confused about what they point to. When you genuinely need to reference the initiating country, explicitly wrap the relevant effects in ROOT = { ... }.