Multi-spoil


An API for working with items that spoil into multiple items

Internal
a month ago
2.0
4.49K
Factorio: Space Age Icon Space Age Mod
Owner:
LambdaLemon
Source:
https://github.com/lemonlambda/multispoil
Homepage:
https://discord.gg/2VPrc2727Z
License:
MIT
Created:
10 months ago
Latest Version:
2.1.2 (a month ago)
Factorio version:
2.0
Downloaded by:
4.49K users

API for making spoiling items into multiple things.

Example:

local multispoil = require("__multispoil__.api")

data.raw["item"]["iron-plate"].spoil_ticks = 5 * 60 -- 5 sec spoil time
data.raw["item"]["iron-plate"].spoil_to_trigger_result = multispoil.create_spoil_trigger({["iron-ore"] = 1, ["copper-ore"] = 5, ["copper-plate"] = 5}) -- spoils into 1 iron ore or 5 copper ore or 5 copper plates

data.raw["item"]["copper-plate"].spoil_ticks = 5 * 60 -- 5 sec spoil time
data.raw["item"]["copper-plate"].spoil_to_trigger_result = multispoil.create_spoil_weighted_trigger({["iron-plate"] = {weight = 3, count = 1}, ["copper-plate"] = {weight = 2, count = 1}, ["iron-ore"] = {weight = 1, count = 1}}) -- spoils into iron ore or copper or or copper plates