Wiki

trigger · power_balance_daily_change

Definition

  • Supported scope:any
  • Supported target:none

Description

compares current total daily change of a power balance

Example:
power_balance_daily_change = {
	id = power_balance_id
	value > 0.5 # supported operators are: >, < and =
}

实战 · 配合 · 坑

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

实战用法

power_balance_daily_change 常用于需要动态响应"权力天平"变化速度的 mod 场景,例如当某一阵营的每日影响力增速过快时触发警告事件,或在决策(decision)的 available 块中限制玩家只有在天平趋势趋于稳定时才能执行某外交行动。

# 示例:当权力天平每日正向变化超过阈值时,触发对应事件的条件检查
available = {
    power_balance_daily_change = {
        id = my_ideological_balance
        value > 0.2
    }
}

配合关系

  • [is_power_balance_in_range](/wiki/trigger/is_power_balance_in_range):通常与本 trigger 搭配,先判断天平当前所处区间,再用 power_balance_daily_change 判断趋势方向,二者结合可精确描述"天平已偏向某侧且仍在加速偏移"的状态。
  • [power_balance_weekly_change](/wiki/trigger/power_balance_weekly_change):与本 trigger 形成短期/中期双重校验,日变化用于捕捉突发波动,周变化用于确认趋势是否持续,常在同一 and 块中并列使用。
  • [has_power_balance_modifier](/wiki/trigger/has_power_balance_modifier):检查是否存在正在施加影响的 modifier,有助于排查是哪个修正导致了每日变化,常在 if 块内与本 trigger 联合使用进行分支判断。
  • [add_power_balance_modifier](/wiki/effect/add_power_balance_modifier):当 trigger 条件满足后,在对应 effect 块中用此命令叠加或移除 modifier,形成"检测变化速率 → 动态调整天平来源"的完整闭环。

常见坑

  1. 混淆 id 与天平的阵营 keyid 字段必须填写在 common/power_balance/ 中定义的天平本身的唯一标识符,而不是天平某一侧(side)的 key;填写错误不会报错但条件永远不会触发,排查时很难发现。
  2. 忽略运算符限制只用 >=<=:本 trigger 仅支持 ><= 三种运算符,不支持 >= / <=;若需要"大于或等于"的效果,需用 or 包裹 >= 两个子条件来模拟。

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

power_balance_daily_change is commonly used in mod scenarios requiring dynamic responses to fluctuations in power balance change rates. For example, it can trigger warning events when one faction's daily influence acceleration becomes too rapid, or restrict players in decision available blocks to only execute certain diplomatic actions when the balance trend stabilizes.

# Example: Condition check that triggers an event when the daily positive change of power balance exceeds a threshold
available = {
    power_balance_daily_change = {
        id = my_ideological_balance
        value > 0.2
    }
}

Synergy

  • [is_power_balance_in_range](/wiki/trigger/is_power_balance_in_range): Typically paired with this trigger—first check which range the balance currently occupies, then use power_balance_daily_change to determine the direction of movement. Together, they precisely describe the state "balance has shifted to one side and is still accelerating."
  • [power_balance_weekly_change](/wiki/trigger/power_balance_weekly_change): Forms dual short-term/medium-term verification with this trigger. Daily changes capture sudden fluctuations, while weekly changes confirm whether the trend persists. They are commonly used side-by-side in the same and block.
  • [has_power_balance_modifier](/wiki/trigger/has_power_balance_modifier): Checks whether a modifier is currently being applied. Helps identify which modifier caused the daily change. Often used jointly with this trigger inside if blocks for branching logic.
  • [add_power_balance_modifier](/wiki/effect/add_power_balance_modifier): Once trigger conditions are met, use this command in the corresponding effect block to stack or remove modifiers, forming a complete closed loop of "detect change rate → dynamically adjust balance source."

Common Pitfalls

  1. Confusing id with a faction key: The id field must reference the unique identifier of the power balance itself as defined in common/power_balance/, not the key of one side. Incorrect entries will not produce errors but the condition will never fire, making debugging difficult.
  2. Overlooking operator restrictions and using only >= or <=: This trigger supports only >, <, and = operators; >= and <= are not supported. To achieve a "greater than or equal to" effect, wrap > and = in an or block to simulate it.