Hands-On Usage
country_event is the most frequently used mechanism in mods for triggering narrative events, diplomatic dialogues, and decision follow-ups. Typical scenarios include: narrative popups upon player focus completion, AI nations automatically triggering expansion events, and chained event sequences with delays (such as war preparation countdowns).
# Trigger a diplomatic event several days after focus completion with random variance
complete_national_focus = {
...
immediate = {
country_event = {
id = my_mod.101
days = 3
random_days = 2 # Actual delay is 3-4 days, preventing all games from triggering on the same day
}
}
}
Synergy
[add_political_power](/wiki/effect/add_political_power): Typically chained with country_event within event options—grant political power first, then trigger the next narrative segment via a delayed event, forming a "reward → continuation" structure.
[has_completed_focus](/wiki/trigger/has_completed_focus): Serves as an event trigger condition to check whether a focus has been completed, ensuring country_event is only meaningfully invoked after the narrative reaches the correct checkpoint.
[add_ideas](/wiki/effect/add_ideas): Often executed in the same block as country_event—attach ideas to the nation (such as special decrees) as the event fires, making the event effective both visually and mechanically.
[every_other_country](/wiki/effect/every_other_country): When broadcasting the same event to multiple nations in bulk, nest country_event within this loop—this is the standard pattern for implementing "global announcement" type events.
Common Pitfalls
- Confusing scope results in events firing to the wrong nation:
country_event always triggers for the nation in the current scope. If called inside every_other_country or every_faction_member, the event target becomes the iterated nation rather than the triggering nation—failure to clarify the current scope causes the event's FROM relationships to become corrupted.
- Omitting delay fields causes events to "fire instantly" and stack: Without
days/hours, the event queues immediately; if called multiple times within the same tick (such as in loops), masses of duplicate events pop simultaneously on the same frame. It is recommended to always add at least a one-hour delay to chained events to stagger their execution frames.