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 =
}

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.