Parametrized Blueprint variables - parameter stack size

Post your ideas and suggestions how to improve the game.

Moderator: ickputzdirwech

slawo
Manual Inserter
Manual Inserter
Posts: 4
Joined: Thu Oct 12, 2023 5:33 pm
Contact:

Parametrized Blueprint variables - parameter stack size

Post by slawo »

I'm playing around with the new changes, brilliant stuff by the way, and one thing I'm kind of missing is the ability to infer item stack sizes from parameters to further simplify blueprints.

Like in this example if I could set X to be 3*40*p0_stackSize based on what item the trains station is responsible for, then the 3rd kinda redundant parameter wouldn't need to be set.
10-25-2024, 20-47-35.png
10-25-2024, 20-47-35.png (76.97 KiB) Viewed 17535 times
sarge945
Fast Inserter
Fast Inserter
Posts: 100
Joined: Wed Apr 26, 2023 9:45 am
Contact:

Re: Parametrized Blueprint variables - parameter stack size

Post by sarge945 »

Use a selector combinator.

You can get the stack size of your inputs there.

I was able to make a completely generic train loading station that automatically disables itself until it's full, with the only parameter being the resource type. You can even drag it, to use it for as many wagons as you want. All it needs is a selector combinator to get the stack size of whatever was passed to it, and an arithmetic combinator to put it all together.
malihulya
Manual Inserter
Manual Inserter
Posts: 1
Joined: Sat Oct 26, 2024 8:41 pm
Contact:

Re: Parametrized Blueprint variables - parameter stack size

Post by malihulya »

You can do that. Just change your formula to 3*40*p0_s
10-26-2024, 23-45-22.png
10-26-2024, 23-45-22.png (185.83 KiB) Viewed 17453 times
slawo
Manual Inserter
Manual Inserter
Posts: 4
Joined: Thu Oct 12, 2023 5:33 pm
Contact:

Re: Parametrized Blueprint variables - parameter stack size

Post by slawo »

Yep, got to that part this morning, it works but I cant help but feel like runtime calculating a constant :D
nova4x
Inserter
Inserter
Posts: 28
Joined: Fri Jun 21, 2024 5:09 pm
Contact:

Re: Parametrized Blueprint variables - parameter stack size

Post by nova4x »

malihulya wrote: Sat Oct 26, 2024 8:45 pm You can do that. Just change your formula to 3*40*p0_s

10-26-2024, 23-45-22.png
But you cannot input a generic stack size, you have stack_size * 5. You can't change that 5 without editing the blueprint itself which defeats the point of parameters. This could be solved via the implementation of another feature (add a button to add a new blueprint parameter variable).
User avatar
LCStark
Fast Inserter
Fast Inserter
Posts: 205
Joined: Thu Jan 28, 2021 5:04 pm
Contact:

Re: Parametrized Blueprint variables - parameter stack size

Post by LCStark »

nova4x wrote: Sat Nov 09, 2024 11:18 pm
malihulya wrote: Sat Oct 26, 2024 8:45 pm You can do that. Just change your formula to 3*40*p0_s

10-26-2024, 23-45-22.png
But you cannot input a generic stack size, you have stack_size * 5. You can't change that 5 without editing the blueprint itself which defeats the point of parameters. This could be solved via the implementation of another feature (add a button to add a new blueprint parameter variable).
I'm using a dummy signal in a separate disabled logistics request group:
11-10-2024, 00-48-59.png
11-10-2024, 00-48-59.png (484.04 KiB) Viewed 16501 times
11-10-2024, 00-49-15.png
11-10-2024, 00-49-15.png (64.61 KiB) Viewed 16501 times
But yeah, it would be much more convenient if we could just add a temp variable without having to do that, especially if your BP doesn't use logistic groups. Adding a combinator just to have a temp variable in parameters doesn't feel great.
nova4x
Inserter
Inserter
Posts: 28
Joined: Fri Jun 21, 2024 5:09 pm
Contact:

Re: Parametrized Blueprint variables - parameter stack size

Post by nova4x »

