Wiki

effect · add_equipment_to_stockpile

Definition

  • Supported scope:COUNTRY
  • Supported target:any

Description

Add or remove equipment from country stockpiles.
Example:
add_equipment_to_stockpile = {
	type = strat_bomber_equipment_2
	amount = 100 # May be a variable. Equipment will be removed if the value is negative.
	producer = USA # Optional. If not specified the effect will be applied to all creators.
}

实战 · 配合 · 坑

实战内容由 AI 生成,并已对照 vanilla 命令词表校验 —— 请当作起点而非权威依据。上方的定义节才是游戏自带文档原文。

实战用法

add_equipment_to_stockpile 常用于事件奖励、国策完成后向玩家/AI国家发放特定装备,或在剧本开局时预置历史存量武器。例如,在二战模组里可以通过该指令让某国在特定科技解锁后立即获得一批对应型号的装备,也可以用负数值模拟战争消耗或条约裁军。

# 国策完成后,美国获得一批战略轰炸机(由美国自产)
complete_national_focus = focus_strategic_bombing
add_equipment_to_stockpile = {
    type = strat_bomber_equipment_2
    amount = 50
    producer = USA
}

配合关系

  • [has_tech](/wiki/trigger/has_tech)(需自行确认已解锁)→ 通常配合科技判断,确保发放的装备型号已被该国研究,否则装备入库后无法使用。
  • [add_equipment_production](/wiki/effect/add_equipment_production) → 先用本指令给一批初始存量,再挂载生产线,模拟"历史库存 + 持续生产"的双重补给效果。
  • [add_manpower](/wiki/effect/add_manpower) → 装备与人力往往成对发放,用于快速组建一支可部署的部队,多见于内战触发或剧本开局场景。
  • [country_event](/wiki/effect/country_event) → 作为事件选项的即时效果执行,当玩家选择某个外交/军事选项时触发装备转移,是最常见的封装容器。

常见坑

  1. 型号未解锁导致装备"消失"type 填写的装备型号必须是该国已研究(或通过许可证/变体获得)的科技,若国家尚未解锁对应科技,装备依然会进入库存但实际上无法装备部队,造成数量对不上的困惑。建议配合 [has_tech](/wiki/trigger/has_tech)can_research 提前校验。
  2. 忽略 producer 字段的影响:不填 producer 时效果作用于"所有生产者"的库存,这在多方联合生产的情境下可能产生意外的装备来源标记;如果后续逻辑依赖特定生产国属性(如许可证追踪),漏填会导致难以排查的逻辑错误。

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_equipment_to_stockpile is commonly used to grant specific equipment to players or AI nations as event rewards, upon national focus completion, or to pre-populate historical weapon stocks at scenario start. For example, in WWII mods you can use this command to instantly grant a batch of corresponding equipment models to a nation after a specific technology is unlocked, or use negative values to simulate combat losses or treaty-enforced disarmament.

# After completing a national focus, the USA receives a batch of strategic bombers (produced by USA)
complete_national_focus = focus_strategic_bombing
add_equipment_to_stockpile = {
    type = strat_bomber_equipment_2
    amount = 50
    producer = USA
}

Synergy

  • [has_tech](/wiki/trigger/has_tech) (requires manual verification of unlock) → Typically paired with technology checks to ensure the granted equipment model has been researched by the nation; otherwise the equipment enters stockpile but cannot actually be equipped to units.
  • [add_equipment_production](/wiki/effect/add_equipment_production) → Use this command to provide initial stockpile, then attach production lines to simulate a dual-supply effect of "historical reserves + ongoing production."
  • [add_manpower](/wiki/effect/add_manpower) → Equipment and manpower are often distributed together to rapidly mobilize a deployable force, commonly seen in civil war triggers or scenario starts.
  • [country_event](/wiki/effect/country_event) → Executed as an immediate effect within event options; when players select certain diplomatic or military choices, equipment transfers are triggered, making it the most common wrapper.

Common Pitfalls

  1. Equipment "disappears" due to unlocked model mismatch: The equipment model specified in type must be a technology already researched (or obtained via license/variant) by the nation. If the nation hasn't unlocked the corresponding technology, the equipment still enters stockpile but cannot actually be assigned to units, causing confusing discrepancies in numbers. It's recommended to pre-validate with [has_tech](/wiki/trigger/has_tech) or can_research.
  2. Overlooking the producer field's impact: When producer is omitted, the effect applies to stockpiles of "all producers," which in multi-party joint production scenarios may result in unexpected equipment source markings. If subsequent logic depends on specific producer attributes (such as license tracking), omitting this field leads to hard-to-debug logical errors.