Skip to main content

Machine Upgrades

Machine upgrades are addon-owned items whose numeric perks are resolved by DoriosCore. A normal upgrade needs three matching definitions:

DoriosLib registration
item ID -> type, levels, and perk values

Machine block component
accepted type -> exact helper-entity slot and maximum level

Machine runtime
scans configured slots -> exposes the result as machine.boosts

The standard upgrade UI displays those same helper-entity slots. It does not register or apply the perks by itself.

What you will add

This section adds three upgrade categories to the Thermal Crusher:

Upgrade itemCategoryStandard perks
Example Speed Upgradespeedspeed, energy_cost
Example Efficiency Upgradeenergyenergy_efficiency
Example Batch Upgradebatchprocess_batch, energy_cost

These are the standard values automatically interpreted by Machine:

BoostBaseMeaning
speed1Work-speed multiplier.
energy_cost1Energy-cost multiplier before efficiency.
energy_efficiency1Divisor that reduces effective consumption.
process_batch1Maximum operations completed by one process cycle.
consumptioncalculatedenergy_cost / energy_efficiency, clamped above zero.

Registered perk values are added to these bases. A level with speed: 0.25 produces machine.boosts.speed === 1.25.

Files used

FilePurpose
BP/items/examples/example_*_upgrade.jsonDefines the three installable items.
BP/scripts/config/upgrades.jsRegisters categories, levels, and perks through DoriosLib.
BP/scripts/config/index.jsLoads the registration module.
BP/blocks/examples/example_thermal_crusher.jsonDeclares accepted types, slots, and maximum levels.
RP/ui/first_machine_ui.jsonDisplays the exact upgrade slots.
RP/texts/en_US.langItem names and upgrade action-bar names.

The item behavior and block component are supplied by UtilityCraft. Your extension uses them directly and does not duplicate their script implementations.

Tutorial order

  1. Register an upgrade
  2. Speed
  3. Energy cost
  4. Process batch

For every compiled field and duplicate-category rule, see the technical MachineUpgradeRegistry reference. For the registration transport itself, see DoriosLib.registry.registerMachineUpgrade.

Start with Register an upgrade.