trigger · has_equipment
Definition
- Supported scope:
COUNTRY - Supported target:
none
Description
checks for amount of equipment stored
has_equipmentCOUNTRYnonechecks for amount of equipment stored
实战内容由 AI 生成,并已对照 vanilla 命令词表校验 —— 请当作起点而非权威依据。上方的定义节才是游戏自带文档原文。
has_equipment 常用于判断某国库存装备是否达到门槛,从而决定决策是否可用、焦点是否解锁或 AI 策略是否触发。例如在资源消耗型决策中,可以将其写在 available 块里,确保玩家手中有足够的步枪或坦克才能执行该决策:
available = {
has_equipment = {
infantry_equipment > 500
}
}
[add_equipment_to_stockpile](/wiki/effect/add_equipment_to_stockpile):先用 has_equipment 检查库存是否充足,再用该 effect 补充或转移装备,形成"判断→操作"闭环。[add_equipment_production](/wiki/effect/add_equipment_production):当 has_equipment 判断库存不足时触发额外生产线,常见于 AI 补给逻辑。[has_army_size](/wiki/trigger/has_army_size):与 has_equipment 联合使用,同时确认部队规模与装备储量都满足条件,避免出现有兵无械或有械无兵的情况。[any_owned_state](/wiki/trigger/any_owned_state):在 scope 嵌套中先缩小到特定州判断工厂产能,再回到 COUNTRY scope 用 has_equipment 确认库存,构成更精细的触发条件链。has_equipment 的键名必须与游戏定义的 equipment archetype 名完全一致(如 infantry_equipment、artillery_equipment),大小写及下划线若有误则条件永远为假,且不会报错提示,极难排查。limit 套在 every_owned_state 里面时),条件将无法正确求值,需要先用 PREV/ROOT 切换回国家 scope 再调用。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.
has_equipment is commonly used to check whether a country's equipment stockpile reaches a threshold, thereby determining whether a decision is available, a focus is unlocked, or an AI strategy is triggered. For example, in resource-consuming decisions, you can place it in the available block to ensure the player has sufficient rifles or tanks before executing the decision:
available = {
has_equipment = {
infantry_equipment > 500
}
}
[add_equipment_to_stockpile](/wiki/effect/add_equipment_to_stockpile): First use has_equipment to check whether stockpile is sufficient, then use this effect to replenish or transfer equipment, forming a "check → execute" loop.[add_equipment_production](/wiki/effect/add_equipment_production): When has_equipment determines stockpile is insufficient, trigger additional production lines; commonly seen in AI supply logic.[has_army_size](/wiki/trigger/has_army_size): Used together with has_equipment to simultaneously confirm both army size and equipment stockpile meet conditions, preventing situations where you have troops but no equipment or vice versa.[any_owned_state](/wiki/trigger/any_owned_state): In scope nesting, first narrow down to a specific state to check factory capacity, then return to COUNTRY scope and use has_equipment to confirm stockpile, forming a more granular chain of trigger conditions.has_equipment must exactly match the equipment archetype names defined in the game (such as infantry_equipment, artillery_equipment). Any mistakes in capitalization or underscores will cause the condition to always evaluate as false, and no error message will be displayed, making it extremely difficult to debug.limit is nested within every_owned_state), the condition will fail to evaluate correctly. You must use PREV/ROOT to switch back to country scope before invoking it.