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.
Prerequisites for Recipes
Moderator: ickputzdirwech
- bobingabout
- Smart Inserter
- Posts: 7352
- Joined: Fri May 09, 2014 1:01 pm
- Contact:
Re: Prerequisites for Recipes
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.
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
Yes, this problem will be solved by this suggestion, I think.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.