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.
Parametrized Blueprint variables - parameter stack size
Moderator: ickputzdirwech
Re: Parametrized Blueprint variables - parameter stack size
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.
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.
Re: Parametrized Blueprint variables - parameter stack size
You can do that. Just change your formula to 3*40*p0_s
Re: Parametrized Blueprint variables - parameter stack size
Yep, got to that part this morning, it works but I cant help but feel like runtime calculating a constant
Re: Parametrized Blueprint variables - parameter stack size
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).
Re: Parametrized Blueprint variables - parameter stack size
I'm using a dummy signal in a separate disabled logistics request group: 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 wrote: ↑Sat Nov 09, 2024 11:18 pmBut 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).
Re: Parametrized Blueprint variables - parameter stack size
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 guiLCStark wrote: ↑Sat Nov 09, 2024 11:49 pmI'm using a dummy signal in a separate disabled logistics request group:nova4x wrote: ↑Sat Nov 09, 2024 11:18 pmBut 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).
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.