Wiki

trigger · compare_ideology_with_faction

Definition

  • Supported scope:COUNTRY
  • Supported target:any

Description

Compares the ideology support of the country's ruling party for the ideology of the faction it wants to join

### Example

compare_ideology_with_faction = { value > 0.5 leader = FROM }

实战 · 配合 · 坑

实战内容由 AI 生成,并已对照 vanilla 命令词表校验 —— 请当作起点而非权威依据。上方的定义节才是游戏自带文档原文。

实战用法

此 trigger 常见于自定义阵营加入逻辑的 mod 中,用于限制某国只有在其执政党意识形态支持度足够高时才能加入特定阵营,从而使阵营扩张更符合历史逻辑。例如在一个多意识形态竞争 mod 里,可以要求某国执政党的意识形态支持率必须超过阵营领袖意识形态的门槛值,才允许外交加入:

join_faction_trigger = {
    compare_ideology_with_faction = {
        value > 0.4
        leader = FROM
    }
}

配合关系

  • [has_country_leader_ideology](/wiki/trigger/has_country_leader_ideology):在 compare_ideology_with_faction 检查支持度的同时,用此 trigger 进一步确认当前执政党意识形态类型,避免意识形态相近但类型不同的国家误判通过。
  • [faction_influence_ratio](/wiki/trigger/faction_influence_ratio):与支持度比较联用,可在允许加入阵营的同时评估当前阵营内各派系的势力比例,防止阵营意识形态被稀释。
  • [any_allied_country](/wiki/trigger/any_allied_country):常在外层用于枚举潜在阵营成员,再在内层用 compare_ideology_with_faction 对每个候选国做逐一检验。
  • [add_to_faction](/wiki/effect/add_to_faction):当 compare_ideology_with_faction 条件满足后,在对应 effect 块中调用此命令将该国正式加入阵营,形成「条件判断→执行加入」的完整流程。

常见坑

  1. leader 字段写成目标国标签而非作用域引用leader 应指向持有阵营的国家 scope(如 FROMROOT 或具体的 scope 变量),直接硬写国家标签在非固定场景下会导致判断对象错误,尤其在 on_action 触发时 FROM/ROOT 指向经常与预期相反,务必在测试中用 log 确认 scope 链。
  2. value 理解为绝对人口或兵力数值:该 trigger 比较的是意识形态支持率(0–1 的小数比例),而非政治力量点数或绝对人数;新手常误将 value > 50 写成百分比形式,导致条件永远为假。

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

This trigger is commonly found in mods that implement custom faction join logic, used to restrict a country from joining a specific faction unless its ruling party ideology support is sufficiently high, thereby making faction expansion more historically consistent. For example, in a multi-ideology competition mod, you can require that a country's ruling party ideology support rate must exceed the faction leader's ideology threshold before allowing diplomatic faction membership:

join_faction_trigger = {
    compare_ideology_with_faction = {
        value > 0.4
        leader = FROM
    }
}

Synergy

  • [has_country_leader_ideology](/wiki/trigger/has_country_leader_ideology): While compare_ideology_with_faction checks support levels, use this trigger to further confirm the current ruling party ideology type, preventing countries with similar ideologies but different types from incorrectly passing the check.
  • [faction_influence_ratio](/wiki/trigger/faction_influence_ratio): Combine with support rate comparison to evaluate the influence ratio of various factions within the current faction while allowing membership, preventing faction ideology from being diluted.
  • [any_allied_country](/wiki/trigger/any_allied_country): Commonly used in the outer layer to enumerate potential faction members, then use compare_ideology_with_faction in the inner layer to individually verify each candidate country.
  • [add_to_faction](/wiki/effect/add_to_faction): Once the compare_ideology_with_faction condition is satisfied, call this command in the corresponding effect block to formally add the country to the faction, forming a complete flow of "condition check → execution of join".

Common Pitfalls

  1. Writing the leader field as a target country tag instead of a scope reference: leader should point to the country scope holding the faction (such as FROM, ROOT, or a specific scope variable). Directly hardcoding a country tag will cause the judgment object to be incorrect in non-fixed scenarios, especially when triggered by on_action where FROM/ROOT references often point opposite to expectations—always use log to confirm scope chains during testing.
  2. Misunderstanding value as absolute population or military strength: This trigger compares ideology support rate (a decimal ratio from 0–1), not political power points or absolute numbers; beginners often mistakenly write value > 50 in percentage form, causing the condition to always be false.