Wiki

effect · add_power_balance_modifier

Definition

  • Supported scope:any
  • Supported target:none

Description

adds static modifier to power balance

Example:
add_power_balance_modifier = {
	id = power_balance_id
	modifier = static_modifier_id # this must be defined in the static modifier database
}

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

add_power_balance_modifier is commonly used in mods featuring the Power Balance system, such as applying persistent weighted modifiers to a faction after a certain event option triggers, reflecting long-term impacts in diplomacy, military affairs, or ideology. Typical scenarios include adding a favorable modifier to the corresponding power balance upon the player's completion of a specific national focus.

# Add a modifier to the global power balance upon focus completion
focus = {
    id = strengthen_axis_influence
    ...
    completion_reward = {
        add_power_balance_modifier = {
            id = global_power_balance
            modifier = axis_influence_boost
        }
    }
}

Synergy

  • [has_power_balance_modifier](/wiki/trigger/has_power_balance_modifier): Before applying a new modifier, first check whether the modifier already exists to avoid unintended stacking effects.
  • [remove_power_balance_modifier](/wiki/effect/remove_power_balance_modifier): Used in tandem with this command to remove previously added modifiers under specific conditions, enabling dynamic power balance management.
  • [is_power_balance_in_range](/wiki/trigger/is_power_balance_in_range): After adding a modifier, use this trigger to verify whether the current balance value falls within the expected range, driving subsequent conditional logic branches.
  • [remove_all_power_balance_modifiers](/wiki/effect/remove_all_power_balance_modifiers): When you need to completely reset all modifiers on a power balance (such as at scenario reset nodes), combine this command with a clear-then-add pattern.

Common Pitfalls

  1. The modifier field must reference a static modifier previously defined in the static_modifiers database, otherwise the game will silently ignore it or report an error; beginners often mistakenly insert generic modifier names directly, causing the modifier to fail silently and becoming difficult to debug.
  2. The id field refers to the Power Balance identifier, not the modifier's name itself—these two are easily confused. id points to the balance object you declared in your power_balance definition file; entering the wrong value causes the modifier to attach to the wrong balance or become completely ineffective.