Factorio

Factorio

View Stats:
Diesel Jul 17, 2016 @ 3:45pm
I want to unload a specific number of empty barrels froma train
So I am trying to make a train unload empty barrels onto a transport belt however if it unloads all the empty barrels the next station it goes to will have no barrels to fill. I am trying to use the network system to unload 40 empty barrels per station but I cant find a solution.

Can anyone shine some light on how to unload a specific number of an item off a train straight onto a transport belt?
< >
Showing 1-15 of 16 comments
Snowhusky5 Jul 17, 2016 @ 4:22pm 
Assuming the train is set to go after X seconds, you could time it so the right number of barrels are unloaded and then the train immediately leaves

Alternatively, insert 40 barrels into the train to test, and then get them unloaded (make sure the inserter uses a good stack size, 1, 2, 4, 5, 8, 10 at a time are all factors of 40). Note the position of the very first barrel once the last one is unloaded; then connect the conveyor that the first barrel was on to the circuit network, and also connect the inserter unloading from the train. Tell the belt to read contents (hold mode not pulse), and tell the inserter to only operate when barrels = 0. This should stop the inserter as soon as the first barrel gets to that belt, until all the barrels go through the belt. Depending on how fast the barrels are unloaded, you may need 1 or 2 more belts reading contents after the first.

An easier way could be to just make a lot of extra barrels.
Last edited by Snowhusky5; Jul 17, 2016 @ 4:23pm
ArtyD42 Jul 17, 2016 @ 4:38pm 
Alternatively you could just pulse 5 unloading devices 8 times and have the reload time be greater than a minute.
Diesel Jul 17, 2016 @ 5:09pm 
http://steamcommunity.com/sharedfiles/filedetails/?id=726627591
Plausible solution I created
The 3 conveyor belts, 1 which is disabled whilst the other 2 scan for empty barrels, if the amount of barrels exceeds 4 the 3rd conveyor belt enables allowing empty barrels to be dispensed. If the amount of barrels in the scanned convyors is less than 4 the inserter starts putting them in.

It needs polishing ut I think I am on the right track
luggage Jul 17, 2016 @ 5:16pm 
Stick a single chest at each station to be unloaded to. Limit the chest size to 4 slots instead (each slot can hold 10 barrels, so that is 40 barrels). Now the tricky part. If you are on ver 0.12, you need a SR-Latch device, to allow the chest to be loaded, but not unloaded as well. You also need to set a timer for longer than the train will be in the station, which will reset the SR latch.

E.g.:
1. Inserter unloading chest is locked. Inserter loading chest from train is unlocked.
2. Train arrives at station ... chest gets loaded to full (assuming sufficient barrels available ... if not ... the whole system hangs).
3. When chest is full, the Sr-latch is flipped, and a timer starts. With the SR-latch being flipped, the inserter loading the chest is locked, and the inserter unloading the chest in unlocked.
4. Train leaves after a short interval.
5. Timer stops, resets the SR-latch. This means that it is set back to the original position ... inserter can load chest, but unloading inserter is locked. This also assumes that the chest is now emptied ... i.e. there was sufficient time and room to unload all the barrels.

For ver 0.13, see below for my easy way out. I haven't had time to do a method using a single train visiting multiple fuel depots yet.

There is a thread a few pages down started by myself regarding a similar situation ... how to end up with a wagon leaving a fuel depot with 100% cargo. Possibly worth a read.

I immediately jumped onto ver 0.13 to solve this issue, and now I am using an easy option of having each fuel supply outpost having its own dedicated train and single wagon full of empty barrels, which it delivers once full. Means no need for tanks, and a tiny area outlay.

http://steamcommunity.com/sharedfiles/filedetails/?id=726620666

The downside is that fuel deliveries at the beginning are a bit sporadic until you get sufficient fuel supplies going. On the other hand, you never 'lose' or 'miss out' on fuel because the fuel tanks at your supply stations are full and the pumps cannot fill anymore. Nor do you have to worry about the exact number of barrels in/out.
KatherineOfSky Jul 17, 2016 @ 5:17pm 
The only problem with exactitude in this situation is the eventual mis-balancing because of production changes... which usually happens on the Oil unloading end where barrels are drained of oil.

