Page 1 of 1

Prerequisites for Recipes

Posted: Sun Apr 10, 2016 10:34 am
by Fedorrro
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.

Re: Prerequisites for Recipes

Posted: Mon Apr 11, 2016 10:03 am
by bobingabout
The only problem with recipe unlocks at the moment that I have come across, is that they're unlocked upon completion of a research, if you list the recipe on more than one research, than unlocking either will unlock the item.

Okay, fair enough, that makes sense, but what if I want it to unlock only when BOTH are researched? the only solution right now is to make a 3rd technology that has the prerequisite of the other 2 in on it.

Re: Prerequisites for Recipes

Posted: Mon Apr 11, 2016 11:58 am
by Fedorrro
bobingabout wrote:The only problem with recipe unlocks at the moment that I have come across, is that they're unlocked upon completion of a research, if you list the recipe on more than one research, than unlocking either will unlock the item.
Okay, fair enough, that makes sense, but what if I want it to unlock only when BOTH are researched? the only solution right now is to make a 3rd technology that has the prerequisite of the other 2 in on it.
Yes, this problem will be solved by this suggestion, I think.