trigger · has_template
Definition
- Supported scope:
COUNTRY - Supported target:
none
Description
Check if country has a division template of specific name
has_templateCOUNTRYnoneCheck if country has a division template of specific name
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.
has_template is commonly used to check whether a country has established a division template of a specific type. It serves as a prerequisite condition in national focuses, decisions, or AI strategies—for example, determining whether the player has completed preparation of an armored division or elite infantry division template. Typical scenarios include unlocking subsequent decisions only when a country possesses a certain template, or using it for AI behavior evaluation.
# Available block in a decision: only trigger if an "Armored Division" template exists
available = {
has_template = "Armored Division"
}
[has_army_size](/wiki/trigger/has_army_size): First use has_template to confirm the template exists, then apply this trigger to check the actual deployed troop count. Together they form a complete military readiness assessment.[any_country_division](/wiki/trigger/any_country_division): has_template only verifies template existence, while any_country_division can further verify whether that template already has active units deployed on the map.[division_template](/wiki/effect/division_template): Used in effect blocks to dynamically create or modify division templates. Typically execute this only when has_template evaluates to false, avoiding duplicate creation of same-named templates.[delete_unit_template_and_units](/wiki/effect/delete_unit_template_and_units): When replacing an old template, first confirm the target template exists with has_template, then safely delete it with this effect to prevent errors from deleting non-existent templates."Armored Division" and "armored division" are treated as different templates. It is recommended to copy the original name directly as defined in-game or in scripts.has_template is only valid under COUNTRY scope. If mistakenly written within STATE or CHARACTER scope, the trigger will not error but will always return false, making it easy to overlook during debugging.