Solar panel output mod

This is the place to request new mods or give ideas about what could be done.
Post Reply
User avatar
MalcolmCooks
Filter Inserter
Filter Inserter
Posts: 253
Joined: Mon Apr 06, 2015 8:32 pm
Contact:

Solar panel output mod

Post by MalcolmCooks »

Its time.... for someone to make a mod that lets you change the power output of solar panels. I wish I could do it myself but the amount of help I would need would basically amount to "please tell me how to create a mod that lets you change the power output of solar panels" :lol: I want to use it to reduce the power output for balancing purposes but maybe some other people would like to increase output?

daniel34
Global Moderator
Global Moderator
Posts: 2761
Joined: Thu Dec 25, 2014 7:30 am
Contact:

Re: Solar panel output mod

Post by daniel34 »

Make a folder called SolarPanelOutput_0.0.1 and add a file data.lua with the following contents:

Code: Select all

data.raw["solar-panel"]["solar-panel"]["production"] = "30kW"
That's it. That is the complete code needed to halve the production. You then only have to add a second file info.json that contains information about the mod (author, requirements, ...). See any other mod or the attached one for details. Then zip it up, this isn't required but makes the mod easier to distribute and faster to load.


EDIT: In case you are wondering how I got to that line of code and want to know more:
You use https://wiki.factorio.com/index.php?title=Data.raw to look up the type and name of your entity.
Then you open the file data\base\prototypes\entity\entities.lua in your Factorio folder (possibly in some nearby file for some entities, use a file search if unsure), where you see in line 1822 for the solar-panel production = "60kW", where "production" is the property you want to change.
Now you assemble the found information in the form

Code: Select all

data.raw["type"]["name"]["property"] = value
and you've written a mod that changes the property of an entity.
Attachments
SolarPanelOutput_0.0.1.zip
(730 Bytes) Downloaded 129 times
quick links: log file | graphical issues | wiki

User avatar
MalcolmCooks
Filter Inserter
Filter Inserter
Posts: 253
Joined: Mon Apr 06, 2015 8:32 pm
Contact:

Re: Solar panel output mod

Post by MalcolmCooks »

Thank you! And thank you also for telling me a little about how to do this. I did have a look through the game files to see if I could work out what to do, but now I understand it a little better I think next time I want to do something like this I can have a better go at it myself :)

Post Reply

Return to “Ideas and Requests For Mods”