Triggering Smoke on Entity
Posted: Mon Jun 09, 2025 4:15 pm
Hi all,
I'm trying to alter the smoke generation for a locomotive. I've made a mod (https://mods.factorio.com/mod/jd-speed-limits) to slow down trains on sections of track. At the moment, a train continues to put out a lot of smoke even when travelling at (and maintaining) a low speed. A feature of the mod is that the train uses less fuel when it's maintaining a low speed. I'd like to show that visually by generating less smoke when less power is being used.
My first idea was to turn off the locomotive's smoke entirely, and instead generate it in Lua, ideally making it look exactly the same as the normal smoke. I tried running this each frame as an experiment:
However, this doesn't give the smoke all the properties that the locomotive's burner does, like telling it how to move. It appears at the locomotive and then runs its animation while remaining static. There aren't any other options to pass into the function (https://lua-api.factorio.com/latest/cla ... vial_smoke) to add these details.
Does anyone have any ideas of how I can achieve this?
I'm trying to alter the smoke generation for a locomotive. I've made a mod (https://mods.factorio.com/mod/jd-speed-limits) to slow down trains on sections of track. At the moment, a train continues to put out a lot of smoke even when travelling at (and maintaining) a low speed. A feature of the mod is that the train uses less fuel when it's maintaining a low speed. I'd like to show that visually by generating less smoke when less power is being used.
My first idea was to turn off the locomotive's smoke entirely, and instead generate it in Lua, ideally making it look exactly the same as the normal smoke. I tried running this each frame as an experiment:
Code: Select all
for _, locomotive in ipairs(train.locomotives.front_movers) do
locomotive.surface.create_trivial_smoke({name='train-smoke', position=locomotive.position})
end
Does anyone have any ideas of how I can achieve this?