Multiple Unit Train Control


Replaces bidirectional trains with ones twice as powerful, to simulate real locomotives driving backwards.

Tweaks
7 days ago
0.17 - 2.0
4.27K
Trains

b [Fixed] Angel's Crawler Locomotive takes different fuel than MU version

2 years ago

When playing with a large set of mods notably Krastorio2, Angel's Addons: Mass Transit, AAI, and Space Exploration, I found the following problem. Krastorio2 adds a new fuel category, "vehicle-fuel", which Angel's crawler locomotive accepts, but the MU crawler locomotive does not. I have not checked if this also occurs with other Angel's locomotives (there are several).
I mention AAI and SE because they also add/overhaul fuel items, and I can't remove them to test if they matter for this bug without breaking the save.

2 years ago

That's because K2 changes the fuel type of the base Crawler loco after MU copies it, but does not do a search for other locomotives to modify. It will need to be added to the compatibility patch.

You can use the tooltip (possibly with debig info enabled) to see exactly which mods modify the Crawler loco and see which of then do not modify the MU Crawler loco.

2 years ago

So I tried to fix it myself by creating a small mod but I had no success. The code I used was

if data.raw["locomotive"]["crawler-locomotive"]["burner"]["fuel_category"] then
data.raw["locomotive"]["crawler-locomotive-mu"]["burner"]["fuel_category"] = data.raw["locomotive"]["crawler-locomotive"]["burner"]["fuel_category"]
else
data.raw["locomotive"]["crawler-locomotive-mu"]["burner"]["fuel_categories"] = data.raw["locomotive"]["crawler-locomotive"]["burner"]["fuel_categories"]
end

in data-final-fixes, and I added dependencies so that it loads after Krastorio2 and MultipleUnitTrainControl. The game loads, but the two locomotives still have different fuel options. It is quite possible that I've messed something up because I am very new to modding, but I thought I would post this here to let others know what has been tried so far.

1 year, 11 months ago

This is fixed in the latest release of MUTC, by adding code to the data-final-fixes phase where fuel changes are normally made. It was easier than I thought to update the fuel categories for every MU loco after all the other compatibility fixes have been applied to the original.

New response