How to handle parameterised blueprints when p0_s is invalid

Don't know how to use a machine? Looking for efficient setups? Stuck in a mission?
Doggfite
Manual Inserter
Manual Inserter
Posts: 3
Joined: Wed May 21, 2025 9:29 am
Contact:

How to handle parameterised blueprints when p0_s is invalid

Post by Doggfite »

I have a set of train station blueprints in working on right now and I'm trying to make them work for any input item. The wall I'm currently hitting is that I have a value set up as basically a test for an item with non stack size, IE fluids, and it has an initialised value of -1 and then a variable name "flu" and a formula of "p0_s * 0"
This way, if I returns 0, I know it's a stacked items and the station requires calculations for stacks or if the formula fails it returns the initial value of -1 and it's a fluid.

The wall I am hitting is that I need to use this value in other formulas, but when I call the variable name it seems to try to run the function in each one instead of returning the value of the variable which is -1 after that line has been evaluated.
If that makes sense.

Anyway, you can view my blueprint here if you would like to see, when you select a stacking item the train station will display its enable condition as signal E >= # where E is the number of stacks the station requires to be full and the # is a full train load of stacks of the item.
If you attempt it with a fluid, it will display the negative initialized values as any formula calling variable "flu" breaks.

Post Reply

Return to “Gameplay Help”