Resupply

== Resupply ==
New in 3.0.1.0
Units can now be designated as "resupply" units. If such a unit is found, all units friendly to that unit will be given a "resupply" ability. When those units are within range of the resupply unit, they can then initiate a resupply. To be clear, the unit that does the resupplying is not the unit that activates the abilit; rather the unit to be resupplied activates the resupply ability. In theory, the AI should also try to use the resupply ability if they have a weapon that has run out of ammo.
On activating the "resupply" ability, all friendly resupply units within 1000m will be indicated using the color/assets from ResupplyIndicatorAsset and ResupplyIndicatorColor, while all friendly resupply units within resupply range will be indicated using the color/assets from ResupplyIndicatorInRangeAsset and ResupplyIndicatorInRangeColor.
In the below image, both Unnsvin carriers are potential resupply units. The purple indicator is currently out of range, while the gold indicator is within range. The shaded circle radius indicates the max move distance of the unit (so players can judge whether they could potentially move to within range of a resupply). 
On initiating the resupply, both the unit being resupplied and the unit doing the resupplying will shut down, and remain shut down for the # of phases (rounded to integer) from BasePhasesToResupply, ResupplyPhasesPerAmmoTonnage, ResupplyPhasesPerArmorPoint, and modified by UnitTagFactor.
For example:
 	<BasePhasesToResupply": 30.0,
 	"ResupplyPhasesPerAmmoTonnage": 30,
 	"ResupplyPhasesPerArmorPoint": 30,
 	"UnitTagFactor": {
 		"easy_resupply": 0.1,
 		"superheavy_resupply": 2.0
 	}</code>
Given the above settings, a unit with both the above tags, getting 1 ton of ammo and 5 points of armor resupplied would take:
 `[30 (base) + 30 (ammo) + 150 (5x30, armor)] x 0.2 (0.1 x 2.0, tags) = 42 phases`
The way actual resupplying works is thus: if a unit being resupplied has ammunition bins that are not full, it will 1st attempt to search the Resupply unit for bins with matching ammo type. If found, the ammo will be transfered 1:1 until either the unit being supplied has refilled bins, or the Resupply unit runs out of that ammo type. If no matching ammo type is found, or the bins are unable to be filled using "real" ammo, then we will search for SPAMMY (SPAce Magic Modular by Yang) ammo. SPAMMY ammo works by finding the tonnage-per-shot of the "real" ammo, and then consuming the appropriate amount of SPAMMY ammo to be roughly equivalent tonnage. Due to floating point errors and lack-of-fucks given by yours truly, you'll often end up with 1 fewer shots in the "real" bin than you'd expect (i.e. 1 ton of SPAMMY gets you 119 LRMs instead of 120). No one ever said transmogrification was perfect.
Armor repair works somewhat similarly to SPAMMY ammo, in that a special "ammo" type for repairing armor must be defined. The number of "shots" in bins of this ammo is equivalent to the number of armor "points" that can be restored to units being resupplied. The amount of armor that can be "restored" to a given location is a function of the ArmorRepairMax value and the initial armor for that location. ie, if ArmorRepairMax: 0.9, armor can only be restored up to 90% of the initial assigned armor for that location. Destroyed or missing locations can (obviously) not have armor restored.
Category:Guides