Page 1 of 1

Coding Assistance: Solar/Accumulator Efficiency Research

Posted: Mon May 24, 2021 11:48 pm
by Neomore
Good afternoon/morning.

I'm currently working on updating an old Solar panel mod of mine, and I'm trying to completely rework the mod to no longer need higher-tier solar panels and accumulators. As an alternative, I'm trying to add a research that acts similar to the mining-productivity research (each time you research it, you'd gain a bonus multiplier to the output of solar panels, and the storage of accumulators).

The issue I'm currently having is that I can't figure out a way to add that effect into the game. Is there some way to add a new effect type to the technology effects table which would allow this to be possible?

Any assistance is appreciated.

Re: Coding Assistance: Solar/Accumulator Efficiency Research

Posted: Tue May 25, 2021 12:29 am
by Silari
The only thing that techs can modify directly are what's built into the game: https://wiki.factorio.com/Types/ModifierPrototype has the list.

However, as long as you're content with just modifying the output of the solar panel building, you can modify the surface's solar_power_multiplier via a script effect when the research is done. Setting it to 1.1 should make all solar panels on that surface make 66 kW max, for instance.

Accumulator storage is baked into the prototype though on game start, so there's no getting around needing multiple prototypes of that that I know of.

Re: Coding Assistance: Solar/Accumulator Efficiency Research

Posted: Tue May 25, 2021 12:43 am
by Neomore
Silari wrote: Tue May 25, 2021 12:29 am The only thing that techs can modify directly are what's built into the game: https://wiki.factorio.com/Types/ModifierPrototype has the list.

However, as long as you're content with just modifying the output of the solar panel building, you can modify the surface's solar_power_multiplier via a script effect when the research is done. Setting it to 1.1 should make all solar panels on that surface make 66 kW max, for instance.

Accumulator storage is baked into the prototype though on game start, so there's no getting around needing multiple prototypes of that that I know of.
I know that Techs can only modify things on that list. What I'm specifically looking for is a way to add a custom value to that list, if possible

Re: Coding Assistance: Solar/Accumulator Efficiency Research

Posted: Tue May 25, 2021 9:41 am
by eradicator
Silari wrote: Tue May 25, 2021 12:29 am /LuaSurface.html#LuaSurface.solar_power_multiplier]solar_power_multiplier[/url] via a script effect when the research is done.
Be aware that this is ofc incompatible with any mod that also manipulates that value. (i.e. Space Exploration)
Neomore wrote: Tue May 25, 2021 12:43 am if possible
Not. Possible.

To get what you describe you'd need a script that secretely replaces every accumulator in the world with one that looks the same but behaves differently.

(Also personally not a huge fan of infinite research that magically makes everything better. Doesn't add anything new to the gameplay loop except more waiting.)