effect · set_equipment_fraction
Definition
- Supported scope:
COUNTRY - Supported target:
none
Description
Modify all equipments by factor
set_equipment_fractionCOUNTRYnoneModify all equipments by factor
实战内容由 AI 生成,并已对照 vanilla 命令词表校验 —— 请当作起点而非权威依据。上方的定义节才是游戏自带文档原文。
set_equipment_fraction 常用于事件或决议中模拟战争损耗、封锁物资效果,或在游戏开局强制设置某国装备库存比例以达到平衡性目的。例如在一个"经济崩溃"事件中,将某国所有装备数量按比例大幅缩减:
country_event = {
id = my_mod.5
# ...
option = {
name = my_mod.5.a
# 触发后装备存量降至原来的30%
set_equipment_fraction = 0.3
}
}
[has_army_manpower](/wiki/trigger/has_army_manpower) — 在触发条件中先判断该国兵力规模,再决定是否通过装备缩减来模拟供给短缺,逻辑更严谨。[add_manpower](/wiki/effect/add_manpower) — 装备被大幅削减后,通常同步削减兵力储备,两者配合模拟全面战略损耗。[add_equipment_to_stockpile](/wiki/effect/add_equipment_to_stockpile) — 可在 set_equipment_fraction 之后用于补发特定装备,实现"清空再重新分配"的精细化装备重组效果。[add_ideas](/wiki/effect/add_ideas) — 配合国策或事件给予对应的减产/补给不足理念,为装备比例变动提供叙事与数值上的双重支撑。1.0 表示维持原状,新手容易误传整数(如 30)误以为是百分比,实际上会导致装备数量暴增至极端值。set_equipment_fraction 只能在 COUNTRY scope 下执行,若写在 STATE scope(例如 every_owned_state 的内部块)中则会静默失效,脚本不会报错但效果完全不生效,排查时极易遗漏。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.
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
}
}
[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.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.set_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.