trigger · has_power_balance
Definition
- Supported scope:
COUNTRY - Supported target:
none
Description
checks if power balance is active for country
Example:
has_power_balance = {
id = power_balance_id
}
has_power_balanceCOUNTRYnonechecks if power balance is active for country
Example:
has_power_balance = {
id = power_balance_id
}
实战内容由 AI 生成,并已对照 vanilla 命令词表校验 —— 请当作起点而非权威依据。上方的定义节才是游戏自带文档原文。
has_power_balance 常用于需要根据某个势力平衡机制是否已激活来动态控制决策、焦点或事件可用性的 mod 场景中,例如在意识形态对抗系统里判断特定权力天平是否正在运行,再决定是否显示相关选项。
# 示例:仅当指定权力天平激活时,该决策才可用
available = {
has_power_balance = {
id = my_mod_faction_balance
}
}
[has_any_power_balance](/wiki/trigger/has_any_power_balance):先用此触发器快速判断国家是否存在任意权力天平,再用 has_power_balance 精确定位具体 id,构成粗筛→细筛的两层逻辑。[add_faction_influence_score](/wiki/effect/add_faction_influence_score):在确认权力天平已激活后,配合此 effect 向对应阵营加注影响力分数,保证数值操作只在机制运行期间触发。[faction_influence_ratio](/wiki/trigger/faction_influence_ratio):与 has_power_balance 联用,先确认天平存在,再检查当前各方势力占比,实现更精细的条件判断。id 字段必须与 power_balance 文件中定义的 id 完全一致(区分大小写),写错 id 不会报错但永远返回 false,导致相关逻辑静默失效,排查时极为隐蔽。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_power_balance is commonly used in mod scenarios where decisions, focuses, or events need to be dynamically controlled based on whether a specific power balance mechanism has been activated. For example, in an ideological conflict system, it determines whether a particular power balance is currently active before deciding whether to display related options.
# Example: This decision is only available when the specified power balance is activated
available = {
has_power_balance = {
id = my_mod_faction_balance
}
}
[has_any_power_balance](/wiki/trigger/has_any_power_balance): Use this trigger first to quickly check if the country has any power balance, then use has_power_balance to pinpoint a specific id, creating a two-tier coarse-to-fine filtering logic.[add_faction_influence_score](/wiki/effect/add_faction_influence_score): After confirming the power balance is active, pair it with this effect to add influence score to the corresponding faction, ensuring numerical operations are only triggered during the mechanism's runtime.[faction_influence_ratio](/wiki/trigger/faction_influence_ratio): Use in conjunction with has_power_balance to first confirm the balance exists, then check the current influence distribution among parties, enabling more granular conditional logic.id field must exactly match the id defined in the power_balance file (case-sensitive). Misspelling the id will not produce an error but will always return false, causing related logic to silently fail, making it extremely difficult to debug.