Battery-Electric Train

by catweax

Electric trains, but UPS-friendly. Provides battery-powered locomotives, reusable battery packs and charging facilities. Balanced for vanilla gameplay by default, but trains can be as fast as you want.

Content
11 months ago
1.1 - 2.0
18.9K
Trains

b Refuelling interrupt rule

10 months ago
(updated 10 months ago)

I've tried to create a refueling interrupt rule but have thus far been unable to make one reliably work.
I've tried setting a single rule for any locomotive to go get refueled if it has less than one of any fuel type - no dice. If I set a series of four rules, one for each battery type, and set them all to OR, the train will go to the station, but then will never leave. I have the departure condition set to any of the four kinds of batteries to be greater than 1.

What am I missing?

10 months ago

I haven’t actually tried the new train interrupt system yet, so I can only guess.

If you set the four interrupt rules to OR and only have one type of fuel inside, the interrupt condition will always be true and I guess that makes the train stay at the refueling station. Have you tried setting the four interrupt rules to AND? The departure conditions have to be set to OR so that any one battery type is acceptable for leaving.

9 months ago

i do not know if it is the case in this situation, but it may be that the fuel 'in progress' is counted by the condition - i know this is the case with the circuit conditions for nuclear reactors; perhaps try setting the interrupt to "fuel < 2" rather than "fuel < 1" and see if it works then

9 days ago

This seems to work fine for me:

This is when the train has one battery being used and one backup loaded, so I don't think it's reading the battery currently being used in those conditions.

The only issue I have is that I can't replace that interrupt with a single condition using the Fuel parameter signal. The parameter needs some fuel in the locomotive to have something to replace the parameter with, and since the train can only hold a single battery, we either have a battery in the locomotive and thus don't need to refuel, or we don't and we don't have a signal to fulfil the interrupt requirements.

Though I guess that's more of an issue with the base game than the mod itself - I'm assuming the interrupt system for fuel was designed to fire when you are running low but still have some, so you'll always fire that interrupt before your locomotive is fully empty. I might need to try and see if it works similarly for vanilla fuels, but I would assume so. If it doesn't, then perhaps something in the way they coded the fuel parameter itself makes it not work properly with those batteries.

9 days ago

Thanks for analyzing the issue and sharing a possible solution.

I think you’re right about the Fuel parameter signal needing some fuel in the locomotive and therefore not working with battery packs. Giving battery packs less capacity and loading more would be an option, but dumping multiple battery packs into a locomotive like pieces of coal seems strange, so I’m not planning to do that.

9 days ago

Yeah, that's the only solution that came to my mind so far, and I agree it would actually feel worse. Luckily that issue isn't too bad, with 4 types of batteries that condition isn't looking too complicated. ;)

New response