Technology research disables a recipe
Posted: Sat May 27, 2023 1:56 pm
Hi guys, I have a question.
I've been absent from the game and therefore from programming Lua for quite a period, and I've never been good with this language, so I'd like to know if you're kind enough to tell me if there's a way to do a thing like this.
(Maybe it's faster with an example.)
This is the first recipe, enabled from the beginning of the game let's suppose.
Now i research this new recipe with the "steel-processing" technology:
When i research steel processing can I disable the first recipe, so that I don't see 10 different iron ingot recipes in the crafting interface?
(And, but maybe this is too much, if an assembling machine runs the first recipe - not this obv its category is smelting - is there a way to instantly change it to do the new recipe or will I have to do it manually in-game?)
I've been absent from the game and therefore from programming Lua for quite a period, and I've never been good with this language, so I'd like to know if you're kind enough to tell me if there's a way to do a thing like this.
(Maybe it's faster with an example.)
Code: Select all
{
type = "recipe",
name = "iron-ingot-v1",
category = "smelting",
energy_required = 3.2,
ingredients =
{
{ "iron-mineral", 1}
},
result ="iron-ingot"
}
Now i research this new recipe with the "steel-processing" technology:
Code: Select all
{
type = "recipe",
name = "iron-ingot-v2",
category = "smelting",
energy_required = 3.2,
enabled=false,
ingredients =
{
{ "iron-mineral", 1}
},
result ="iron-ingot",
result_count=2
}

(And, but maybe this is too much, if an assembling machine runs the first recipe - not this obv its category is smelting - is there a way to instantly change it to do the new recipe or will I have to do it manually in-game?)