They cannot empty, and therefore produce few or no barrels. The train will pick up these few barrels, take them to the first oil station, and there will be none for the second station, etc. if you follow my meaning.

Of course, it does depend on how your trains are set up, and how many stations are chained together, etc.

The only solution I found was to produce a large numbers of barrels so there would be an excess available, then load them into train cars that had reserved slots for both empty and full barrels.

Hopefully the devs implement liquid cars soon!
Diesel Jul 17, 2016 @ 5:29pm 
Originally posted by KatherineOfSky:
The only problem with exactitude in this situation is the eventual mis-balancing because of production changes... which usually happens on the Oil unloading end where barrels are drained of oil.

They cannot empty, and therefore produce few or no barrels. The train will pick up these few barrels, take them to the first oil station, and there will be none for the second station, etc. if you follow my meaning.

Of course, it does depend on how your trains are set up, and how many stations are chained together, etc.

The only solution I found was to produce a large numbers of barrels so there would be an excess available, then load them into train cars that had reserved slots for both empty and full barrels.

Hopefully the devs implement liquid cars soon!

Or an overhead circuit connector so the wagons can act like crates at the station that would make this so much simpler, but wagons dont count as crates so there is no way of telling the network how much barrels are in the wagon
KatherineOfSky Jul 17, 2016 @ 5:33pm 
Originally posted by Dead Weight:
Or an overhead circuit connector so the wagons can act like crates at the station that would make this so much simpler, but wagons dont count as crates so there is no way of telling the network how much barrels are in the wagon

Are you playing 0.13.x? You can look at the quantity of items in trains in the experimental build.
Diesel Jul 17, 2016 @ 6:07pm 
Ok I think I've made a suitable network:

http://steamcommunity.com/sharedfiles/filedetails/?id=726649912

Basically, the transport belts have a threshold amount of empty barrels before they enable allowing them to pass through, the amount of empty barrels required to open the last transport belt increases with each wagon, this blocks the inserter putting any more empty barrels on the belt for each wagon until the first wagon reaches a certain number, then the second, then the third etc The last one is always unblocked so the system doesn't get stuck.
Cyrogem Jul 17, 2016 @ 6:31pm 
Do my solution, make enough barrels to fill every station with empty barrels, then have a few hundred extra, you'll never run out
Mazian Jul 18, 2016 @ 12:46am 
I created a nifty mechanism for balancing "empty barrel" output to that of the storage tank located at the oil outpost. While oil production is high, it outputs a lot of barrels. As production declines, it picks up the spares and even offloads fewer empty barrels.

I'm planning to adjust the design with v0.13.x because of the new circuit logic controls that were added. I think there can be some improvements to my current design. (The current design uses 4 chests, several stack and filter stack inserters, and a single arithmetic combinator.)
Terozo Jul 19, 2016 @ 11:37pm 
Rail signals may now be added to the circuit network. You could also use that as a form of switch for inserters if you have buffer chest(s). ie if a train is in the station you could enable / disable inserters etc. In one of my games I have gone one step further and completely power down the inserters with the aid of a power switch when they aren't supposed to be active.

(In 13.x) Alternatively, if you know the maximum number of empty barrels that the train will be carrying, the wait condition at that station could be Cargo = n-40 empty barrels. ie, if the train carries 240 barrels, the first station would be leave at 200 barrels, the next at 160 barrels etc.
Game Over, Man Jul 20, 2016 @ 4:38pm 
Originally posted by KatherineOfSky:
Hopefully the devs implement liquid cars soon!
Another thought I had was a Battery Cart. I had made a pump station far away from my power network so I had to build solar panels and it could only work during the day, since I didn't have batteries unlocked yet. Once batteries are researched, instead of accumulators and panels, the battery cart on the train could power assemblers and inserters for filling oil barrels.
Mazian Jul 20, 2016 @ 7:49pm 
Originally posted by Game Over, Man:
Another thought I had was a Battery Cart.

There is a mod that does this.
Game Over, Man Jul 20, 2016 @ 8:15pm 
Which one?
Mazian Jul 20, 2016 @ 9:23pm 
Originally posted by Game Over, Man:
Which one?
5dim[forums.factorio.com]
< >
Showing 1-15 of 16 comments
Per page: 1530 50

Date Posted: Jul 17, 2016 @ 3:45pm
Posts: 16