Component modifiers
Make a machine upgrade able to alter a machine component.
Component modifiers are used to tweak some properties of a machine component.
They are defined in json inside of the components property of the machine upgrade item json.
List of properties that can be modified
Properties
The component modifier has 4 mandatory properties and 4 optional property.
Mandatory properties
Operation
Name : operation
operationDescription :
The mathematical operation that will be applied to the targeted component property by the modifier. The available operations are :
addition: The resulting value will be the sum of the base component value and the modifier value multiplied by the amount of upgrades.final_value = base_value + upgrade_modifier * upgrade_amount
multiplication: The resulting value will be the multiplication of the base component value and the modifier value multiplied by the amount of upgrades.final_value = base_value * upgrade_modifier * upgrade_amount
exponential : The resulting value will be the multiplication of the base component value and the modifier value powered to the amount of upgrades.
final_value = base_value * upgrade_modifier ^ upgrade_amount
Example :
The base component value (defined in the machine json) will be multiplicated by the value defined in this modifier.
Optional properties
Id
Name : id
idDescription :
Some components (fluids and items in CM, more in addons) have an id property that must be specified in the modifier so it know which specific component to modify.
If a component is single (energy, experience, chunkload in CM) the id can be omitted.
Default : empty
empty The modifier will be applied to the single component of the specified type.
Example :
The modifier will be applied to a component with id "input1" :
Tooltip
Name : tooltip
tooltipDescription :
The tooltip that will render when a player hover any machine upgrade item in a gui while holding shift. This is a text component.
Default :
A short string that describe what the modifier does like : -50% Energy capacity
Example :
The tooltip will be "Overclock: Double energy capacity" in orange.
Example
A modifier that double energy capacity :
A modifier that add 50mB of max input in a fluid component with id "input1" :
Last updated