Several times I have wanted to give the player a handcrafting recipe that they are only supposed to craft once. The recipe is disabled by script after they craft it (nowadays likely by a spoilage trigger), and a script processes the player's crafting queue to cancel any additional crafts of the one-off recipe.
What cannot currently be prevented is that such recipes will appear with a '41' in the lower-right corner of the Crafting window icon if the player has 41x the ingredients it needs.
As a minimal proposal, RecipePrototype::single_craft could remove the small number and also prevent characters adding more than 1 of this recipe to their crafting queue. For non-character crafters I assume it has no effect.
RecipePrototype::single_craft
-
thesixthroc
- Fast Inserter

- Posts: 149
- Joined: Wed Apr 29, 2020 9:53 pm
- Contact:
Re: RecipePrototype::single_craft
You can cancel cancel crafts in progress to leave only one https://lua-api.factorio.com/latest/cla ... l_crafting