RecipePrototype::single_craft

Place to ask discuss and request the modding support of Factorio. Don't request mods here.
thesixthroc
Fast Inserter
Fast Inserter
Posts: 149
Joined: Wed Apr 29, 2020 9:53 pm
Contact:

RecipePrototype::single_craft

Post by thesixthroc »

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.
User avatar
Osmo
Fast Inserter
Fast Inserter
Posts: 234
Joined: Wed Oct 23, 2024 12:08 pm
Contact:

Re: RecipePrototype::single_craft

Post by Osmo »

You can cancel cancel crafts in progress to leave only one https://lua-api.factorio.com/latest/cla ... l_crafting
Post Reply

Return to “Modding interface requests”