Page 1 of 1

Stack Size Virtual Value for Signals

Posted: Sun Sep 27, 2020 5:41 pm
by Gloweye
The idea is to have a special "Stack Size Const" in the Arithmetic Operator. When applied to any signal, it will have the value of the signal's stacksize. This would be a unique thing much like Each/Anything/Everything is a unique thing as input.

This would make it easier to work with some things. For example, I use Logistic Train Networks, so I figure out how many wagon slots I can fill, but right now I if I want to calculate #max trains for a stop, I have to divide by stack size x 40, and therefore have to set it manually on each new station. After the Spidertron (and a few mods), this is the only reason I have to go to new stations.

Example:
Arithmatic Combinator:
(Each) / (Stacksize)
Output: (Each)

Given the following input signals:
250 Copper Plates
300 Coal
190 Batteries
The Virtual Value magnitude will be:
Copper Plate: 100
Coal: 50
Batteries: 200
Which makes for the outputs:
Copper Plate: 2 (250 / 100 -> 2)
Coal: 6 (300 / 50 -> 6)
Batteries: 0 (190 / 200 -> 0)

Re: Stack Size Virtual Value for Signals

Posted: Sun Sep 27, 2020 5:56 pm
by Sad_Brother
Gloweye wrote:
Sun Sep 27, 2020 5:41 pm
...
if I want to calculate #max trains for a stop, I have to divide by stack size x 40, and therefore have to set it manually on each new station. After the Spidertron (and a few mods), this is the only reason I have to go to new stations.
I am not against your suggestion. But...
Can you set manually something like Constant or Arithmetic Combinator and copy it to Faraway station?

Re: Stack Size Virtual Value for Signals

Posted: Sun Sep 27, 2020 6:14 pm
by Gloweye
Well, I could, but that's basically 4 more blueprints to clutter up my library.

Re: Stack Size Virtual Value for Signals

Posted: Sun Sep 27, 2020 7:12 pm
by robot256
There is at least one mod that includes a stacksize combinator already: https://mods.factorio.com/mod/utility-combinators-plus

Re: Stack Size Virtual Value for Signals

Posted: Sun Sep 27, 2020 7:17 pm
by Sad_Brother
This mod not as good as this suggestion.

Re: Stack Size Virtual Value for Signals

Posted: Fri Nov 20, 2020 6:11 pm
by whitecold
robot256 wrote:
Sun Sep 27, 2020 7:12 pm
There is at least one mod that includes a stacksize combinator already: https://mods.factorio.com/mod/utility-combinators-plus
The mod only provides the stack sizes in a constant combinator. You'll need to extract the right signal, convert it into an appropriate constant and then multiply/divide your value by it.
I still don't see how to properly multiplex this assuming you have an arbitrary number of items and want to convert them to stack sizes or vice versa.

Re: Stack Size Virtual Value for Signals

Posted: Sat Nov 21, 2020 2:50 am
by NotRexButCaesar
Yes please. There is no currently no way to do this without specifically setting a constant combinator for every item in your save.

Re: Stack Size Virtual Value for Signals

Posted: Sat Nov 21, 2020 4:07 pm
by robot256
whitecold wrote:
Fri Nov 20, 2020 6:11 pm
robot256 wrote:
Sun Sep 27, 2020 7:12 pm
There is at least one mod that includes a stacksize combinator already: https://mods.factorio.com/mod/utility-combinators-plus
The mod only provides the stack sizes in a constant combinator. You'll need to extract the right signal, convert it into an appropriate constant and then multiply/divide your value by it.
I still don't see how to properly multiplex this assuming you have an arbitrary number of items and want to convert them to stack sizes or vice versa.
Right, the Stack Size combinator only prevents you from having to remember stack sizes or change a constant combinator when you install mods that change them.

I forgot once again that stock combinators can't do pairwise multiplication. The most elegant solution I've seen is to do it iteratively: viewtopic.php?f=5&t=29706

Or you have to use a modded combinator. Advanced Combinator can probably do it, Lua Combinator definitely can.

So I see now the appeal of adding the ability to multiply/divide by stack sizes in one operation with vanilla. I get how this is a special case in the game, but pairwise multiplication would be incredibly useful in other cases so I wonder if they would add it just for this one.

Re: Stack Size Virtual Value for Signals

Posted: Sat Dec 19, 2020 4:44 am
by NotRexButCaesar
Please do some sort of thing, be it the virtual signal or pairwise multiplication