Recipe filter or method to get only available recipes

Place to ask discuss and request the modding support of Factorio. Don't request mods here.
Derim422
Burner Inserter
Burner Inserter
Posts: 12
Joined: Wed Jul 07, 2021 11:16 am
Contact:

Recipe filter or method to get only available recipes

Post by Derim422 »

TL;DR
The addition of a recipe display filter that only shows recipes with ingredients that you can already make.

What?
Additional API on LuaForce and/or RecipePrototypeFilter to “get_buildable_recipes” that returns only the recipes that can be built given the currently available techs.

Doing this in a mod at runtimes requires iterating over every tech and determining tech recipes, and comparing those to a recipe. This should be able to be optimized by removing it from a mod hook.
Why?
For a mod that has a large number of auto generated recipes, the best way right now to limit what a player sees is by using recipe filters in UI. This will display all unlocked recipes, regardless of if all the ingredients are able to be built by a force. This clutters up the UI significantly for a mod i work with (Baketorio).

Hidden techs can be used to mimic this behavior, but that feels like a workaround when the tech might only unlock a single recipe, and will just w the recipe when the two ingredients and a base tech are unlocked.
Post Reply

Return to “Modding interface requests”