Hands-On Usage
power_balance_weekly_change is commonly used in the Power Balance system to dynamically trigger events, such as launching diplomatic events or special decisions when one side's weekly change exceeds a threshold. In Cold War-themed mods, it can be used to detect whether the "ideological scale" is rapidly tilting toward one side, providing players with intervention opportunities.
# If weekly change is greater than 0.3, trigger the "Situation Rapidly Escalates" event
trigger = {
power_balance_weekly_change = {
id = cold_war_balance
value > 0.3
}
}
Synergy
[power_balance_value](/wiki/trigger/power_balance_value): First use power_balance_value to check the current absolute value range, then use this trigger to judge the trend. Combined together, they can precisely capture the dangerous state of "currently at extreme values and still rapidly shifting."
[is_power_balance_in_range](/wiki/trigger/is_power_balance_in_range): Using in combination allows you to distinguish between "still within safe range but acceleration increasing" and "already out of bounds," enabling layered and well-structured conditional logic.
[add_power_balance_modifier](/wiki/effect/add_power_balance_modifier): After the weekly change trigger condition is met, use this command in the effect block to apply modifiers, forming a complete closed-loop logic of "detect anomaly → apply suppression modifier."
[power_balance_daily_change](/wiki/trigger/power_balance_daily_change): Compare with daily change triggers to determine whether the power balance's short-term fluctuations and medium-term trends are consistent, avoiding accidental triggers caused by single-day spikes.
Common Pitfalls
- Incorrect operator syntax: This trigger only supports three operators:
>, <, and =. It does not support >= or <=. Beginners often apply the habit from regular check_variable syntax and write value >= 0.5, resulting in script parsing failure or silent logic errors.
- Ignoring the positive/negative directional meaning: The sign of weekly change indicates which side the power balance is moving toward. Writing only
value > 0 can only capture "shifting toward the positive side." To detect "rapid changes in any direction," you must use two separate condition blocks to judge positive and negative values respectively, wrapped with OR. You cannot use absolute value shorthand.