Can we have a lock-recipe technology effect type?
It does the opposite of unlock-recipe.
The purpose of this request is to add recipes that are "upgrades" of the same recipe, but be able to prevent those less efficient recipes from showing.
Lock-recipe technology effect would (ideally) make it so this kind of behavior is internally consistent if factorio ever re-evaluates its recipes against the technologies.
LuaTechnology.effects[1].type="LOCK-recipe"
Re: LuaTechnology.effects[1].type="LOCK-recipe"
Pyanadon's Alien Life has a bunch of technologies that do exactly this.
Alternatively, an effect type of modify-recipe with a ModifyRecipePrototype could be possible, but that'd be more work on the Factorio side. Still, would help remove code related to updating the recipes in the assemblers. Even better, the ModifyRecipePrototype could also be how expensive recipes are defined, moving the complexity away from RecipePrototype.
Alternatively, an effect type of modify-recipe with a ModifyRecipePrototype could be possible, but that'd be more work on the Factorio side. Still, would help remove code related to updating the recipes in the assemblers. Even better, the ModifyRecipePrototype could also be how expensive recipes are defined, moving the complexity away from RecipePrototype.
Re: LuaTechnology.effects[1].type="LOCK-recipe"
I don't see this as really working. If you have 2 separate technologies that do not rely on each other in any way where 1 unlocks a recipe and 1 locks a recipe it just fails; depending on what order the player researches them you get different results.
I think this is best left to scripting logic and reaction to the on-research-finished event.
I think this is best left to scripting logic and reaction to the on-research-finished event.
If you want to get ahold of me I'm almost always on Discord.
Re: LuaTechnology.effects[1].type="LOCK-recipe"
an upgrade-recipe effect? unlock recipe-2 if/when recipe-1 is researched, and replace recipe-1 with recipe-2 where recipe-1 is being crafted?