Page 1 of 1

Automatic refueling of locomotives (Vanilla)

Posted: Thu Dec 05, 2019 12:17 pm
by KILLBASS
For English-speaking comrades.
Для англоговорящих камрадов.

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)?


For Russian-speaking comrades.
Для русскоговорящих камрадов

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



Image
Image

Re: Automatic refueling of locomotives (Vanilla)

Posted: Thu Dec 05, 2019 6:05 pm
by nafira
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

Re: Automatic refueling of locomotives (Vanilla)

Posted: Sat Dec 07, 2019 12:00 pm
by gGeorg
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.

Re: Automatic refueling of locomotives (Vanilla)

Posted: Mon Dec 09, 2019 10:43 pm
by KILLBASS
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.

Re: Automatic refueling of locomotives (Vanilla)

Posted: Tue Dec 10, 2019 12:04 am
by Oktokolo
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.

Re: Automatic refueling of locomotives (Vanilla)

Posted: Thu Dec 12, 2019 7:04 pm
by nafira
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.

Re: Automatic refueling of locomotives (Vanilla)

Posted: Fri Dec 13, 2019 2:13 pm
by mrvn
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.