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?