A library to ease the implementation of (but not only) random spoilage results in your mods. It allows you to set random and/or conditional spoilage results dependent on things accessible at runtime (like temperature, surface, surface conditions, speed, whatever). Please reach out to me on Discord or Github if you encounter issues. Please see the Github repo for the documentation.
Lua libraries for use by other mods and submods that are parts of a larger mod.
Version: 2.0.4 Date: 2025-09-04 Changes: - Fix a bug in conditional results choice, thanks to Majoca22. This bug was introduced in the last bugfix in weighted choice... - Add usage for several parameters at data stage (fallback spoilage, additional trigger). - Remove unused original_item_spoil_ticks - Improve documentation - Change the name of "data_raw_table" to "original_item_type" for better clarity
Version: 2.0.3 Date: 2025-08-24 Changes: - Fix a bug in weighted choice.
Version: 2.0.2 Date: 2025-08-24 Changes: - Add compatibility with other things than "item" (like modules)
Version: 2.0.1 Date: 2025-08-24 Changes: - Correct Readme, thanks to Jeff.
Version: 2.0.0 Date: 23. 08. 2025 Changes: - Remove "register spoilable item" in favor of using the new "mod data" model. - Integrate various API/Engine upgrades. - Select result is now run first when a RSL item is detected, instead of running only when found in a container. This shouldn't affect negatively performance in a real world scenario.
Version: 1.0.2 Date: 28. 03. 2025 Changes: - Add an arg to the data registry, allowing to set placeholder_spoil_into_self (last pos arg) for each individual item. - Using a remote call to set placeholder_spoil_into_self will now override the aforementioned setting for ALL items. - Also some doc cleanup.
Version: 1.0.1 Date: 28. 03. 2025 Changes: - Remove the switch to enable / disable swap in assemblers as it's no longer needed. - Remove some unused funcs.
Version: 1.0.0 Date: 27. 03. 2025 Changes: - Performance improvements. Features: - By PennyJim : Add support for non-boolean conditions (new advanced example showcases this) Bugfixes: - Remove global variable assignation.
Version: 0.2.2 Date: 17. 03. 2025 Changes: - Add new inventories handling.
Version: 0.2.1 Date: 10. 03. 2025 Bugfixes: - Fix missing nil check.
Version: 0.2.0 Date: 10. 03. 2025 Major Features: - Dramatically improve performance (time usage reduced by about half). Changes: - Use the question mark signal icon for the placeholders. - Change some swap functions slightly to prevent potential crashes.
Version: 0.1.4 Date: 10. 03. 2025 Bugfixes: - Solve multiple crashes : - Add support for modules in beacons, assembling machines, and furnaces
Version: 0.1.3 Date: 02. 03. 2025 Bugfixes: - Solve multiple crashes : - Add support for cargo pods - Add support for assembling machines - Add support for boilers - Add support for labs and implement a fix for factorio's 2.0.38 version - Solve a crash with the mining drills, but only add limited support. If you use RSL to add spoilable ores, you need to define a fallback for your ore or set placeholder_spoil_into_self to true
Version: 0.1.1 Date: 13. 02. 2025 Bugfixes: - Add support for construction robots
Version: 0.1.0 Date: 12. 02. 2025 Major Features: - Initial release.