Changing sprite of a train dynamically

Place to get help with not working mods / modding interface.
Post Reply
User avatar
Philuminati
Inserter
Inserter
Posts: 35
Joined: Sun Aug 05, 2018 1:04 am
Contact:

Changing sprite of a train dynamically

Post 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

User avatar
darkfrei
Smart Inserter
Smart Inserter
Posts: 2903
Joined: Thu Nov 20, 2014 11:11 pm
Contact:

Re: Changing sprite of a train dynamically

Post 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

mrvn
Smart Inserter
Smart Inserter
Posts: 5704
Joined: Mon Sep 05, 2016 9:10 am
Contact:

Re: Changing sprite of a train dynamically

Post 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.

Post Reply

Return to “Modding help”