Modify Solar Panel's (Entity) energy production

Place to get help with not working mods / modding interface.
Post Reply
User avatar
esso23
Inserter
Inserter
Posts: 28
Joined: Sun Feb 09, 2020 10:59 pm
Contact:

Modify Solar Panel's (Entity) energy production

Post 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

User avatar
darkfrei
Smart Inserter
Smart Inserter
Posts: 2904
Joined: Thu Nov 20, 2014 11:11 pm
Contact:

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

Post 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.

Post Reply

Return to “Modding help”