I was testing a few things in lua and learnt it through trial-error and also copying other mods scripts. I decided to move forward and make some default game recipes more difficult to make by changing ingredients or adding more to them. For "Normal" difficulty games I dont want to change any recipe but for "Expensive" difficulty games I want to change some recipes. Some of the recipes I want to change do not have expensive mode, ex: Advanced Oil Processing.
I did the change with a dirty work but I am asking if there is a simplier and better way to do:
Code: Select all
data.raw.recipe["advanced-oil-processing"].normal=
{
enabled=false,
ingredients=
{
{type="fluid", name="water", amount=50},
{type="fluid", name="crude-oil", amount=100}
},
results=
{
{type="fluid", name="heavy-oil", amount=10},
{type="fluid", name="light-oil", amount=45},
{type="fluid", name="petroleum-gas", amount=55}
}
}
data.raw.recipe["advanced-oil-processing"].expensive =
{
enabled=false,
ingredients=
{
{type="fluid", name="sulfuric-acid", amount=20}, --- my change here
{type="fluid", name="crude-oil", amount=100}
},
results=
{
{type="fluid", name="heavy-oil", amount=10},
{type="fluid", name="light-oil", amount=45},
{type="fluid", name="petroleum-gas", amount=55}
}
}
Is there an easy way to copy recipe ingredients to ".normal.ingredients=" and also results from to data.raw.recipe["advanced-oil-processing"].results to data.raw.recipe["advanced-oil-processing"].expensive.results ?
I dont want to change results of recipes but only inputs (amount or/and type).
Thanks