LCStark wrote: Sat Nov 09, 2024 11:49 pm
nova4x wrote: Sat Nov 09, 2024 11:18 pm
malihulya wrote: Sat Oct 26, 2024 8:45 pm You can do that. Just change your formula to 3*40*p0_s

10-26-2024, 23-45-22.png
But you cannot input a generic stack size, you have stack_size * 5. You can't change that 5 without editing the blueprint itself which defeats the point of parameters. This could be solved via the implementation of another feature (add a button to add a new blueprint parameter variable).
I'm using a dummy signal in a separate disabled logistics request group:
11-10-2024, 00-48-59.png

11-10-2024, 00-49-15.png

But yeah, it would be much more convenient if we could just add a temp variable without having to do that, especially if your BP doesn't use logistic groups. Adding a combinator just to have a temp variable in parameters doesn't feel great.
Yeah I've done this as well in cases where I need it. I find the concept of needing a constant combinator as part of the print to create a dummy signal to be kinda silly. It really should be a part of the parameterization gui
Sapphire
Manual Inserter
Manual Inserter
Posts: 3
Joined: Mon Jun 27, 2016 10:23 pm
Contact:

Re: Parametrized Blueprint variables - parameter stack size

Post by Sapphire »

Yes please I would love it if there was a button to add a 'dummy' parameter or variable that I could set while placing the print.

However, I somehow managed to do this before: (This sets a limit on the output inserter based on the amount of item in the logistics network)
test.png
test.png (142.76 KiB) Viewed 14167 times
test2.png
test2.png (13.59 KiB) Viewed 14167 times


(You can see no pop-up on mouse hover telling me what it relates to)
I set it up like the earlier post mentioned using a constant combinator, but then I removed it from the BP in editing it, leaving just this value with no attached combinator. I can't seem to replicate it though, as now I'm trying to do something similar for setting the number of cars a train station expects.

If anyone else has been able to replicate this behavior, please tell me how you did it.
zwickau
Burner Inserter
Burner Inserter
Posts: 7
Joined: Fri May 01, 2026 9:39 pm
Contact:

Re: Parametrized Blueprint variables - parameter stack size

Post by zwickau »

Sapphire wrote: Thu Dec 19, 2024 1:51 am Yes please I would love it if there was a button to add a 'dummy' parameter or variable that I could set while placing the print.

However, I somehow managed to do this before: (This sets a limit on the output inserter based on the amount of item in the logistics network)
test.png
test2.png


(You can see no pop-up on mouse hover telling me what it relates to)
I set it up like the earlier post mentioned using a constant combinator, but then I removed it from the BP in editing it, leaving just this value with no attached combinator. I can't seem to replicate it though, as now I'm trying to do something similar for setting the number of cars a train station expects.

If anyone else has been able to replicate this behavior, please tell me how you did it.
Wow, sorry to revive a crazy old post, but I've been having the problem described here and Google turned up this thread. The solution posted above by @Sapphire still works!

That is: if you want dummy variables / dummy parameters to use in your blueprints, simply create them in a constant combinator, include that constant combinator in your selection when creating the blueprint, convert its values to parameters in the parametrisation window, and then literally just remove it from the finished blueprint. Et voilà! Dummy variables without a dummy combinator!

To be really specific on what I mean by "dummy variable" and why I'm happy to start using this: there are certain values that are relevant to my blueprints, but may not show up directly. Take, for instance, a timer circuit whose time length, t (the amount of time it runs for) is configurable. The value that actually gets used in the combinator, though, is t-1. Before, every time I pasted my timer I'd have to remember to decrement by 1. Now I just use a dummy variable! This sounds trivial, but over many complicated blueprints, being able to forget about the little exceptions is neat.

I'll get a snippet of the parameter window. The first variable (with value of 60) is my dummy value, and appears nowhere in the blueprint.
Screenshot 2026-05-08 162728.png
Screenshot 2026-05-08 162728.png (178.4 KiB) Viewed 730 times
Post Reply

Return to “Ideas and Suggestions”