Wiki

trigger · is_dynamic_country

Definition

  • Supported scope:COUNTRY
  • Supported target:any

Description

returns true if the country is a dynamic country (tag is D01-D50)

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

is_dynamic_country is commonly used in scenarios where you need to exclude or specifically handle dynamically generated countries (such as civil war splinter states or puppet-derived tags). For example, it prevents AI strategies, decisions, or country events from incorrectly triggering on these temporary country tags. Here's an example of using it in a decision that should only apply to "real" countries:

available = {
    NOT = { is_dynamic_country = yes }
}

It can also be used in reverse—as a prerequisite trigger in cleanup or merging logic specifically targeting dynamic countries.

Synergy

  • [exists](/wiki/trigger/exists): Dynamic countries sometimes exist in a destroyed state. Combining with exists = yes ensures the target country both exists and is dynamic, avoiding null-pointer-like logic errors.
  • [any_other_country](/wiki/trigger/any_other_country) (→ [any_enemy_country](/wiki/trigger/any_enemy_country)): When iterating through all hostile countries, is_dynamic_country is commonly used within a limit block to exclude or filter dynamic tags, ensuring the logic only applies to the intended set of countries.
  • [has_country_flag](/wiki/trigger/has_country_flag): Dynamic countries are typically marked with custom flags by mods to indicate their origin. Combined with this trigger, you can further distinguish which type of dynamic country you're dealing with (civil war faction, puppet, etc.).
  • [annex_country](/wiki/effect/annex_country): When handling dynamic country elimination logic, first confirm the identity with is_dynamic_country = yes, then execute the annexation, preventing accidental annexation of real countries.

Common Pitfalls

  1. Confusing "dynamic countries" with "puppets/subject states": Beginners often assume all countries created by events or decisions are dynamic countries. In reality, only tags falling within the D01–D50 range return true. Regular countries whose appearance has been changed via set_cosmetic_tag are not affected—don't use this trigger as a substitute for has_cosmetic_tag for appearance checks.
  2. Using outside COUNTRY scope: This trigger only supports COUNTRY scope. If written in a condition block within STATE or CHARACTER scope, it will silently fail (always returning false). No obvious error will be logged during debugging, so pay special attention to whether the current scope has switched to country level.