Schall Lamp Contrast


Replace the vanilla lamp graphics for higher contrast signal display. Vehicles no longer collide with lamps, so safe to drive over them! Also allows configuration on colour signals, including their priority. (Locale: English, Deutsch, 正體中文, 简体中文, Português Brasileiro)

Tweaks
21 days ago
0.16 - 2.0
3.15K
Circuit network

b [Solved] Breaks other lamp graphic mods

4 years ago

Anything that edits or does a table.deepcopy() on a lamp will break if it changes graphics. The lamp prototype has a layers array in picture_off and picture_on, and you convert it to a table. Would you please change the first layer instead of overwriting the whole picture_on picture_off arrays?

4 years ago

The vanilla lamp has two layers in picture_off: the main graphics and shadow.
It has single layer and just use direct assignment in picture_on.

This mod has the lamp on the ground directly, so no shadow. I have to replace those two layers with only one layer. So it gets tricky...
Are you using any specific mod(s) that I can test with?

4 years ago

Mobile Factory. I am a dev and got a bug report of a broken lamp. Specifically we deepcopy the small-lamp and re-assign the layer table... except if Schall Lamp Contrast runs first we get an error. I don't know if a patch on our side worked or not (I handed it off to a non-modder and they said it didn't work). I'd rather it be changed from your side.

https://github.com/Mugiwaxar/Mobile-Factory/blob/master/prototypes/erya/erya-structures.lua#L54

https://mods.factorio.com/mod/Mobile_Factory

Thank you for responding.

4 years ago

I have just released 0.17.6 / 0.18.1 that are now using layers in both picture_off and picture_on.
Note that I assigned only one layer to each of them, as I do not need the shadow layer.
Also note that I do not apply hr_version, as I do not have any hi-res sprites. (It is not meaningful to assign the exact same low-res sprite.)
So in the code you shown me, that will not work. Some conditions checking should be needed before assigning values.

4 years ago

Have to notice you that the game use different priorities in "Normal" and "High" sprite resolutions... So 0.17.6 / 0.18.1 are good for Normal resolution, but get ignored in High resolution. More details here.

So I released 0.17.7 / 0.18.2 that cleared up the remnant definitions, to make sure the graphics are correct in both resolutions. But it also means that you may have to adjust your code. I suggest you to do conditions checking (if layers then ... else ... end) to be compatible with both cases.

4 years ago

k, ty for the suggestion

New response