Wiki

effect · set_equipment_fraction

Definition

  • Supported scope:COUNTRY
  • Supported target:none

Description

Modify all equipments by factor

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

set_equipment_fraction is commonly used in events or decisions to simulate war attrition, blockade effects, or to enforce initial equipment stockpile ratios for balance purposes at game start. For example, in an "economic collapse" event, you can proportionally reduce a country's entire equipment stockpile:

country_event = {
    id = my_mod.5
    # ...
    option = {
        name = my_mod.5.a
        # Equipment stockpile reduced to 30% of original after trigger
        set_equipment_fraction = 0.3
    }
}

Synergy

  • [has_army_manpower](/wiki/trigger/has_army_manpower) — Check the country's manpower pool in trigger conditions before deciding whether to apply equipment reduction to simulate supply shortages, resulting in more sound logic.
  • [add_manpower](/wiki/effect/add_manpower) — After equipment is significantly reduced, typically reduce manpower reserves in sync to simulate comprehensive strategic attrition across both resources.
  • [add_equipment_to_stockpile](/wiki/effect/add_equipment_to_stockpile) — Can be used after set_equipment_fraction to redistribute specific equipment types, achieving fine-grained equipment reorganization with a "clear and reallocate" pattern.
  • [add_ideas](/wiki/effect/add_ideas) — Pair with national focuses or events to apply corresponding reduced production or supply shortage ideas, providing both narrative and numerical support for equipment ratio changes.

Common Pitfalls

  1. Misusing decimal ranges — The parameter is a factor value; passing 1.0 maintains current state. Beginners often mistakenly input integers (e.g., 30) thinking it's a percentage, when in reality this causes equipment quantities to spike to extreme values.
  2. Ignoring scope restrictionsset_equipment_fraction only executes within COUNTRY scope. If placed in STATE scope (for example, inside an every_owned_state block), it silently fails without throwing errors, making it extremely easy to overlook during debugging since the script produces no effect whatsoever.