Wiki

effect · country_event

Definition

  • Supported scope:COUNTRY
  • Supported target:none

Description

Fires a country event.
Example:
country_event = {
	id = germany.75 # The event to fire.
	# Optional Fields:
	hours = 12 # The number of hours to wait before firing the event.
	days = 5 # The number of days to wait before firing the event.
	months = 1 # The number of months to wait before firing the event, where a month is treated as 30 days.
	# Note:  hours, days, and months can all be used and will simply be added together.
	random_hours = 18 # A random amount of hours to be added to the delay before firing, from 0 up to but not including random_hours.
	random_days = 2 # A random amount of days to be added to the delay before firing, from 0 up to but one hour less than random_days.
	# Note:  random_hours and random_days can both be used and will simply be added together.
	random = 6 # Equivalent to random_hours; preserverd for backwards compatibility.
	random = { chance = 50 ... } # Specify a set of child effects to execute as part of this effect, with a percentage chance of randomly happening or not (as a group, not individually).
	tooltip = germany.75.t # Manually specify which tooltip to use for this effect.
}

Hands-On Notes

Hands-on notes are AI-generated and checked against the vanilla command vocabulary — treat them as a starting point, not authoritative reference. The definition above is the game's own documentation.

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

  1. 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.
  2. 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.