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.
Coding Assistance: Solar/Accumulator Efficiency Research
Coding Assistance: Solar/Accumulator Efficiency Research
Author of Advanced Factorio, a set of mods that add small bits of Advanced functionality to your gameplay
Check it out here: https://mods.factorio.com/user/neomore
Check it out here: https://mods.factorio.com/user/neomore
Re: Coding Assistance: Solar/Accumulator Efficiency Research
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.
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
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 possibleSilari wrote: ↑Tue May 25, 2021 12:29 amThe 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.
Author of Advanced Factorio, a set of mods that add small bits of Advanced functionality to your gameplay
Check it out here: https://mods.factorio.com/user/neomore
Check it out here: https://mods.factorio.com/user/neomore
- eradicator
- Smart Inserter
- Posts: 5206
- Joined: Tue Jul 12, 2016 9:03 am
- Contact:
Re: Coding Assistance: Solar/Accumulator Efficiency Research
Be aware that this is ofc incompatible with any mod that also manipulates that value. (i.e. Space Exploration)
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.)
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.
Mod support languages: 日本語, Deutsch, English
My code in the post above is dedicated to the public domain under CC0.