Page 1 of 1

green/red wires and trains

Posted: Tue Oct 14, 2014 5:58 pm
by Guedez
Is it possible to control how much ore/metal/coal/etc goes into a train per wagon using wires and smart inserters? If not, is there another way to do something like this?

Re: green/red wires and trains

Posted: Tue Oct 14, 2014 6:30 pm
by DerivePi
Have you tried the middle mouse button on one of the storage spots in the wagon? You can reserve that spot on the wagon for a specific material. Ex. open up the wagon storage interface, MM click on one of the spots. Select "Laser Turrets". The spot turns blue and now only laser turrets can be stored in that spot on the wagon.

Also have a look here for a more complicated option. Its an old post but it should spark some ideas. https://forums.factorio.com/forum/vie ... ion#p38491

Re: green/red wires and trains

Posted: Tue Oct 14, 2014 11:07 pm
by ssilk

Re: green/red wires and trains

Posted: Wed Oct 15, 2014 12:37 am
by Guedez
Setting what goes in which slot does not help. I could change the configuration of my train arround the limitations, thus making it work, but i'd rather not if possible.

Currently I have the train go through my iron mining station, then go to the copper mining station, then to the coal mining (where it unloads the ore, and collect the plates from the previous trip, plus a bit of coal, then it goes where it unload the plates/coal.

By setting slots for each stuff, it could only carry half the ore and half the plates each trip.

Re: green/red wires and trains

Posted: Wed Oct 15, 2014 4:40 am
by n9103
Setting filters is the only way to determine what and how much is loaded into a train.
Best to set up a 2nd train and a full rail system if you want to guarantee throughput.

Re: green/red wires and trains

Posted: Wed Oct 15, 2014 7:39 am
by Marbles
You could set up a buffer that loads the required values in boxes using green wires, smart chests and smart inserters. Then you could load everything in your buffer boxes into the train to get the ammouns you want in there. You need a reset switch connected to all the smart inserters using red wire to prevent them from loading the buffer chests while the train itself is being loaded. You might be able to do this by having a check that loads 1 random item per buffer chest into another chest when the buffer chest is empty, and when it contains as many items as you have buffer chests, it means everything is loaded. Now trigger a single reset loop and put the counter items back on the belt. Make the single reset loop long enough to give the train time to leave the station. When it has come full circle the loading of the buffer chests can begin again.

I'd make this and show it to you in factorio, but I'm at work, so I hope you (or anyone else) gets it. :D

Re: green/red wires and trains

Posted: Wed Oct 15, 2014 3:21 pm
by n9103
Well, I can visualize it, and it's bigger than the entire train station. :p

Re: green/red wires and trains

Posted: Wed Oct 15, 2014 4:43 pm
by DerivePi
Marbles wrote:You could set up a buffer that loads the required values in boxes using green wires, smart chests and smart inserters. Then you could load everything in your buffer boxes into the train to get the ammouns you want in there. You need a reset switch connected to all the smart inserters using red wire to prevent them from loading the buffer chests while the train itself is being loaded. You might be able to do this by having a check that loads 1 random item per buffer chest into another chest when the buffer chest is empty, and when it contains as many items as you have buffer chests, it means everything is loaded. Now trigger a single reset loop and put the counter items back on the belt. Make the single reset loop long enough to give the train time to leave the station. When it has come full circle the loading of the buffer chests can begin again.

Here is my WIP railroad Station System Overview:
- the trains come from the bottom and stop at the Import Station (bottom middle) which unloads all of the items stored in the wagons - the first wagon also carries a specified quantity of a unique item (wood or standard ammo) that is counted when it is off loaded
- As soon as any quantity of the unique item is found in any of the Import Station's Smart Chests, the Import Station Logic System (bottom left) starts a timer loop (bottom loop) which controls the Station Counter Loop (top loop) and the wagon toggle for offloading (middle loop). The logic system counts how many unique items are delivered (1 through 4) and places an item (wood) in the associated smart chest (top loop) which is relayed to the Export Station Logic System. When the count is complete, the wagon toggle opens the smart chests adjacent to the 1st wagon spot in the Import Station. The timer loop has a fixed time (usually 30 secs) and then resets the system for the next train.
- The Sorting Station (right side) is a winding, closed, 'S' loop that receives all items from the Factory and from the Import Station and sorts it to its appropriate belt and/or chest.
- The Export Station (top Middle) loads items onto the train wagons. For most Main bases, only the first wagon will need to be loaded.
- The Export Station Logic System (top Left) has another Timer Loop and a toggle for each train destination station (1 through 4) which controls which Chest in the Delivery System (Upper Top Right) is loaded onto the train.
RAILROAD STATION-OVERVIEW.gif
RAILROAD STATION-OVERVIEW.gif (302.54 KiB) Viewed 8323 times
and an up close view of the Railway Delivery System
- For each destination station, an outgoing wire (red or green) is connected to a smart storage chest at the outpost (upstream) or at the mainbase (downstream). That wire is then connected to a series of smart inserters in the delivery system that will pull items from a belt to be placed into another locally connected smart chest until the number of items add up to the desired amount (ex. you want 50 laser turrets stored at Outpost 2 and there are only 20 stored there now. The "laser turret" associated smart inserter for outpost 2 (3rd from the bottom and 2nd to the left) is connected to both the local outpost 2 storage chest and to the global Outpost 2 chest and will continue operating until there are at least 30 laser turrets stored in the local outpost 2 storage chest so that the connected wire system reads the designated 50).
- The local chest can either be loaded from above, or when the station toggle is set, unloaded to below. The unloaded goods are then inserted over to an awaiting train wagon
RAILROAD STATION-DELIVERY.gif
RAILROAD STATION-DELIVERY.gif (359.46 KiB) Viewed 8323 times

Re: green/red wires and trains

Posted: Thu Oct 16, 2014 7:23 am
by Marbles
n9103 wrote:Well, I can visualize it, and it's bigger than the entire train station. :p
I don't think it has to be that big, I'll see if I can make something tonight
DerivePi wrote:
Marbles wrote:You could set up a buffer that loads the required values in boxes using green wires, smart chests and smart inserters. Then you could load everything in your buffer boxes into the train to get the ammouns you want in there. You need a reset switch connected to all the smart inserters using red wire to prevent them from loading the buffer chests while the train itself is being loaded. You might be able to do this by having a check that loads 1 random item per buffer chest into another chest when the buffer chest is empty, and when it contains as many items as you have buffer chests, it means everything is loaded. Now trigger a single reset loop and put the counter items back on the belt. Make the single reset loop long enough to give the train time to leave the station. When it has come full circle the loading of the buffer chests can begin again.

Here is my WIP railroad Station System Overview:
- the trains come from the bottom and stop at the Import Station (bottom middle) which unloads all of the items stored in the wagons - the first wagon also carries a specified quantity of a unique item (wood or standard ammo) that is counted when it is off loaded
- As soon as any quantity of the unique item is found in any of the Import Station's Smart Chests, the Import Station Logic System (bottom left) starts a timer loop (bottom loop) which controls the Station Counter Loop (top loop) and the wagon toggle for offloading (middle loop). The logic system counts how many unique items are delivered (1 through 4) and places an item (wood) in the associated smart chest (top loop) which is relayed to the Export Station Logic System. When the count is complete, the wagon toggle opens the smart chests adjacent to the 1st wagon spot in the Import Station. The timer loop has a fixed time (usually 30 secs) and then resets the system for the next train.
- The Sorting Station (right side) is a winding, closed, 'S' loop that receives all items from the Factory and from the Import Station and sorts it to its appropriate belt and/or chest.
- The Export Station (top Middle) loads items onto the train wagons. For most Main bases, only the first wagon will need to be loaded.
- The Export Station Logic System (top Left) has another Timer Loop and a toggle for each train destination station (1 through 4) which controls which Chest in the Delivery System (Upper Top Right) is loaded onto the train.
-snip-
and an up close view of the Railway Delivery System
- For each destination station, an outgoing wire (red or green) is connected to a smart storage chest at the outpost (upstream) or at the mainbase (downstream). That wire is then connected to a series of smart inserters in the delivery system that will pull items from a belt to be placed into another locally connected smart chest until the number of items add up to the desired amount (ex. you want 50 laser turrets stored at Outpost 2 and there are only 20 stored there now. The "laser turret" associated smart inserter for outpost 2 (3rd from the bottom and 2nd to the left) is connected to both the local outpost 2 storage chest and to the global Outpost 2 chest and will continue operating until there are at least 30 laser turrets stored in the local outpost 2 storage chest so that the connected wire system reads the designated 50).
- The local chest can either be loaded from above, or when the station toggle is set, unloaded to below. The unloaded goods are then inserted over to an awaiting train wagon
-snip
That's a massive setup right there. I like the idea of having the trains carry their own id code in the form of a stack of items, it does require a substantial ammount of logic though. I'm gonna try to make that specific loading setup that I mentioned tonight, hopefully a bit more compact :P

Re: green/red wires and trains

Posted: Thu Oct 16, 2014 12:14 pm
by DerivePi
Marbles wrote:That's a massive setup right there. I like the idea of having the trains carry their own id code in the form of a stack of items, it does require a substantial ammount of logic though. I'm gonna try to make that specific loading setup that I mentioned tonight, hopefully a bit more compact
What you described is like what I have for the Delivery Station, just minus the train ID and the uplink to the satellite base. I've only used my layout in one game because it is a beast to implement and unnecessary. I'd love to simplify. I think the biggest problem is with the wiring. The red and green wires quickly become an unreadable tangled mess.

I look forward to seeing your solution!

Re: green/red wires and trains

Posted: Mon Oct 20, 2014 11:08 pm
by xnmo
I'm only just scratching the surface when it comes to using trains, but my personal preference is only have each wagon carry a single resource type (Empty/filled barrels being the exception here). It's not like a single wagon can hold a massive quantity, it's capacity isn't much more than a wooden chest, so I don't think this is that inefficient a solution.

Re: green/red wires and trains

Posted: Mon Oct 20, 2014 11:52 pm
by n9103
Indeed, I've only got one train that doesn't have the slots all pre-set to one kind of item, and that's my Oil and general supplies train. (Does mostly Oil, but also carries around a stack of tools and walls to restock outposts.

Re: green/red wires and trains

Posted: Tue Oct 21, 2014 9:52 am
by Boogieman14
I'm pretty much the opposite. All my trains have 3 wagons, two of which are completely free and the third has slot restrictions set to get supplies to the outposts (yes, each train has its own supply wagon, so I just need to plop down my outpost blueprint and as soon as the station's serviced, the needed supplies are there).

The incoming goods generally get sorted either on belts or using logistics network.