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 2554 times
sarge945
Long Handed Inserter
Long Handed Inserter
Posts: 92
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 2472 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
Burner Inserter
Burner Inserter
Posts: 18
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: 192
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 1520 times
11-10-2024, 00-49-15.png
11-10-2024, 00-49-15.png (64.61 KiB) Viewed 1520 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
Burner Inserter
Burner Inserter
Posts: 18
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
Post Reply

Return to “Ideas and Suggestions”