Diesel Locomotive fix for 0.18 deprecated


This mod has a replacement (https://mods.factorio.com/mod/dieselTrains). Adds functionality and a locomotive for using fluids as fuel. Can use heavy oil, light oil, or diesel (if added by another mod), or all three. Incompatible with some mods that add fluids and use a non-64x64 icon. Configurable in Settings -> Mod Settings. Fixed for 0.18.

Content
4 years ago
0.18
8
Trains

g Is tehre no way to only make icons for the fluids that can actually be used by the locomotive?

4 years ago

.

4 years ago

Apparently, you can change your code to rescale icons as needed.

https://mods.factorio.com/mod/MoreScience/discussion/5e3b8cd1da6d8f000b09639e

I might do it myself.

4 years ago

Its also creating issues with other mods.

https://imgur.com/lCUH0a2

4 years ago
(updated 4 years ago)

I'll look through the code to see if it can be fixed.
I didn't make the original mod so I don't really know the code, and i'm very inexperienced with lua, though, so i don't know if i can fix it.

If diesel is not found, the code is going through all of the fluids in the game and adding them as potential fuels, even though it shouldn't need to do that. If I try to make it so that it only does light and heavy oil, it might cause problems if you try to put the wrong fluid in to the locomotive.

Now i've fixed that issue, but it crashes if you try to put water in.

4 years ago

Well, the problem is that it requires 64x64 on all fluid icons, whether it can use it or not. You should be able to simply rescale them to 64x64 instead of requiring the source to be so.

4 years ago

The thing is is that it's just simpler to have it only care about light and heavy oil, and fix the original problem, than to put in if statements to resize everything

4 years ago

So only put fuel fluids in, got it!

4 years ago

Once this is updated, anyway...

4 years ago

For some reason the mod still tries to use the fluid prototypes from other mods, even though they aren't diesel, and even if I comment the diesel it still tries to use them. The new update does fix the original issue, though.

New response