Wiki

effect · send_equipment_fraction

Definition

  • Supported scope:COUNTRY
  • Supported target:THIS, ROOT, PREV, FROM, OWNER, CONTROLLER, OCCUPIED, CAPITAL

Description

Sends to target scope specified fraction of equipment.
Example:
send_equipment_fraction = {
	target = FROM
	value = 0.3 # Clamped in code to the range [0,1].
}

实战 · 配合 · 坑

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

实战用法

send_equipment_fraction 常用于 mod 中模拟宗主国向附庸/盟友紧急援助装备的场景,例如在某事件触发后将己方库存的一定比例武器移交给目标国家。也适合用于内战分裂时让分裂出的新国家继承原国家部分军备,避免其白手起家。

# 宗主国在事件中援助附庸国装备
country_event = {
    id = my_mod.1
    option = {
        name = my_mod.1.a
        # 以 FROM 为援助目标,转移己方 20% 的装备
        send_equipment_fraction = {
            target = FROM
            value = 0.2
        }
    }
}

配合关系

  • [add_equipment_to_stockpile](/wiki/effect/add_equipment_to_stockpile):在发送装备前先向己方库存补充特定装备,确保转移时有足量存货可供划拨。
  • [has_army_manpower](/wiki/trigger/has_army_manpower):用于判断目标国是否已有足够兵力来实际使用援助的装备,作为触发条件把关。
  • [add_opinion_modifier](/wiki/effect/add_opinion_modifier):援助装备后同步添加好感修正,模拟援助行为对双边关系的外交影响。
  • [add_equipment_subsidy](/wiki/effect/add_equipment_subsidy):与补贴机制搭配,可区分"一次性转移库存"与"持续生产补贴"两种援助模式,按 mod 需求灵活选用。

常见坑

  1. 忽略 value 的含义是"分数"而非"数量":新手常误以为 value = 50 是转移 50 件装备,实际上该字段是 0 到 1 之间的比例(代码会强制钳位),填大于 1 的数相当于转移全部库存,与预期逻辑完全不符。
  2. target 只能填固定 scope 关键字target 不支持直接写国家标签(如 GER),必须使用 FROMROOTPREV 等 scope 指针;若在错误的上下文中引用了无效 scope,装备会静默失败且不报错,极难排查。

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

send_equipment_fraction is commonly used in mods to simulate scenarios where a suzerain provides emergency equipment aid to a vassal or ally, such as transferring a certain percentage of one's own stockpile to the target nation after an event triggers. It is also useful during civil wars and splits to allow the newly formed state to inherit part of the original nation's military equipment, preventing it from starting from scratch.

# Suzerain provides equipment aid to vassal in event
country_event = {
    id = my_mod.1
    option = {
        name = my_mod.1.a
        # Send 20% of own equipment to FROM as the aid recipient
        send_equipment_fraction = {
            target = FROM
            value = 0.2
        }
    }
}

Synergy

  • [add_equipment_to_stockpile](/wiki/effect/add_equipment_to_stockpile): Replenish specific equipment to your own stockpile before sending, ensuring sufficient inventory available for allocation during transfer.
  • [has_army_manpower](/wiki/trigger/has_army_manpower): Judge whether the target nation has sufficient manpower to actually utilize the aided equipment, serving as a gate-keeping trigger condition.
  • [add_opinion_modifier](/wiki/effect/add_opinion_modifier): Add opinion modifiers in parallel after equipment aid to simulate the diplomatic impact of the aid on bilateral relations.
  • [add_equipment_subsidy](/wiki/effect/add_equipment_subsidy): Pair with subsidy mechanics to distinguish between "one-time stockpile transfer" and "continuous production subsidy" modes, flexibly choosing based on mod requirements.

Common Pitfalls

  1. Misunderstanding that value represents "fraction" rather than "quantity": Beginners often mistakenly believe value = 50 transfers 50 pieces of equipment, when in fact this field is a ratio between 0 and 1 (the code will force clamp it). Setting a value greater than 1 is equivalent to transferring the entire stockpile, which is completely contrary to expected logic.
  2. target can only accept fixed scope keywords: target does not support directly writing country tags (such as GER); you must use scope pointers like FROM, ROOT, PREV, etc. If an invalid scope is referenced in the wrong context, equipment transfer fails silently without error reporting, making it extremely difficult to debug.