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 }
has_faction_templateCOUNTRYanyChecks if the current country is in a faction with a template
### Examples
TAG = { has_faction_template = template_id }
实战内容由 AI 生成,并已对照 vanilla 命令词表校验 —— 请当作起点而非权威依据。上方的定义节才是游戏自带文档原文。
has_faction_template 常用于基于阵营模板来限制某些决议、国策或事件的触发条件,例如只有当某国加入了特定意识形态模板的阵营(如自定义的"社会主义联盟模板")时才能触发后续剧情。在多派系 mod 中,可用它区分不同派系归属,从而给予差异化的奖励或惩罚。
# 只有加入了名为 my_custom_faction_template 的阵营时才可用该决议
available = {
has_faction_template = my_custom_faction_template
}
[create_faction_from_template](/wiki/effect/create_faction_from_template):用于先按模板创建阵营,随后用 has_faction_template 验证该国是否已处于对应模板的阵营中,两者构成"创建→检测"的完整流程。[any_allied_country](/wiki/trigger/any_allied_country):配合使用可在确认本国所在阵营类型的前提下,进一步遍历盟友,筛选出满足特定条件的阵营成员。[add_to_faction](/wiki/effect/add_to_faction):当某国尚未加入目标模板阵营时,可先用此 trigger 做反向判断,再通过 add_to_faction 将其拉入,避免重复操作。[compare_ideology_with_faction](/wiki/trigger/compare_ideology_with_faction):两者常并列使用,同时检查阵营模板与意识形态匹配度,实现更精细的阵营归属逻辑。has_faction_template 接受的是在 faction_templates 中定义的模板 ID(字符串),而非运行时的阵营名称或阵营领袖标签,混淆二者会导致条件永远不成立且没有任何报错提示。