Prerequisites for Recipes
Posted: Sun Apr 10, 2016 10:34 am
I suggest to add prerequisites to recipes, like this:
{
type = "recipe", prerequisites = {list_of_technologies}
}
instead or along with: {type = "technology", effects = {{type = "unlock-recipe", recipe = "..."}}}
It allows to add new recipes, which depend on the existing technologies (from original game), or other mods such without the need for intermediate technologies (which just used for prerequisites) or hacks, like that:
table.insert(data.raw.technology["..."].effects, {type = "unlock-recipe", recipe = "..."}).
In addition, it allows to consistently calculate the technology tree, for the technology and for the recipe.
{
type = "recipe", prerequisites = {list_of_technologies}
}
instead or along with: {type = "technology", effects = {{type = "unlock-recipe", recipe = "..."}}}
It allows to add new recipes, which depend on the existing technologies (from original game), or other mods such without the need for intermediate technologies (which just used for prerequisites) or hacks, like that:
table.insert(data.raw.technology["..."].effects, {type = "unlock-recipe", recipe = "..."}).
In addition, it allows to consistently calculate the technology tree, for the technology and for the recipe.