Adding lighting to an entity in 1.1.30+

Place to get help with not working mods / modding interface.
Post Reply
User avatar
Burner Inserter
Burner Inserter
Posts: 19
Joined: Sat Apr 13, 2019 11:09 pm

Adding lighting to an entity in 1.1.30+

Post by demongo »

just wondering how i can add lighting/glow effects to entities... my old methods don't seem to work in the current version anymore :(
in entity.dat:

Code: Select all

    glow_size = 3,
    glow_color_intensity = 3,
    glow_render_mode = "multiplicative",
    light_when_colored = {intensity = 3, size = 3, color = {r=0.4, g=0.8, b=1.2}},
    light = {intensity = 3, size = 3, color = {r=0.4, g=0.8, b=1.2}},
even if its by script I'm happy in my limited free time to learn.
(1) It is not meant to have an on/off cycle this is a power distribution building so the only time im ok with the light not working at all is if say no power... im also ok with the light being dimmed based on lack of power supply for example.
(2) This is not a vanilla building and is one that im adding by a mod i am working on.

User avatar
Smart Inserter
Smart Inserter
Posts: 2364
Joined: Fri Nov 06, 2015 7:41 pm

Re: Adding lighting to an entity in 1.1.30+

Post by Deadlock989 »

I don't know what you mean by "entity.dat", as far as I know there's no such thing in Factorio mods.

In 1.0 and 1.1 Factorio got a lot more lighting options. Usually these are added to an entity in working visualisations because those give most control over when the animations/lights are displayed. However now almost any Sprite or Animation definition can be rendered as a light using draw_as_glow or draw_as_light so you're no longer restricted to entities which support working visualisations.

You can also use the rendering API's draw_light function in control scripts but from hearsay I'm not sure this scales well for thousands of entities.

Post Reply

Return to “Modding help”