Page 1 of 1

Changing sprite of a train dynamically

Posted: Wed Jul 29, 2020 5:36 pm
by Philuminati
Hello,

A while ago I thought about how cool it would be, if trains using nuclear fuel would glow. Now I try to make a mod for this but I don't know if there is a way to change the sprite of an entity depending on their inventory. Alternativly, is there any way to add the glow via the coloring of the train? What do you guys think is the best way to accomplish this?

Thanks in advance,

Phil

Re: Changing sprite of a train dynamically

Posted: Thu Jul 30, 2020 10:28 am
by darkfrei
Philuminati wrote: Wed Jul 29, 2020 5:36 pm Hello,

A while ago I thought about how cool it would be, if trains using nuclear fuel would glow. Now I try to make a mod for this but I don't know if there is a way to change the sprite of an entity depending on their inventory. Alternativly, is there any way to add the glow via the coloring of the train? What do you guys think is the best way to accomplish this?

Thanks in advance,

Phil
Both https://lua-api.factorio.com/latest/LuaRendering.html

Re: Changing sprite of a train dynamically

Posted: Wed Aug 12, 2020 1:13 pm
by mrvn
Look at the centrifuge prototype as an example for glowing entities. See if you can use that on trains too. That would really be the best.

Note: Mods add different nuclear fuel (e.g. pollonium) that glow at different colors. It's nice to see the centrifuge glow differently depening on which recipe is being used. Would be nice if the train glowed according to fuel used too.