Wiki

trigger · stockpile_ratio

Definition

  • Supported scope:COUNTRY
  • Supported target:none

Description

Compares the ratio of equipment archetype in stockpile vs used. a value of 2 means we have double in stockpile of what is fielded or in training.

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

stockpile_ratio is commonly used in AI decision-making or focus availability checks to prevent triggering large-scale warfare or military expansion when ammunition/equipment stockpiles are insufficient. For example, in a custom decision, you might require the nation to have adequate equipment on hand before unlocking offensive strategic options:

available = {
    stockpile_ratio = {
        archetype = infantry_equipment
        ratio > 1.5
    }
}

Synergy

  • [fuel_ratio](/wiki/trigger/fuel_ratio): Both are "ratio-based" resource checks and are frequently used together within the same limit block to comprehensively assess a nation's war readiness.
  • [has_army_size](/wiki/trigger/has_army_size): Confirm troop size first before checking stockpile ratio to avoid false positives where inflated ratios occur when the military is extremely small.
  • [add_equipment_to_stockpile](/wiki/effect/add_equipment_to_stockpile): Acts as a complementary effect; when stockpile_ratio triggers rewards or supply decisions, it directly injects additional equipment into the stockpile.
  • [conscription_ratio](/wiki/trigger/conscription_ratio): Pair with manpower ratio to comprehensively evaluate whether a nation meets full mobilization conditions before triggering relevant AI strategies.

Common Pitfalls

  1. Inflated ratio trap: When a nation has almost no troops deployed in the field (fielded approaches 0), even minimal stockpile quantities will produce extremely high ratios, causing the condition to unexpectedly evaluate as true. You should combine this with filters like [has_army_size](/wiki/trigger/has_army_size) to exclude such edge cases.
  2. Confusion between archetype and equipment: This trigger requires the archetype of the equipment, such as infantry_equipment, not a specific variant or technology name. When filled incorrectly, the game may not report an error, but the condition will never match correctly, causing the logic to silently fail.