How to check Multiple Integers

Hello! I want to check multiple variables with a single value. For ex, I have 10 variables. I wanna check if all the variables are of a specific value. What’s the node to do that?
== node only allows me to check for 2 Integer variables. I want to check 10 at once.

Are you trying to compare an array of variables to a single value, and return true if they’re all the same, and false if not?

In that case, your best move would be to create a function that loops through an array with a For Each node. At the start, set the return bool to true. Then compare each array entry to your goal value. If they’re the same, keep going. If not, break, and setting the return bool to false. On completed, return the bool.

Does that help?

Edit: Phrasing

1 Like

The Integer variables I’m trying to check are not related to each other at all nor are in any array. They are just simple individual Integer variables that I want to check have the value of say 0 or not. For ex, variables named A-J. I did a Get node for each of them. Lined them up vertically. Now I just want to check whether they all have value 0.

I don’t know of any node that compares an arbitrary amount of integers to some other value. You could create an array out of your integers, and then use the Compare Ints function:

If you create a Macro instead of a function, you can include the branch into that as well using exec outputs.

The only other option I see is to create a function that compares its input against whatever value, and plug every integer into one of those. If the other value is a constant, that will save you some space in your blueprint, but it won’t offer any other advantages imo.

1 Like