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
- 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.
- 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.