How to check if all the elements in an array are true instead of just one

I am trying to make a simple crafting widget. The recipe for the craftable item is stored in an array as item name and quantity. For example, to make, let’s say, a sword; you would need 1 wood and 1 stone in your inventory. For some reason, the boolean only checks the required amount for the first element. So as long as I have at least 1 wood I can still craft the sword even though it requires 1 wood and 1 stone. However if i only have 1 stone and no wood I am not able to craft it. How would I check if all the elements in the array meet the requirement and not just the first element in the array?

Here is a picture of some of the blueprints. Thanks in advance and let me know if there is any more info I should provide.

How about this way?

3 Likes

Or

4 Likes

thanks for the help guys. I shouldve showed the entire BP, but i solved the issue by removing a certain connection to the break loop. how silly of me

1 Like

Great to know you’ve figured that out. I would recommend using map variables for the recipes, having keys as recipes and values as structs of ingredients.
Please check this thread as solved so other users can learn from it.

1 Like

I’ve been scratching my head for a day … thank you for this