Page 1 of 1

Can we get a function to get the stacksize of an Item?

Posted: Fri Jan 19, 2024 6:29 pm
by Ugotu
TL;DR
The stacksize is a vital information in many Traindistribution solutions, but we still have to set it manually.

What ?
With the new combinators we will have the possibility to set blueprints so we don't have to setup our stations manually. When we now have some blueprint to calculate the amount of trains that we can fill we still need to either set the stacksize for each station, or calculate how much a full train will take.

This could be improved if we had a "get stacksize of Item" function.

iron ore * stacksize = 50
iron plates * stacksize =100
Low density structures * stacksize = 10
Why ?
With this we could automate this part of the station setup to blueprintitem * stacksize * 40 * traincars = items per full train.

I also used the stacksize in space exploration to calculate how many empty slots were left before shooting more stuff into orbit.

Re: Can we get a function to get the stacksize of an Item?

Posted: Fri Jan 19, 2024 6:43 pm
by Koub
I don't know if you have seen, but there will be an "S" unit meaning 1 stack. So you'll be able to set your blueprint variable to 40S of whatever item, and the blueprint will translate to 40 stacks of whatever item you've chosen.
Source : https://factorio.com/blog/post/fff-388
(search for smart number format)

Stack Size Indication

Posted: Sun Jan 21, 2024 3:18 am
by toprakkoyun
Hello everyone. I think when you hover over an item in the crafting menu, it should also indicate its stack size. I always circuit condition my stations and setting them up requires for me to know the stack size of an item. I memorized it all since I am doing this for a long time but when I do forget one it is annoying to just cannot look at it and need to search for it in wiki to learn. This change will help a lot of people especially new players since there are a lot of items in the game, even more if you play modded.

[Edit by Koub] : I merged this into another thread about getting stack sizes for logistic needs, both threads running in //.

Re: Can we get a function to get the stacksize of an Item?

Posted: Sun Jan 21, 2024 3:24 pm
by Illiander42
Koub wrote:
Fri Jan 19, 2024 6:43 pm
I don't know if you have seen, but there will be an "S" unit meaning 1 stack. So you'll be able to set your blueprint variable to 40S of whatever item, and the blueprint will translate to 40 stacks of whatever item you've chosen.
Source : https://factorio.com/blog/post/fff-388
(search for smart number format)
S for stack size isn't mentioned there.

I think you may be showing your 2.0 access.

Also, that doesn't let us do dynamic stuff like wiring a provider chest to request one stack of each recipie ingredient for a dynamically set assembler.

Re: Can we get a function to get the stacksize of an Item?

Posted: Sun Jan 21, 2024 4:57 pm
by Murklak
This can be done using the 2.0 preview mod, which is at https://mods.factorio.com/mod/pigo-selector-combinator. I use it to calculate the total volume of my trains, giving only my total inventory slots as a constant (40 * wagonCount). Give it a try.

Re: Can we get a function to get the stacksize of an Item?

Posted: Mon Jan 22, 2024 7:12 am
by Koub
Illiander42 wrote:
Sun Jan 21, 2024 3:24 pm
S for stack size isn't mentioned there.
Well you're right. I don't have any additional access to anything 2.0 related, I guess my brain just merged someone's assumption it would be 'S' with the part in the FFF saying there would be a way.
Illiander42 wrote:
Sun Jan 21, 2024 3:24 pm
Also, that doesn't let us do dynamic stuff like wiring a provider chest to request one stack of each recipie ingredient for a dynamically set assembler.
I think this will become possible. We're going to be able to :
1) read a crafting machine's current recipe's ingredients (https://factorio.com/blog/post/fff-394)
2) read in sequence the different signals with the selector combinator (https://factorio.com/blog/post/fff-384)
3) express numbers of items in stacks.

I guess that should make it possible to request multiples of stacks for each ingredient in a recipe.