How to block auto-crafting ingredients a recipe

Place to get help with not working mods / modding interface.
User avatar
<NO_NAME>
Filter Inserter
Filter Inserter
Posts: 298
Joined: Tue Aug 02, 2016 9:52 am
Contact:

How to block auto-crafting ingredients a recipe

Post by <NO_NAME> »

I've made a mod that adds two recipes. The first creates an item; the second destroys it.
Now, if I click the destroying recipe too many times, it uses the first recipe to create new items to be destroyed.
I don't wan that. I want it to only destroy items that are already in player's inventory.

How can I block a recipe from auto-crafting it's ingredients?
I am a translator. And what did you do for Factorio?
Check out my mod "Realistic Ores" and my other mods!
User avatar
Deadlock989
Smart Inserter
Smart Inserter
Posts: 2529
Joined: Fri Nov 06, 2015 7:41 pm

Re: How to block auto-crafting ingredients a recipe

Post by Deadlock989 »

Setting allow_as_intermediate = false in a recipe stops it from being used as an intermediate step in any other hand-crafted recipe.

Setting allow_intermediates = false in a recipe stops it from searching for intermediates to supply any missing ingredients when hand-crafting.
User avatar
<NO_NAME>
Filter Inserter
Filter Inserter
Posts: 298
Joined: Tue Aug 02, 2016 9:52 am
Contact:

Re: How to block auto-crafting ingredients a recipe

Post by <NO_NAME> »

Thanks! This solved my problem.

Although it's a little weird that you have to set allow_as_intermediate to false when allow_intermediates is false.
I don't see any reason for that.

(If any admin reads this: please change the name of the thread to "How to block auto-crafting ingredients of a recipe". I don't think that I can do that by myself at this point.)
I am a translator. And what did you do for Factorio?
Check out my mod "Realistic Ores" and my other mods!
User avatar
Deadlock989
Smart Inserter
Smart Inserter
Posts: 2529
Joined: Fri Nov 06, 2015 7:41 pm

Re: How to block auto-crafting ingredients a recipe

Post by Deadlock989 »

<NO_NAME> wrote:Thanks! This solved my problem.

Although it's a little weird that you have to set allow_as_intermediate to false when allow_intermediates is false.
I don't see any reason for that.
I don't think you have to. See the original request thread: viewtopic.php?f=65&t=58848

I set them both but only for readability.
User avatar
<NO_NAME>
Filter Inserter
Filter Inserter
Posts: 298
Joined: Tue Aug 02, 2016 9:52 am
Contact:

Re: How to block auto-crafting ingredients a recipe

Post by <NO_NAME> »

Deadlock989 wrote:I don't think you have to. See the original request thread: viewtopic.php?f=65&t=58848

I set them both but only for readability.
Yes, you have to. I tried to set only allow_intermediates but Factorio refused to start. The error message explicitly told that I have to set allow_as_intermediate too.
I don't think that this restriction is necessary. I can imagine a recipe that should not auto-craft its ingredients but still can be used by other recipes. There is no contradiction here.

Anyway, I see that allow_intermediates was your idea, so thank you even more :D
I am a translator. And what did you do for Factorio?
Check out my mod "Realistic Ores" and my other mods!
Post Reply

Return to “Modding help”