Hands-On Usage
power_balance_value is commonly used to dynamically trigger events or unlock decisions based on the current value of the power balance, such as activating special options when one faction's influence accumulates to a specific threshold. Typical scenarios include Cold War-themed mods where you check whether "East-West influence" has reached a critical point, thereby triggering proxy war or diplomatic crisis events.
# Allow a certain decision when power balance exceeds 0.7
available = {
power_balance_value = {
id = east_west_balance
value > 0.7
}
}
Synergy
[is_power_balance_in_range](/wiki/trigger/is_power_balance_in_range): Using these together allows you to check whether the balance value falls within a specific range. power_balance_value checks single-direction thresholds, while is_power_balance_in_range checks two-sided boundaries. They complement each other to cover different judgment needs.
[is_power_balance_side_active](/wiki/trigger/is_power_balance_side_active): Before reading the balance value, first confirm that one side of the power faction is in an active state, avoiding unexpected judgments when the balance has not yet been initialized.
[add_power_balance_value](/wiki/effect/add_power_balance_value): Commonly used in effect blocks. After a trigger condition is met, immediately modify the balance value, forming a "threshold reached → further push the balance" chain logic.
[has_power_balance_modifier](/wiki/trigger/has_power_balance_modifier): Pair with numerical checks by first confirming whether a certain modifier exists before judging the current value, preventing you from overlooking prerequisite conditions that affect balance changes.
Common Pitfalls
- Incorrect
id spelling or inconsistency: The id must exactly match the id declared in the power_balance definition file, and is case-sensitive. If you misspell the id, the game will not report an error but the trigger will always return false, making it extremely difficult to debug.
- Misusing operators like
>= or <=: This trigger only supports three operators: >, <, and =. Using >= will cause script parsing to fail or be silently ignored. To achieve "greater than or equal to a certain value," use the workaround: not = { power_balance_value = { id = xxx value < target_value } }.