## Automatic refueling of locomotives (Vanilla)

Smart setups of railway stations, intelligent routing, solutions to complex train-routing problems.
Please provide - only if it makes sense of course - a blueprint of your creation.
KILLBASS
Manual Inserter
Posts: 2
Joined: Mon Mar 04, 2019 8:36 pm
Contact:

### Automatic refueling of locomotives (Vanilla)

Для англоговорящих камрадов.

Sup, anonymous that can help in the logic.
There is one algorithm. There is a place with loading (point A) and a place with unloading (point B). It is necessary to automate the refueling process. How can I make sure that while traveling from A to B, the train would check for a value of less than 50 fuel (approximately), and after refueling, check for fuel = 150 and then go to point A or B (depending on is he from A to B or B to A, respectively)?

Для русскоговорящих камрадов

Анонче которые могут в логику хелп.
Есть один алгоритм. Есть место с погрузкой (пункт А) и место с разгрузкой (пункт Б). Нужно автоматизировать процесс заправки. Как мне сделать, что бы во время движения из А в Б, поезд делал проверку на значение меньше 50 топлива (примерно), а после заправки, проверку на кол-во топлива = 150 и после ехал на точку А или Б (в зависимости ехал он до этого с А на Б или Б на А соответсвенно)?

Attachments
алгоритм.png (36.08 KiB) Viewed 4200 times
image-9.png (959.43 KiB) Viewed 4200 times

nafira
Fast Inserter
Posts: 107
Joined: Fri Mar 16, 2018 12:20 pm
Contact:

### Re: Automatic refueling of locomotives (Vanilla)

Hi !

Since you can't wire a train to get info on fuel, you have to do it the other way around :
- put a specific amount in a chest : 200 fuel
- load the train with fuel normally
- block the signal to go if you the arm is working (use a memory logic to output it, it will keep the signal blocked until the arm stop working for like 5 second AND you have 200 fuel in the chest)

I'm not an expert on logic gates, but I think this is the only way to do it !

Edit : here is a previous post on a similar problem : viewtopic.php?t=62312

gGeorg
Filter Inserter
Posts: 301
Joined: Wed Jun 19, 2019 8:06 pm
Contact:

### Re: Automatic refueling of locomotives (Vanilla)

I assume you transport Oil and Water to make your Oil/chemical industry center.

I would solve it other way. Make solid fuel from oil, then add a refuel inserter to all(both) train stations there. No need for logic gates at all. As soon as they arrive to unload they will be stufffed by fuel to the roof. Just dont overthink it.
More over, Solid fuel gives you faster trains and Oil resource is endless, coal not.

Even easyer solution, remove trains , use pipe only.

KILLBASS
Manual Inserter
Posts: 2
Joined: Mon Mar 04, 2019 8:36 pm
Contact:

### Re: Automatic refueling of locomotives (Vanilla)

gGeorg wrote:
Sat Dec 07, 2019 12:00 pm
I assume you transport Oil and Water to make your Oil/chemical industry center.

I would solve it other way. Make solid fuel from oil, then add a refuel inserter to all(both) train stations there. No need for logic gates at all. As soon as they arrive to unload they will be stufffed by fuel to the roof. Just dont overthink it.
More over, Solid fuel gives you faster trains and Oil resource is endless, coal not.

Even easyer solution, remove trains , use pipe only.
Pulling a pipe is too easy. I'm interested in creating a place where locomotives will come when they will have little fuel. That is, it is necessary to implement a system that will read information about the amount of fuel in a locomotive.

Oktokolo
Filter Inserter
Posts: 875
Joined: Wed Jul 12, 2017 5:45 pm
Contact:

### Re: Automatic refueling of locomotives (Vanilla)

KILLBASS wrote:
Mon Dec 09, 2019 10:43 pm
That is, it is necessary to implement a system that will read information about the amount of fuel in a locomotive.
Then this is not a creation to show - but a feature request as it currently is not possible to read the current fuel amount from a locomotive in vanilla.
There is the Inventory Sensor mod that can read locomotive content though. So if it does not strictly has to be vanilla only, you can make it working with that mod right now.

nafira
Fast Inserter
Posts: 107
Joined: Fri Mar 16, 2018 12:20 pm
Contact:

### Re: Automatic refueling of locomotives (Vanilla)

Oktokolo wrote:
Tue Dec 10, 2019 12:04 am
KILLBASS wrote:
Mon Dec 09, 2019 10:43 pm
That is, it is necessary to implement a system that will read information about the amount of fuel in a locomotive.
Then this is not a creation to show - but a feature request as it currently is not possible to read the current fuel amount from a locomotive in vanilla.
There is the Inventory Sensor mod that can read locomotive content though. So if it does not strictly has to be vanilla only, you can make it working with that mod right now.
Or as I said you count it the other way around : don't count what's in the train, count what's in the chest ! (Taking in account inserter activity)
You'll be able to block the signal and refuel the train as needed.

mrvn
Smart Inserter
Posts: 5112
Joined: Mon Sep 05, 2016 9:10 am
Contact:

### Re: Automatic refueling of locomotives (Vanilla)

The problem is sending the train to the fuel station when it needs fuel. That's simply not possible in vanilla.

All you can to is

a) refuel at one of the stops. E.g. all my furnace stations refuel trains since they have fuel at hand anyway.
b) include a refuel stop in the train schedule

Note: You can make the schedule "A B A B A B A B A B Fuel" to only fuel every 5 trips.