Wiki

trigger · is_faction_leader

Definition

  • Supported scope:COUNTRY
  • Supported target:none

Description

check if country leads a faction

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_faction_leader is commonly used to check whether a country is a faction leader, thereby unlocking exclusive decisions, focuses, or advisors—for example, only faction leaders can initiate joint declarations of war or lead diplomatic actions. In systems involving technology sharing and faction influence, it's also frequently used to differentiate logic branches between leaders and ordinary members.

# Only faction leaders can activate this decision
available = {
    is_faction_leader = yes
}

Synergy

  • [any_allied_country](/wiki/trigger/any_allied_country): Often paired with is_faction_leader to confirm the country is a leader first, then iterate through allies for further condition checks (such as determining whether a specific ally meets certain criteria).
  • [create_wargoal](/wiki/effect/create_wargoal): After confirming the country is a faction leader, allows generating a war goal against a target nation, preventing non-leader countries from triggering illogical war declaration processes.
  • [dismantle_faction](/wiki/effect/dismantle_faction): Typically executed only when is_faction_leader = yes, since only the leader has the authority to dismantle their own faction.
  • [any_faction_member](/wiki/trigger/any_faction_member): Used together to first check if the current country is a leader, then examine faction membership composition, enabling more granular judgments about faction size or member qualifications.

Common Pitfalls

  1. Confusion with is_in_faction: is_faction_leader returns yes only when the country is simultaneously in a faction and is its leader; if the country is not in any faction, the result is no rather than an error—newcomers often mistakenly believe that "having no faction" will cause a script crash, leading them to write unnecessary safeguard checks.
  2. Direct use in effect blocks: This is a trigger and cannot be placed directly at the top level of an effect block; it must be placed within a limit = { } or other conditional block, otherwise the game parser will report a script error.