Wiki

trigger · has_faction_template

Definition

  • Supported scope:COUNTRY
  • Supported target:any

Description

Checks if the current country is in a faction with a template

### Examples

TAG = { has_faction_template = template_id }

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

has_faction_template is commonly used to restrict certain decisions, focuses, or events based on faction template membership—for example, triggering a narrative chain only when a nation has joined a specific ideological template faction (such as a custom "Socialist Alliance Template"). In multi-faction mods, it can distinguish faction affiliation, enabling differentiated rewards or penalties.

# This decision is available only if the nation has joined a faction with the my_custom_faction_template template
available = {
    has_faction_template = my_custom_faction_template
}

Synergy

  • [create_faction_from_template](/wiki/effect/create_faction_from_template): Used to create a faction from a template first, then verify with has_faction_template whether the nation is already in a faction matching that template. Together they form a complete "creation → verification" workflow.
  • [any_allied_country](/wiki/trigger/any_allied_country): When used in conjunction, it allows confirming the faction type of the current nation and then iterating through allies to filter faction members meeting specific criteria.
  • [add_to_faction](/wiki/effect/add_to_faction): When a nation hasn't yet joined the target template faction, you can use this trigger for inverse logic first, then add it via add_to_faction to avoid redundant operations.
  • [compare_ideology_with_faction](/wiki/trigger/compare_ideology_with_faction): Frequently used alongside this trigger to simultaneously check both faction template and ideology alignment, enabling more refined faction membership logic.

Common Pitfalls

  1. Incorrect template ID: has_faction_template accepts the template ID (string) defined in faction_templates, not the runtime faction name or faction leader tag. Confusing these will cause the condition to never evaluate true and produce no error messages.
  2. Scope not switched to target nation: This trigger only works in COUNTRY scope. If used directly in STATE, CHARACTER, or other scopes without first switching scope, the script will fail silently and logic won't execute as intended.