[MOD 0.13.0] DesertSun

Topics and discussion about specific mods
maggi321
Burner Inserter
Burner Inserter
Posts: 12
Joined: Fri Jun 24, 2016 4:16 pm

[MOD 0.13.0] DesertSun

Post by maggi321 »

Image

Details
  • Type: Mod
  • Name: DesertSun
  • Author: maggi321
  • Category: Power
  • Description: This mod makes your solar panels more effective when placed in the desert (+15 %) and less effective when placed on any other terrain (-15%). This gives you motivation to build large solar farms out in the desert rather than anywhere in your base, which contributes to the exploration part of the game.
  • License: Creative Commons 3.0 - https://creativecommons.org/licenses/by/3.0/
  • Factorio Version: 0.12
  • Locale: en, de
  • Released: June 24, 2016
This is my first mod. If you have any suggestions how to improve it, just let me know. I'll see what I can do.

Edit #1:
Added support for solar panels from mod packs (tested for Bobs mod). Thanks goes to Adil for the help with the code.

Edit #2:
Changed the mod definition to make it 0.13 compatible

Known Issues:
Solar panels from mods other than Bobs mod may show the wrong name, since I cannot add the missing string to the locale file.
Attachments
DesertSun_0.0.3.zip
(2.89 KiB) Downloaded 123 times
Last edited by maggi321 on Tue Jun 28, 2016 12:16 pm, edited 2 times in total.
User avatar
sporefreak
Fast Inserter
Fast Inserter
Posts: 183
Joined: Sun Apr 17, 2016 12:55 am
Contact:

Re: [MOD 0.12.x] DesertSun

Post by sporefreak »

This is brillant! Would it be possible to make it work for modded solar panels?

If yes I would suggest making it work off of percentages instead of flat amounts. (Im assuming you have flat amounts set)
15% better production in deserts -10% elsewhere or something.
That way you can just have the mod scan for solar panel types and change energy values (I have no idea how to make any of this happen)
maggi321
Burner Inserter
Burner Inserter
Posts: 12
Joined: Fri Jun 24, 2016 4:16 pm

Re: [MOD 0.12.x] DesertSun

Post by maggi321 »

sporefreak wrote:That way you can just have the mod scan for solar panel types and change energy values (I have no idea how to make any of this happen)
This was also my first idea. I already managed to loop through all the solar panel types available, but i wasn't able to change the energy production value within the lua code. My guess is, that this property is not yet available via the modding API. Instead I just created a "desert solar panel", which looks identical to the original one and replaces it, whenever you build one in the desert.

Long story short: At the moment this is not possible (for me). But I'm currently creating another, much bigger mod. So maybe in a few months when I'm more experienced I will figure a way out.

P.S.: If someone who reads this knows a way to change the energy production of a LuaEntity of type "solar-panel", please let me know.
User avatar
Adil
Filter Inserter
Filter Inserter
Posts: 945
Joined: Fri Aug 15, 2014 8:36 pm
Contact:

Re: [MOD 0.12.x] DesertSun

Post by Adil »

Good idea. Definitely something that brings new ideas in gameplay.
maggi321 wrote:If someone who reads this knows a way to change the energy production of a LuaEntity of type "solar-panel", please let me know.
You can't, in runtime most entity parameters are read-only.

The currently correct way is by procedurally generating the entities during the data-updates.lua stage.
for example
And then find all the generated prototypes during on init:
code
And then use the table generated to determine what should be replaced with what.
idea
I do mods. Modding wiki is friend, it teaches how to mod. Api docs is friend too...
I also update mods, some of them even work.
Recently I did a mod tutorial.
Neotix
Filter Inserter
Filter Inserter
Posts: 599
Joined: Sat Nov 23, 2013 9:56 pm
Contact:

Re: [MOD 0.12.x] DesertSun

Post by Neotix »

Why do you think that solar panels are more efficient in desert? Because there is more sunlight? But do you know that solar panels have less efficient in higher temperatures? In RL solar panels have less efficient on desert lands. They lose more because of temperature then they get from more sunlight. Thats why they usually don't built photovoltaic farms but solar collectors like that Image
or that
Image
maggi321
Burner Inserter
Burner Inserter
Posts: 12
Joined: Fri Jun 24, 2016 4:16 pm

Re: [MOD 0.12.x] DesertSun

Post by maggi321 »

@Adil: Thank you very much for your very detailed explanation! I will definitly look into it.

@Neotix: Thank you too for your interesting remark. I wasn't really aware, that higher temperatures would make photovoltaik panels so much less effective. I knew although, that you would rather build solar collectors in the desert. I just didn't want to overcomplicate the game by adding even more types of solar panels (personally I play with Bobs mod very often and there are already plenty of them). In games like factorio you always have to simplify things. I'm also pretty sure, that in RL you can't build a solar panel from solely steel plates, copper plates and electronic circuits. ;)
User avatar
sporefreak
Fast Inserter
Fast Inserter
Posts: 183
Joined: Sun Apr 17, 2016 12:55 am
Contact:

Re: [MOD 0.12.x] DesertSun

Post by sporefreak »

Neotix wrote:Why do you think that solar panels are more efficient in desert? Because there is more sunlight? But do you know that solar panels have less efficient in higher temperatures? In RL solar panels have less efficient on desert lands. They lose more because of temperature then they get from more sunlight. Thats why they usually don't built photovoltaic farms but solar collectors like that
or that
Ah but this is an alien planet. It could be cold, causing the temperature to not be as diminishing.
Post Reply

Return to “Mods”