Add user variable for output stacks in parametrised BP?

Don't know how to use a machine? Looking for efficient setups? Stuck in a mission?
User avatar
CheeseMcBurger
Long Handed Inserter
Long Handed Inserter
Posts: 92
Joined: Sun May 19, 2019 9:57 pm
Contact:

Add user variable for output stacks in parametrised BP?

Post by CheeseMcBurger »

I have the following BP
11-16-2024, 14-18-44.png
11-16-2024, 14-18-44.png (518.72 KiB) Viewed 185 times
The Inserter that feeds into the storage chest should insert X stacks of the produced item.

My problem is that I don't know how I can ask the player to provide a number. And then I need to use that number and multiply it with the stack sice of {0}

11-16-2024, 14-19-17.png
11-16-2024, 14-19-17.png (320.27 KiB) Viewed 185 times
User avatar
PssX
Inserter
Inserter
Posts: 24
Joined: Tue Mar 01, 2016 9:00 am
Contact:

Re: Add user variable for output stacks in parametrised BP?

Post by PssX »

I came up with this solution:
  1. Add something not used in your blueprint, like a Constant combinator, with some unused signal, like "A".
  2. Set it to some not used value, like "A = -1".
  3. In parametrized BP window place checkmark for "Parameter" for this "-1" and set its "Variable" to "n" (or any other not used).
  4. And for your output set "Formula" to "p0_s * n".
  5. Place blueprint, set parameters.
  6. Remove Constant combinator (ghost or already built if your bots are fast).
If you set signal or signal value to be the same as some other signal or value in this blueprint, it will merge into one. As described here: 117000. I disagree with this behavior, but Dev said it is as it is. Oh, well...

Also here is related suggestion to you question: 116330
User avatar
LCStark
Fast Inserter
Fast Inserter
Posts: 192
Joined: Thu Jan 28, 2021 5:04 pm
Contact:

Re: Add user variable for output stacks in parametrised BP?

Post by LCStark »

Yeah, that's probably the easiest way to do it. If you're already using a requester chest, instead of adding a constant combinator you can add another logistic group to the requester chest to use as a dummy parameter and just disable it, though constant combinator will give you a bigger selection of signals than just the item ones.
Post Reply

Return to “Gameplay Help”