Add a way to hide technology effects from the tech screen.

Place to ask discuss and request the modding support of Factorio. Don't request mods here.
Post Reply
Romner_set
Inserter
Inserter
Posts: 30
Joined: Thu Mar 07, 2019 4:25 pm
Contact:

Add a way to hide technology effects from the tech screen.

Post by Romner_set »

Example:

Code: Select all

effects = {
     {
         type = "unlock-recipe"
         name = "hidden-recipe"
         hidden = true
     },
     {
         type = "nothing"
         effect_description = "description"
     }
}
This would only show the "nothing" modifier on the tech screen, but still unlock the recipe. Every effect should be made hide-able if possible (not only unlock-recipe).

Rseding91
Factorio Staff
Factorio Staff
Posts: 13209
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: Add a way to hide technology effects from the tech screen.

Post by Rseding91 »

My default reaction is to say "no" since the one of the main points of the tech screen is to show what researching a technology does.
If you want to get ahold of me I'm almost always on Discord.

Xorimuth
Filter Inserter
Filter Inserter
Posts: 625
Joined: Sat Mar 02, 2019 9:39 pm
Contact:

Re: Add a way to hide technology effects from the tech screen.

Post by Xorimuth »

You can add a hook to the event `on_research_finished` to apply your hidden effect.
My mods
Content: Freight Forwarding | Spidertron Patrols | Spidertron Enhancements | Power Overload
QoL: Factory Search | Remote Configuration | Module Inserter Simplified | Wire Shortcuts X | Ghost Warnings

User avatar
eradicator
Smart Inserter
Smart Inserter
Posts: 5206
Joined: Tue Jul 12, 2016 9:03 am
Contact:

Re: Add a way to hide technology effects from the tech screen.

Post by eradicator »

Might be useful for very spammy technologies, i.e. if a mod adds recycling for every item. But i totally agree that the point of the reserach window is to supply information, and that it's already possible to do it in control stage if really nessecary (though that needs special handling for force.reset_x()).
Author of: Belt Planner, Hand Crank Generator, Screenshot Maker, /sudo and more.
Mod support languages: 日本語, Deutsch, English
My code in the post above is dedicated to the public domain under CC0.

Romner_set
Inserter
Inserter
Posts: 30
Joined: Thu Mar 07, 2019 4:25 pm
Contact:

Re: Add a way to hide technology effects from the tech screen.

Post by Romner_set »

Rseding91 wrote:
Fri Aug 21, 2020 4:01 pm
My default reaction is to say "no" since the one of the main points of the tech screen is to show what researching a technology does.
My mod uses a furnace prototype and 10 recipes, each unlocked by a technology. I kind of exploited the way furnaces choose their recipe, so the recipes have the same ingredients, but a different name (recipe-1 will override recipe-5 because of lexicographical order), and each technology unlocks a recipe with a suffix 1 lower than the one before. Each recipe also produces a bit more than the one before. I thought it would be much better to just have a modifier that says "+10% output of [recipe]" than a recipe that has the same icon and everything except the "Produces: " part as all the other ones. Download the mod to see for yourself.
Xorimuth wrote:
Fri Aug 21, 2020 4:27 pm
You can add a hook to the event `on_research_finished` to apply your hidden effect.
I will do that for now, thanks.

User avatar
eradicator
Smart Inserter
Smart Inserter
Posts: 5206
Joined: Tue Jul 12, 2016 9:03 am
Contact:

Re: Add a way to hide technology effects from the tech screen.

Post by eradicator »

Romner_set wrote:
Fri Aug 21, 2020 6:16 pm
Rseding91 wrote:
Fri Aug 21, 2020 4:01 pm
My default reaction is to say "no" since the one of the main points of the tech screen is to show what researching a technology does.
My mod uses a furnace prototype and 10 recipes, each unlocked by a technology. I kind of exploited the way furnaces choose their recipe, so the recipes have the same ingredients, but a different name (recipe-1 will override recipe-5 because of lexicographical order), and each technology unlocks a recipe with a suffix 1 lower than the one before. Each recipe also produces a bit more than the one before. I thought it would be much better to just have a modifier that says "+10% output of [recipe]" than a recipe that has the same icon and everything except the "Produces: " part as all the other ones. Download the mod to see for yourself.
Xorimuth wrote:
Fri Aug 21, 2020 4:27 pm
You can add a hook to the event `on_research_finished` to apply your hidden effect.
I will do that for now, thanks.
By your description it sounds like the crafting screen would show 10 different recipes at the end. And the user would have no clue about how the engine choses which one to use (if that is even a stable assumption). So using an event to disable all the "old" recipes is imho the better solution anyway. For the technology you could try to add a nothing effect with tooltip informing the user about the 10% bonus.
Author of: Belt Planner, Hand Crank Generator, Screenshot Maker, /sudo and more.
Mod support languages: 日本語, Deutsch, English
My code in the post above is dedicated to the public domain under CC0.

mrvn
Smart Inserter
Smart Inserter
Posts: 5709
Joined: Mon Sep 05, 2016 9:10 am
Contact:

Re: Add a way to hide technology effects from the tech screen.

Post by mrvn »

eradicator wrote:
Tue Aug 25, 2020 2:17 pm
Romner_set wrote:
Fri Aug 21, 2020 6:16 pm
Rseding91 wrote:
Fri Aug 21, 2020 4:01 pm
My default reaction is to say "no" since the one of the main points of the tech screen is to show what researching a technology does.
My mod uses a furnace prototype and 10 recipes, each unlocked by a technology. I kind of exploited the way furnaces choose their recipe, so the recipes have the same ingredients, but a different name (recipe-1 will override recipe-5 because of lexicographical order), and each technology unlocks a recipe with a suffix 1 lower than the one before. Each recipe also produces a bit more than the one before. I thought it would be much better to just have a modifier that says "+10% output of [recipe]" than a recipe that has the same icon and everything except the "Produces: " part as all the other ones. Download the mod to see for yourself.
Xorimuth wrote:
Fri Aug 21, 2020 4:27 pm
You can add a hook to the event `on_research_finished` to apply your hidden effect.
I will do that for now, thanks.
By your description it sounds like the crafting screen would show 10 different recipes at the end. And the user would have no clue about how the engine choses which one to use (if that is even a stable assumption). So using an event to disable all the "old" recipes is imho the better solution anyway. For the technology you could try to add a nothing effect with tooltip informing the user about the 10% bonus.
Note that furnaces cache the last recipe used. So existing furnaces might get stuck at the old recipe after you researched the tech while newly build once use the better one.

So yeah, better disable the old and enable the new in a hook.

Post Reply

Return to “Modding interface requests”