Page 1 of 1

LuaTechnology.effects[1].type="LOCK-recipe"

Posted: Sat Nov 02, 2019 5:40 am
by PyroFire
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.

Re: LuaTechnology.effects[1].type="LOCK-recipe"

Posted: Mon Feb 24, 2020 5:28 am
by havvy
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.

Re: LuaTechnology.effects[1].type="LOCK-recipe"

Posted: Mon Feb 24, 2020 10:42 am
by Rseding91
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.

Re: LuaTechnology.effects[1].type="LOCK-recipe"

Posted: Tue Jul 14, 2020 10:03 am
by mrudat
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?