Install Steam
login
|
language
简体中文 (Simplified Chinese)
繁體中文 (Traditional Chinese)
日本語 (Japanese)
한국어 (Korean)
ไทย (Thai)
Български (Bulgarian)
Čeština (Czech)
Dansk (Danish)
Deutsch (German)
Español - España (Spanish - Spain)
Español - Latinoamérica (Spanish - Latin America)
Ελληνικά (Greek)
Français (French)
Italiano (Italian)
Bahasa Indonesia (Indonesian)
Magyar (Hungarian)
Nederlands (Dutch)
Norsk (Norwegian)
Polski (Polish)
Português (Portuguese - Portugal)
Português - Brasil (Portuguese - Brazil)
Română (Romanian)
Русский (Russian)
Suomi (Finnish)
Svenska (Swedish)
Türkçe (Turkish)
Tiếng Việt (Vietnamese)
Українська (Ukrainian)
Report a translation problem
I think it would always get rounded down, so account for that in the result. A great opportunity to calculate modulo if you're fancy and want to detect an incomplete stack.
Is that it? Just stick it through the new combinator thing and I get a stack total? So 200 iron ore will give the same output as 400 iron plates?
No. The new combinator spits out the stack size of items. To get to count number of stacks (the question in your OP), you need a bit of extra math, and that's what I described.
For a 200 iron ore input, the new combinator will spit out 50. For a 2 iron ore input, it'll also spit out 50. 400 iron plates, it'll spit out 100. A billion plates, also 100. The size of a single full stack of those items.
What can do for future use though, is to make this setup into a parametrized blueprint and turn that value into a parameter. Then you'll get a popup to confirm or change the value everytime you plop down that blueprint.
The problem I'm trying to solve is that I want the priority number of stations with different amounts of loading/unloading chests to mean the same thing. A 3-wagon station that's half full needs to have the same priority number as a 4-wagon station that's half full despite there being a difference of 7,200 items between the two.
So you've helped me figure out stack sizes but now I'm trying to figure out how to count chests or the slots within a chest (and divide that number by 24).
That is possible. You can't really count the chests based on signals, unless you know they are full or if you did put 1 landmine (or whatever random item) in each chest when you built the stations to make it possible to count the chests.
But it does not matter, and here's what I'd do.
Pick a station.
Get the items total, by connecting all chests.
Divide that by the stack size of the item, as given by a selector combinator.
Then divide that by the number of chests at the station.
Express the result as a "P" signal, feed that to the train stop, that will set its priority based on it.
That's it. "P" is how many stacks worth you have per chest, on average, in the buffer. The closer the buffer is to its full capacity, the higher the priority.
When you blueprint that, include the combinators and the train stop in that blueprint, don't include the station's name in the blueprint, and don't forget to make the # of chests a parameter. When you'll use that blueprint, you'll have to specify how many chests there are at this station, and the related combinator will use that to make its division.
This works as long as ALL stations use chests that are the same size, so to speak. So only wooden chest, or only iron chest, or all logistics and/or steel chests.
I'm trying to learn how to count the number of empty chests at a station through the game, through combinators or whatever, rather than trying count it like Sesame Street and enter the total manually every time I have to place a station down.
- Use any resource icon/signal, but always the same
- Use 16 everywhere you use chest size for calculations
- Use 18 everywhere you use number of chests
- When you need the number of slots of the whole storage, provide that with an arithmetic combinator (16 * 18 = some signal) plugged into the input of that particular operation
- Use blueprint parameters to turn the resource icon and "16" and "18" into parameters, label them accordingly
You now have a BP that basically asks you "Which cargo, which chest size and how many of them?" when you place it. That's probably the easiest way to get one variable BP for this, since you cannnot directly read what you want.As for priority, this is what I'm using:
- content of all chests divided by stacksize of the cargo item
- multiply with 255
- divide by total number of chest slots
For drop off stations, add on:- subtract 255
- multiply with -1
Sure it's extra steps but it uses the whole range of 0-255 for every station and inverts priority for dropoffs.We just need a way to confirm that the storage is 100% full. I can't check ingame right now, is there a way to read inserter activity? Like, if inserter carries something but is inactive, the chest gotta be full ? Or if belt infront of the inserter has items on it, I think they alwys pick stuff up but not sure.
I still feel like this overcomplicates things so much, just remember the chest sizes or read them in the tooltip and count the amount you're placing ;)
As I said previously. Unless you prepared for that, you can't do it directly.
But if you happen to have dropped a landmine in each chest when building the station just "by accident", then you can do it.
Or be creative. Read what the inserters are holding. Divide that by their max capacity. The result is the number of chests you have, when they are all moving cargo. Store that in a memory cell or something.
If counting 16 chests is too much work for you, that's fine. But it's up to you to make your laziness work. The good news is, this is Factorio. When asking "can it be done?", the answer is almost always yes. If you one day want to be a combinator expert, maybe for now you should count chests. Then take 20 minute or 2 months to think about how you could count chests with logic circuits.
That'll be it for me. Good luck.