trigger · is_ai
Definition
- Supported scope:
COUNTRY - Supported target:
none
Description
Checks if country is AI controlled.
is_aiCOUNTRYnoneChecks if country is AI controlled.
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.
is_ai most commonly appears in balance mods, providing AI nations with additional resources or simplified decision conditions to prevent AI from getting stuck due to complex prerequisites. It's also frequently used to restrict certain focus/decision options that only make sense for human players, preventing AI from triggering illogical story branches after selection.
# A certain nation's decision: only manually triggerable by player, AI automatically skips
available = {
NOT = { is_ai = yes }
}
# Or provide compensation to AI via modifier
if = {
limit = { is_ai = yes }
add_political_power = 50
}
[has_country_flag](/wiki/trigger/has_country_flag): Commonly combined with is_ai to track whether AI has already executed a certain compensation logic using the condition "AI only and has specific flag", preventing duplicate triggers.[add_political_power](/wiki/effect/add_political_power) / [add_stability](/wiki/effect/add_stability): AI lacks the micromanagement capabilities of human players; these effects are used within is_ai = yes branches to give AI appropriate bonuses and maintain game balance.[has_completed_focus](/wiki/trigger/has_completed_focus): Player-oriented national focus trees often have complex branches; combined with is_ai, this allows AI to follow streamlined paths—checking only if key focuses are completed while skipping intermediate steps that differ between human and AI experience.[country_event](/wiki/effect/country_event): When triggering exclusive compensation or story events for AI, add is_ai = yes filtering in the trigger block to ensure such events don't pop up for players and break immersion.is_ai = yes versus is_ai = no: Beginners sometimes write is_ai = yes in an available block intending "only AI satisfies this condition", but forget that this means players can never trigger that decision. To create a "player-exclusive" option, use NOT = { is_ai = yes } or directly is_ai = no.is_ai only works within country scope; if the parent block's scope has already switched to state or character (for example, directly writing it in the limit of any_owned_state), the script will report a scope error or silently return false. You need to switch back to country scope first using methods like owner = { is_ai = yes }.