Page 1 of 1

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

Posted: Fri Aug 21, 2020 8:58 am
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).

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

Posted: Fri Aug 21, 2020 4:01 pm
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.

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

Posted: Fri Aug 21, 2020 4:27 pm
by Xorimuth
You can add a hook to the event `on_research_finished` to apply your hidden effect.

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

Posted: Fri Aug 21, 2020 4:48 pm
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()).

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

Posted: Fri Aug 21, 2020 6:16 pm
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.

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

Posted: Tue Aug 25, 2020 2:17 pm
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.

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

Posted: Tue Aug 25, 2020 2:38 pm
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.