The goal of the mod is to change the lamp textures and color mapping to improve readability of vanilla sev-seg displays.
While I had zero problems with color mapping and light intensities (which I only tuned), I can't find any solution to the texture problem.
The problems are:
- the in-game icon doesn't change
- the game fails to load because of (translated): Unable to load mod: "__lamp-retexture__/data-final-fixes.lua:27:attempt to index field '?' (a nil value)
stack traceback:
--lamp-retexture__/data-final-fixes.lua:27: in main chunk"
Mods which will be disabled:
- lamp-retexture (0.1.0)
I'm running factorio 1.1.19 on Windows 10.
To avoid misunderstading: I identified the first non-blocking problem by deleting/commenting the entity texture override. Also, english is not my first language (sorry if I did mistakes or sounded rude, that wasn't my intention).
Code: Select all
--data-final-fixes.lua
--INIT
local lamp = data.raw.lamp["small-lamp"]
local mod = "__lamp-retexture__"
local iconpath = mod.."/graphics/icons/"
local entitypath = mod.."/graphics/entity/small-lamp/"
--ICON
log("icon before: "..lamp.icon)
lamp.icon = iconpath.."small-lamp.png"
log("icon after: "..lamp.icon)
--MAPPING
lamp.light = {intensity = 0.9, size = 1, color = {r=1.0, g=1.0, b=1.0}}
lamp.light_when_colored = {intensity = 1, size = 1, color = {r=1.0, g=1.0, b=1.0}}
lamp.glow_size = 1 --6
lamp.signal_to_color_mapping =
{
{type="virtual", name="signal-black", color={r=0,g=0,b=0}}, -- added black
{type="virtual", name="signal-grey", color={r=0.5,g=0.5,b=0.5}}, -- added grey
{type="virtual", name="signal-red", color={r=1,g=0,b=0}},
{type="virtual", name="signal-green", color={r=0,g=1,b=0}},
{type="virtual", name="signal-blue", color={r=0,g=0,b=1}},
{type="virtual", name="signal-yellow", color={r=1,g=1,b=0}},
{type="virtual", name="signal-pink", color={r=1,g=0,b=1}},
{type="virtual", name="signal-cyan", color={r=0,g=1,b=1}}
}
-- LAMP ENTITY TEXTURES
lamp.picture_off.layers[0].filename = entitypath.."lamp.png"
lamp.picture_off.layers[1].filename = entitypath.."lamp-shadow.png"
lamp.picture_off.layers[0].hr_version.filename = entitypath.."hr-lamp.png"
lamp.picture_off.layers[1].hr_version.filename = entitypath.."hr-lamp-shadow.png"
lamp.picture_on.layers[0].filename = entitypath.."lamp-light.png"
lamp.picture_on.layers[0].hr_version.filename = entitypath.."hr-lamp-light.png"