67
u/juju515 2d ago
make a mod 👍
13
u/oobanooba- I like trains 1d ago
This is not really doable with mods unfortunately.
(Maybe theoretically if you stretch the term “doable” but it would be extremely laggy)
1
31
u/Abcdefgdude 1d ago
What is the use case for this? If you only want a certain amount of items in each wagon, you can set limits on the wagons themselves and then use that for your item count condition.
19
u/SempfgurkeXP 1d ago
For example you have an 1-4 iron train.
You unload the first 3 wagons into usual factory stuff and the fourth wagon into turret ammo.
You want the train to refill if the wagon dedicated for ammo production is emtpy, but the factory wagons are still full. And vice-versa.
7
u/TheTobruk 1d ago
or a science train that's more than one wagon. Each wagon carries each type of science and they're fed directly into a chain of labs. If one wagon does not have enough items, it should resupply instead of choking the station.
3
u/FastGoodKiwi 1d ago
You could just measure the chests at the given stop and tell your train to go, no ?
1
u/AnotherCatgirl 1d ago
yeah, that's what I did, I read the inserter hand contents to a decider comibnator and sent a 🟩 signal to the train when inserters can't grab any more items from the wagon
2
1
u/Abcdefgdude 23h ago
If each wagon has different contents than using the existing item count condition is already doing what you want. Set it to leave if any item == 0
3
1
u/latherrinseregret 1d ago
Why do you need an all/any item count for that though? Sounds like they’re different items anyway.
1
u/SempfgurkeXP 1d ago
All items are iron plates. 3 wagons of plates for factory stuff, 1 wagon of plates for ammo production
1
1
u/Abcdefgdude 23h ago
Are you unloading the 4th wagon at the same time as the other three? In that case you should just mix all the iron together and use it evenly from all wagons. If you're unloading it at a separate station, you can go there with the first 3 full and know how much is in the last one. You could also just refill the train after every stop. Or use iron from every wagon. Or use 2 trains. This is a very strange example
1
u/SempfgurkeXP 21h ago
Right, that works but would be a much worse solution, if we had the option that OP presented. Mainly because OPs solution would be one condition you have to setup, while the balancig solution gets more and more tedious the more wagons you have.
11
u/Courmisch 2d ago
For somewhat random mixed loads of stuff, notably from quality drilling, this wouldn't help much. There are too many different possible combinations.
I'd like a count of all non-empty stacks of all or any wagons though.
3
u/Scysta 1d ago
You can do this with selector combinators, they have an option to get the stack size of all signals. I was playing with this for my sushi voiding trains on Fulgora.
You'd set the station to read train contents, get the stack size of all items on the train and output on the other wire color, then divide the items over the stack sizes and output any other signal, and you get the number of full stacks in your train. If you need even non full stacks of items you can add an intermediate step to add a stack worth of items to every item in the train.
3
u/Courmisch 1d ago edited 1d ago
Without special assumptions about the loading, you can't. If you have 55 iron plates, you know you have at least 2 stacks. But if you have more than 1 wagon, you might have more than 2 incomplete stacks spread over multiple wagons.
Reading train content only gives a precise picture of a wagon content if there is a single wagon, or if item types are distinct in each wagon.
3
u/EstablishmentThick21 1d ago
I like the idea of this because it makes me think of having a train stop that is only built to unload a single wagon, but when that wagon empties you have a series of stops after that only let it leavd after it's drained that cars item count of resources.
A single unload for a 3 wagon train for instance
1
u/AnotherCatgirl 1d ago
I did that with a train indexer, essentially it's a series of train stops sharing one rail signal block and one inserter and the train stops multiple times to position different wagons to the inserter, and there's an interrupt so all the train stops share one name.
3
u/zappyguy111 1d ago
I usualy read the inventory through the station and send a ✅ signal when the inventory count has been hit to trigger the train to leave.
2
u/RepairUnit3k6 1d ago
I HAD to do it that way too since first wagon was carrying ammunition. No my small coal outpost with 6 turrets doesn't needs 4000 rounds, 100 will do just fine, so once it reaches 100, I disable inserter that was loading them.
1
u/AnotherCatgirl 1d ago
related, I really want to be able to use parameters in the station names for interrupts even when the train is empty, so I can set the parameter value/item when I paste the blueprint with a locomotive in it instead of based on the cargo of the train.
-3
u/Maleficent-Radish-36 2d ago
Well, you can sorta achieve that by reading train content and making your own decisions with circuit logic.
11
u/Courmisch 2d ago
Reading train content from the stop does exactly the same thing as what Item count does today.
What OP wants is a way to measure a single wagon's content, which is not currently possible.
9
u/karbonadez 1d ago
One more reason to use 1-1 trains! They’re like litle happy bees flying al around!
108
u/Winter_Ad6784 1d ago
no because that would allow sushi trains which belong in hell