Steam Locomotive - Reuploaded


Adds a tender locomotive that requires water and fuel to function. Reuploaded by Traincrisis If you were using the first bugged version, please update to 0.1.0.

Content
4 months ago
1.1
458
Trains

b [Done] Fuel with accel bonus prevents automated refilling with water

6 months ago

Apparently there was a bug with the original which carried over to this version where fuel with an accel bonus, when used with the steam loco, prevents it from refilling with water automatically: https://mods.factorio.com/mod/steamtrain/discussion/654596f5e78a61175b009b8a

6 months ago
(updated 6 months ago)

i don't know LUA, because i did this version by copying the original and then changing some code to be like a new mod while working the same way

6 months ago
(updated 6 months ago)

Ok, after some playing around, I think I've found the answer:

In this mod, control.lua, lines 149-151, change these 3 lines of code:

remote.call("fluidTrains_hook", "addFluid", "rtc:water", "steam", {{item = "rtc:hot-water3", temp = 600}})
remote.call("fluidTrains_hook", "addFluid", "rtc:water", "steam", {{item = "rtc:hot-water2", temp = 400}})
remote.call("fluidTrains_hook", "addFluid", "rtc:water", "steam", {{item = "rtc:hot-water1", temp = 200}})

to this:

remote.call("fluidTrains_hook", "addFluid", "rtc:water", "water", {{item = "rtc:hot-water3"}})
remote.call("fluidTrains_hook", "addFluid", "rtc:water", "water", {{item = "rtc:hot-water2"}})
remote.call("fluidTrains_hook", "addFluid", "rtc:water", "water", {{item = "rtc:hot-water1"}})

.
The issue, and thus the reason why it wasn't working, is because with the original settings, when the train came to a stop, the fluidTrains mod would (rightfully so as it was told to) place steam into the tanks while the player is trying to load it with water. Obviously, this does not work.

However, simply changing the "steam" values to "water" wasn't enough, either, because of the temp values. Unless the water being loaded in matches those values (which we can't do), then it won't use it. Just as it was told. :)
(Why it would accept 15°C water when the tanks were empty in the first place, I don't know.)

From what I can tell, this appears to have no impact in game and the steam items are correctly converted to their respective accel & top speed mult variants.

All of that said, while digging around through this mod's code, I see that they hardcoded some lookups based on the fuel accel mult values. This means this mod may not play nice with other mods that modify these. *sigh* If I decide to take a crack at that one at some point, I'll let you know what I find.

5 months ago

Should I add the dot?

5 months ago

In this mod, control.lua, lines 149-151, change these 3 lines of code:
remote.call("fluidTrains_hook", "addFluid", "rtc:water", "steam", {{item = "rtc:hot-water3", temp = 600}}) remote.call("fluidTrains_hook", "addFluid", "rtc:water", "steam", {{item = "rtc:hot-water2", temp = 400}}) remote.call("fluidTrains_hook", "addFluid", "rtc:water", "steam", {{item = "rtc:hot-water1", temp = 200}})

to this:
remote.call("fluidTrains_hook", "addFluid", "rtc:water", "water", {{item = "rtc:hot-water3"}}) remote.call("fluidTrains_hook", "addFluid", "rtc:water", "water", {{item = "rtc:hot-water2"}}) remote.call("fluidTrains_hook", "addFluid", "rtc:water", "water", {{item = "rtc:hot-water1"}})

Good to know I will also change this in my own local mod that i was updating for personal use. as well as i just found this mod. glad to know theres other people that love these kind of mods. and trying to keep them updated.

5 months ago
(updated 5 months ago)

Should I add the dot?

No, apologies, the dot was meant to force an extra line of space between the code snippets and my next line of text as the board was automatically removing the extra line breaks.

5 months ago

ok

New response