Lua libraries for use by other mods and submods that are parts of a larger mod.
Version: 0.6.2
Date: 2026-10-13
Minor Features:
- Added functions add_ingredients(mapping), add_results(mapping), and their inverse remove_*. Usage seen in example-mod.lua
Other:
- Function replace_entry() now reuses add_or_increment() and remove_or_decrement(), allowing easy validation.
Bugfixes:
- Effects, like allow_productivity are now correctly copied to the new recipes.
Changes:
- *_crafting_categories() prefer mapping instead of (recipe, cat). Legacy for old behaviour.
Version: 0.6.1
Date: 2026-10-13
Bugfixes:
- Some functions in icon_helper were incorrectly calling a debug function. Bug found by Enderpower.
Version: 0.6.0
Date: 2026-10-12
Compatibility:
- Set [Space Age] as optional dependency, as it is not strictly needed for this helper mod. Removed space age flag, too.
Mod authors: Be aware that some features require [Space Age] to be installed (mainly the recipe generator).
Please use [Space Age] as dependency if you use a crafting category from that or if are unsure.
Separating the [Space Age] rules from the [base game] rules allows for more flexibility and less dependency issues.
- Added [centrifuging-with-fluid] as placehoder mod. I'm sure some mod wanna use that, and if not I'll make one myself.
- Added [khaoslead] as possible alternative to [bzlead] for lead
Minor Features:
- Localised names now should be created mostly automatically. If one result: that's the base name for localisation, else: recipe-name.
- unregister_item_blacklist() also accepts a string for one item, not only a list of item(s).
- add_tech_unlocks() and remove_tech_unlocks() work similar to add_recipe_unlocks() and remove_recipe_unlocks(), but have the oposite order.
Usage: `add_tech_unlocks({["technology-name-1"] = { "item-name-1", "item-name-2", })`
- Added unit converter for energy/power/... so strings like "0.4kJ" can be used for calculations.
- More documentation for library functions
- Some API function are now slightly more flexible (eg. register_category_blacklist also accepts string aside of a table)
- Updated icon_helper.apply_overlay() and apply_overlay_to_many() to use the revised argument interface.
- Renamed change_multiple_group() to change_recipes_group() and made it check weather the target group exists.
- change_recipes_subgroup() now checks weather the target subgroup exists.
- Added register_all_item_blacklist(), register_all_category_blacklist(), and their unregister_* version.
It accepts table|string of item(s)/categories for blacklisting in all existing cat of the rules_table.
- Added validation checks for recipe manipulation functions for adding/removing of ingredients/results/categories.
- Added validation checks for all tech manipulating functions.
Changes:
- Renamed add_crafting_category() to add_crafting_categories(), and same for remove_*(), with backwards compat until the next version.
- Always set `allow_decomosition` to false, as the created recipes are shortcuts, not the normal way.
- Finally fixing recycling: `auto_recycle` is always false
- Added tungsten steel to item blacklists for all categories, including metallurgy. This can be recipe-breaking, so please check your factory.
- Changed overlayer so that it uses the base/DLC game graphics and not an additional png. => Phase out manual created overlays soon.
- Adding rocket fuel, LDS, and processor units to the blacklist of most categories of the rules table, marking it as not skip-able to allow the bonus. Small chance of breaking used recipes.
Bugfixes:
- Byproducts are now mulitpied by the amout of how many times a recipe is needed for the recipe generator.
- Fixed that base recipe icon(s) was not used for newly generated recipes
- Fixed surface conditions were not correctly copied. This can be recipe-breaking, so please check your factory.
- Fixed an error if (by)products had probabities.
- Fixed that results with amount = 0 are nor removed correctly (crashed previously.
Version: 0.5.4
Date: 2026-07-31
Changes:
- Added electric motor unit to item-blacklists for metallurgy, organic, cryogenic.
- Added explosives to the item-blacklist for organics and cryogenics. I recommend my [OCs Ammo Casting] mod to get some organic explosives.
- register_item_blacklist() also accepts a string for a single item.
Bugfixes:
- Fixed that blacklisted items might not be registered at boot-up.
Version: 0.5.3
Date: 2026-07-08
Bugfixes:
- add_or_increment() now correctly writes probability entries into the table and serveral others.
- remove_or_decrement() had several issues, like adding instead of subtracting, not removing at all...
Version: 0.5.2
Date: 2026-07-03
Compatibility:
- Pushed mod settings for compatibility with [Planet Picker] into the base mod, as that is better than for every submod.
Bugfixes:
- Fixed internal typo with [Muluna] dependency. Now it is shown correctly.
Version: 0.5.1
Date: 2026-07-03
Bugfixes:
- Fixed that add_or_increment() function did not work correctly with the new probability handling in Factorio 2.1.
Version: 0.5.0
Date: 2026-07-02
Major Features:
- Upgraded to Factorio 2.1
- Reworked alternative recipes for the generator. Now it is all keyed by numbers instead of just a list. This allows for agnostic adding of alternative recipes.
- Reworked recipe generator such that it now can take recipes (e.g. now two different recipes for the same item result in different outcomes)
For mod authors: Check if you need to create a migration script for changed recipes.
- Reworked and added new functions for alternative recipes (register, overwrite, unregister).
- If excessive logging is enabled (not by default), the the recursion depth of the recipe resolver is now logged.
- Set allow_decomposition to false, hopefully this prevents weirdly long and uggly recycling "recipes"
- Activate mod setting "material retaining factor". Similar to the crafting time factor, it has a huge influence, be careful.
- New localisation helper function for setting strings to recipes and other prototypes via mapping.
- New setting "maximal recursion depth" (default: infinite). Just in case you realy realy dislike the concept of decomposing recipes, but like other parts of my mods. There you have it.
Minor Features:
- Expanded all overlay related function to not only accept icon path, but also icon_size, icon_mipmap, scale, shift, tint.
- Added "*_crafting_category" functions and added new functions to add/overwrite/remove one or multiple crafting categories to one or multiple recipe(s).
Changes:
- Updated add_or_increment() and remove_or_decrement() functions as "probability" was reworked in Factorio 2.1.
- Renamed change_crafting_category() to overwrite_crafting_category() function to accept a list of categories because Factorio 2.1.
Graphics:
- Added new overlay graphics for water and shifted the overlayer for lava slightly to the left.
- Fixed icon overlay if multiple fluid ingredients are used. Now it shows the correct number of fluid ingredients in the icon. At least most of the time...
Compatibility:
- [BZ-lead] Separated compatibility code into dedicated file.
- [Muluna] added compatibility.
Bugfixes:
- Fixed that unregister_category_blacklist(cat, category_list) was broken.
- Fixed that overwrite_category_overlays() accidentally overrite fluid overlays and not category overlays.
Other:
- Updated README.md for other mod authors.
- Added modules to the item blacklist for all, except the electromagnetics category. Item blacklists need more work, but this is a start.
Version: 0.4.3
Date: 2026-05-01
Changes:
- Internally changing the format for the tech normalizer.
- For recipes, replace_ingredient/result functions now accepts number|nil instead of boolean for new_amount instead of old keep_amount.
- Rearranges the probability handling of the recipe generator to oc_recipe, where it is be used by the other functions as well.
- "add/remove_tech_ingredient(tech,packs)" will be phased out and replaced by "add/remove_tech_ingredients(mapping)".
Use the mapping ones, but the other are still supported for backwards compatibility
Graphics:
- New mod icon.
Version: 0.4.2
Date: 2026-04-19
Bugfixes:
- Fixed missing require for the debug_log calls in oc_tech and oc_recipe.
Version: 0.4.1
Date: 2026-04-19
Balancing:
- I found a calculation error within the generator. The cost reduction was not applied at all.
I reindtroduced the linear factor and by default set it to 0.8, meaning each intermediate step only accounts 80% to the final recipe.
- I found another calculation error with the crafting time calculation which ignored if a subrecipe is used multiple times.
It has no use here other than helping other modders.
Other:
- Moved the "example-mod.lua" compat example file from [OCs Foundry Expansion] to here, so that other modders find it easier on how to use this library.
Changes:
- Started to reorder the helper functions. The tech and recipe related helpers now got their dedicated file.
This change will be conducted mod by mod so you don't have to update them all at once. I will edit the other mods dependency accordingly so you should not worry at all.
- Added a dedicated debug log tag for tech- and recipe-related helper functions.
Bugfixes:
- Fixed that the remove_prerequ did not work with strings as second part of a table
Version: 0.4.0
Date: 2026-04-13
Major Features:
- Added prefix for all generated recipes ("oc-") to distinct them from others. This makes older version incompatible.
Changes:
- Setting all helper functions to be local to avoid spamming name_space and to prevent issues with other mods. (Breaking change for older versions)
- Set this mod properly to be a [Space Age] mod, which it was from the start.
- Renamed the internal debug mode to prevent issues with other mods.
- Function "allow_productivity" now logs more precisely when something goes wrong and also when it succeeds.
- Hide all created recipes from player crafting gui.
- Moved generator-specific helper function of the recipe-generator.lua file to keep the helper.lua file more general.
- Allow to craft iron-gear-wheel, iron-stick and copper-cable in the organics category.
Bugfixes:
- Made the "add_tech_ingredient" and "remove_tech_ingredient" functions work correctly.
Version: 0.3.4
Date: 2026-02-14
Bugfixes:
- Added another safety check for result_amount in the recipe generator to prevent crashes when it's nil, zero or invalid.
Changes:
- Batch generator now logs both input and output (sucesses and failures) list as one recipe per line to make it more readable.
- Removed old function "replace_multiple_recipes". Use the new, more nuanced functions instead.
- Both "add_recipe_unlocks" and "remove_recipe_unlocks" now log more precisely when something goes wrong.
- Both "add_prerequisites" and "remove_prerequisites" now log more precisely when something goes wrong.
- Batch generator now only handles recipe names, while the single recipe generator handles the full recipe table.
- Set for all generated recipes "allow_decomposition" to false to prevent them from being recycled in the recycler. This should avoid weird edge cases and very long recycling times.
Minor Features:
- New mod setting: debug mode (default: true) so that bugs are easier to fix. Probably will be set to false later.
Version: 0.3.3
Date: 2026-02-10
Minor Features:
- Added basic blacklists and other rules for "cryogenics" category to make it ready for use.
- Added cryo-plant overlay for technologies.
- Added helper functions for adding and removing specific amount of science packs to a tech.
- EXPERMIMENTAL & unfinished: Automated localisations for generated recipes. Currently only EN and DE are supported (as for my other mods using it).
Changes:
- Reduced defalt value of "energy reduction power" setting (aka crafting time power) from 0.5 to 0.25 which makes everything a bit cheaper. Change it manually if needed.
- Changed remove_recipe_unlocks() to accept a mapping table instead of tech and recipe_list. It's now symmetric to add_recipe_unlocks().
- Changed add_prerequisites() to accept a mapping table instead of tech and table of techs. It's now symmetric to the above.
- Added remove_prerequisites(), also symmetric to the above.
- Renamed helper fuction to change_recipes_subgroups()
Version: 0.3.2
Date: 2025-11-07
Bugfixes:
- Fixed bug where add_productivity_bonus wasn't working as intendet at all. Bug was introduced in version 0.3.1.
Version: 0.3.1
Date: 2025-11-06
Bugfixes:
- Added another safety check for add_productivity_bonus in case of a missing recipe.
Version: 0.3.0
Date: 2025-11-05
Major Features:
- Complete rework of the casting generator:
Enable other categories other than "metallurgy" for the generator.
Currently: "electromagnetics", "organic" are in use.
Others like "cryogenic" can be easily added.
- API: Every interaction can be handled with an api function.
Minor Features:
- debug_log() now reveals more information like where it was triggered.
- Updated Factorio version to 2.0.60
- Added descriptions for helper functions.
- Some helper functions now also accept a string too, instead a list or table only.
- Made some helper functions to have the name as a string input instead of the whole data table.
Compatibility:
- ["Krastorio2-spaced-out"] started compatibility.
- ["aai-industry"] support.
Other:
- Removed debug logs when adding recipe unlocks or cloning a table.
Version: 0.2.1
Date: 2025-06-02
Bugfixes:
- Added surface conditions to the generator to prevent cheesing with casting recipes.
Version: 0.2.0
Date: 2025-06-02
Major Features:
- Introducing the casting generator: it generates casting recipes.
- Introducing a setting to change the crafting time reduction factor for the generator.
Graphics:
- Changed all overlayer graphics with with new factorio 2.0.44, should have been done earler.
Known Issues for modders:
- Automated localisations are not implemented yet. They have to be manually added from the mod which uses the generator.
Version: 0.1.1
Date: 2025-04-06
Bugfixes:
- Fixing typo in folder name "grapics" instead of "graphics".
Version: 0.1.0
Date: 2025-04-06
Major Features:
- Initial idea.
- Helper functions for the modpacks: table.contains table.copy_and_rename, add_recipe_unlocks, replace_multiple_recipes
- Graphic assets for the modpacks: overlayers (molten-iron, molten-copper, lava-droplet, gleba, space, em-plant, biochamber)