Icons parameter

Place to get help with not working mods / modding interface.
Post Reply
Doublespin
Inserter
Inserter
Posts: 36
Joined: Thu May 21, 2015 12:46 pm
Contact:

Icons parameter

Post by Doublespin »

Due to a bug in my mod i encountered this item from reactors by GotLag

Code: Select all

  {
    type = "item",
    name = "steam-turbine",
    icons =
    {
      {
        icon = "__base__/graphics/icons/steam-engine.png",
      },
      {
        icon = "__base__/graphics/icons/steam-engine.png",
        tint = turbine_tint
      }
    },
    flags = {"goes-to-quickbar"},
    subgroup = "energy",
    order = "b[steam-power]-e[steam-turbine]",
    place_result = "steam-turbine",
    stack_size = 10
  },
I cant find any documentation about the parameter "icons".
I know it does tint the vanilla steam turbine but what is the exact structure
Why two icons for one item. It doesnt make sense to me.
Are there more options to alter an icon?
I'm not a native speaker (obviously), so I will appreciate every pm with corrections :)

User avatar
aubergine18
Smart Inserter
Smart Inserter
Posts: 1264
Joined: Fri Jul 22, 2016 8:51 pm
Contact:

Re: Icons parameter

Post by aubergine18 »

if you comprehend the .icon property, then the .icons property is just an array of those

personally I now always use the array form of properties as they help gather related settings (like the filename and tint being in same table within the .icons property, rather than being separate).

.tint applies a color tint to the icon contained in .filename

You can have at least 2 icons in a .icons array, perhaps more (I've not tested more than 2). they will be layered.

Here's some infos I found whilst investigating that property:

* https://github.com/aubergine10/Style/is ... -247590994
* viewtopic.php?p=197790#p197790
Better forum search for modders: Enclose your search term in quotes, eg. "font_color" or "custom-input" - it prevents the forum search from splitting on hypens and underscores, resulting in much more accurate results.

User avatar
LuziferSenpai
Filter Inserter
Filter Inserter
Posts: 334
Joined: Tue Jul 08, 2014 10:06 am
Contact:

Re: Icons parameter

Post by LuziferSenpai »

Look in these two MODs:

Click

Click

Greetz,

Senpai
Coding is awesome!
Animes are love!
Factorio is life!

My MODs:
Click

Greetz,

Senpai

Doublespin
Inserter
Inserter
Posts: 36
Joined: Thu May 21, 2015 12:46 pm
Contact:

Re: Icons parameter

Post by Doublespin »

Thanks for your replys :)
I tested a little bit and ...
-yes you can have more than 2 layers.
-not every prototype that have icon will accept icons. For example the techs. The game will throw an error if the icon node is missing. Is this intended or bug?
I'm not a native speaker (obviously), so I will appreciate every pm with corrections :)

User avatar
aubergine18
Smart Inserter
Smart Inserter
Posts: 1264
Joined: Fri Jul 22, 2016 8:51 pm
Contact:

Re: Icons parameter

Post by aubergine18 »

Techs are an outlier in many ways, quite different to other prototypes. I'll add the fact that they don't support .icons to my notes, as I will be working on tech prototypes again in a few weeks. It might be worth you creating an API interface request to see if game devs can update techs to accept .icons list.

From my testing so far, GUI element (styles), entities, recipes, items, etc. all support the .icons field.
Better forum search for modders: Enclose your search term in quotes, eg. "font_color" or "custom-input" - it prevents the forum search from splitting on hypens and underscores, resulting in much more accurate results.

Post Reply

Return to “Modding help”