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 5086 times
sarge945
Long Handed Inserter
Long Handed Inserter
Posts: 94
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 5004 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: 26
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: 197
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 4052 times
11-10-2024, 00-49-15.png
11-10-2024, 00-49-15.png (64.61 KiB) Viewed 4052 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: 26
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
Exuta
Manual Inserter
Manual Inserter
Posts: 1
Joined: Mon Jun 27, 2016 10:23 pm
Contact:

Re: Parametrized Blueprint variables - parameter stack size

Post by Exuta »

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 1718 times
test2.png
test2.png (13.59 KiB) Viewed 1718 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.
Post Reply

Return to “Ideas and Suggestions”