Prevent a recipe from being used in a different recipe

Place to get help with not working mods / modding interface.
Jelmergu
Long Handed Inserter
Long Handed Inserter
Posts: 77
Joined: Mon Apr 04, 2016 8:49 am
Contact:

Prevent a recipe from being used in a different recipe

Post by Jelmergu »

I made a small and simple mod which adds 4 extra recipes. It works fine on its own, but when used with, for example Bob's mods, my recipes get used instead of the base recipes.
For example:
My mod makes a recipe to convert a burner inserter to an electric inserter with the ingredients: 1 burner inserter, 1 electronic ciruit
Bob's mods changes the electronic circuit to a more expensive version. I don't have a problem with that.
When I'd want a fast inserter and I don't have a electric inserter in my inventory, the game will auto craft the electric inserter, using my converter recipe(which is a lot more expensive).

What I would like to do is to prevent the game to use my recipes for auto crafting
mrvn
Smart Inserter
Smart Inserter
Posts: 5969
Joined: Mon Sep 05, 2016 9:10 am
Contact:

Re: Prevent a recipe from being used in a different recipe

Post by mrvn »

you mean you have multiple ways to build X, one of them using your recipe as intermediary and you want the game to default to the other, cheaper, way?
Jelmergu
Long Handed Inserter
Long Handed Inserter
Posts: 77
Joined: Mon Apr 04, 2016 8:49 am
Contact:

Re: Prevent a recipe from being used in a different recipe

Post by Jelmergu »

mrvn wrote:you mean you have multiple ways to build X, one of them using your recipe as intermediary and you want the game to default to the other, cheaper, way?
Exactly that

But if possible, just make my recipe not able to be autocrafted
User avatar
darkfrei
Smart Inserter
Smart Inserter
Posts: 2905
Joined: Thu Nov 20, 2014 11:11 pm
Contact:

Re: Prevent a recipe from being used in a different recipe

Post by darkfrei »

Jelmergu wrote:
mrvn wrote:you mean you have multiple ways to build X, one of them using your recipe as intermediary and you want the game to default to the other, cheaper, way?
Exactly that

But if possible, just make my recipe not able to be autocrafted
https://wiki.factorio.com/Prototype/Recipe

Code: Select all

allow_decomposition = false
Jelmergu
Long Handed Inserter
Long Handed Inserter
Posts: 77
Joined: Mon Apr 04, 2016 8:49 am
Contact:

Re: Prevent a recipe from being used in a different recipe

Post by Jelmergu »

darkfrei wrote: https://wiki.factorio.com/Prototype/Recipe

Code: Select all

allow_decomposition = false
Tried it, didn't work. To be sure I even tried it using true(even though I knew it wouldn't work)
User avatar
darkfrei
Smart Inserter
Smart Inserter
Posts: 2905
Joined: Thu Nov 20, 2014 11:11 pm
Contact:

Re: Prevent a recipe from being used in a different recipe

Post by darkfrei »

Jelmergu wrote:
darkfrei wrote: https://wiki.factorio.com/Prototype/Recipe

Code: Select all

allow_decomposition = false
Tried it, didn't work. To be sure I even tried it using true(even though I knew it wouldn't work)
Move it to advanced crafting like engines?

Code: Select all

  {
    type = "recipe",
    name = "engine-unit",
    energy_required = 10,
    category = "advanced-crafting",
    ingredients =
    {
      {"steel-plate", 1},
      {"iron-gear-wheel", 1},
      {"pipe", 2}
    },
    result = "engine-unit",
    enabled = false
  },
User avatar
eradicator
Smart Inserter
Smart Inserter
Posts: 5211
Joined: Tue Jul 12, 2016 9:03 am
Contact:

Re: Prevent a recipe from being used in a different recipe

Post by eradicator »

If i had to take a random guess i'd say there's a good chance the game uses the .order='string' to choose which recipe is prefered. So either you try fiddling with that - it's just a string so try 'zzz-something' to make sure it's sorted last. Or, like suggested above, make your recipe machine-only. Btw is your recipe faster? Total-time it takes to get the final result might also be something the game considers when choosing recipe.

As for a magic "don't allow recursive handcrafting for this"-flag, i don't think one exists.
Author of: Belt Planner, Hand Crank Generator, Screenshot Maker, /sudo and more.
Mod support languages: 日本語, Deutsch, English
My code in the post above is dedicated to the public domain under CC0.
Post Reply

Return to “Modding help”