Page 1 of 1

Modify Solar Panel's (Entity) energy production

Posted: Mon Jul 06, 2020 8:59 pm
by esso23
I want to have a mod which scales Solar Panel's maximum energy production based on pollution in the chunk in which they are located (based on this research https://www.iflscience.com/environment/ ... SoLa_vqqig :)

So I want each entity to have different power output.
I tried LuaEntity.effects, but they are read-only (and I guess they don't work on Solar Panels?).
I also tried LuaEntity.productivity_bonus, but that's read-only aswell and probably wouldn't work anyway.
I also tried LuaEntity.power_production, but it says that solar-panel is not ElectricEnergyInterface (not sure what that is).

I could not find a way to do this without creating dozens of entities, like solar-panel with 59kW, solar-panel with 58kW etc. which is a disgusting hack and I want to avoid it (viewtopic.php?f=28&t=81892&p=483901&hil ... cA#p483901).

Am I missing something?

If not, would it be possible to implement some mechanic for this?

Thanks
Esso

Re: Modify Solar Panel's (Entity) energy production

Posted: Mon Jul 06, 2020 9:11 pm
by darkfrei
esso23 wrote: Mon Jul 06, 2020 8:59 pm I want to have a mod which scales Solar Panel's maximum energy production based on pollution in the chunk in which they are located

Am I missing something?
https://mods.factorio.com/mod/SmogSolarPanels

or you can make the electric energy interface, that looks like a solar panel.

There are mods with electric energy interface:
https://mods.factorio.com/mod/RITEG
https://mods.factorio.com/mod/VerticalAxisWindTurbines
The first one decrease energy output, the second one will be adjusted on the speed of wind.