Advanced Electric

by dwinks

Adds additional ranks of boilers, steam engines, steam turbines, power poles, nuclear reactors, and adds primary load versions of steam engines and turbines.

Content
4 years ago
0.15 - 1.1
8.36K
Power

b Conflict with other mods that depend on steam-engine icon

5 years ago

SchallMachineScaling depends on steam-engine having the icon property, and your mod sets it to nil. I posted to their Discussion section. Could you load your mod after theirs?

5 years ago

https://mods.factorio.com/mod/SchallMachineScaling/discussion/5da04dcec9d053000d1a9e1e
From Schallfalke:

"PS1: If property icons is not nil, the game automatically take that as higher preference in icon display. So it is UNNECESSARY to remove property icon (set to nil)."

4 years ago
(updated 4 years ago)

After learning to mod, I found the problem IS with your mod: you assume an thing.icon exists. This is ironic because YOUR items and entities do not have an icon.

To fix it:

First:
local base_icon_path
local base_icons_path
local icon_t

Then above the tier1 to tiermax and tech_icon_path:
base_icon_path = data.raw.item[machine_name].icon
base_icons_path = data.raw.item[machine_name].icons

Above the data:extend in the loop:

  icon_t = {}
  if base_icon_path then
    icon_t[1] = { icon = base_icon_path }
    icon_t[2] = { icon = overtier_icon_prefix..tier..overtier_icon_suffix, tint = overtier_icon_tint }
  else
    icon_t[1] = { icon = base_icons_path[1].icon }
    icon_t[2] = { icon = overtier_icon_prefix..tier..overtier_icon_suffix, tint = overtier_icon_tint }
  end

And then in the item and entity:
icons = icon_t,

I did those in steam-engines and steam-turbines. It might be worth generalizing it, and doing it for each group, since technically one of icon+icon_size, icons[1-n].icon + icon_size, or icons[1-n].icon + icons[1-n].icon_size are required.

Link to files with changes:
https://drive.google.com/open?id=1U8Vf1DJlYQXaLh9CHGZJE9gwoX4xsMhZ

New response