How to compare two wildcards in blueprints

I’m trying to do a generic macro to detect if a variable has changed.
This node if generic would make my life much easier and even help with performance.
It is already working with an integer, but I wanted to use a wildcard so I could detect changes in any type of variable.

that’s ok if I can’t compare wildcards, but there’s any way to know which type of variable the wildcard is so I can at least use a branch or something like that?

Hi Gus, I just ran into the same problem. Could you sort it out?

No, you can’t

Yes You Can !
All you need is to be a little tricky.
Here take a look at my sample macro library.

139859-inputs.png

139875-equalnode.png

Just follow my steps;

  1. Create a macro library or just add a macro to an existing one.
  2. Follow the second picture and set input and output pins.
  3. Make an array of one of the input elements. By doing this, you will create an array that has only one element in it (Element 0).
  4. Now use the ‘Find’ node to see if the second element (Element 1) can be found inside the array or not. Since the array has only one element, if the find node can’t fine the second element inside the array, it means that the first element is not equal to the second element, and that is exactly the function we were looking for.
  5. use a not equal node to check it out. The find node prints -1 if couldn’t find the element inside the array (here the elements are not equal). So if the ‘Find’ node is not equal to -1, means that the second element could be found inside the array which means the two elements are equal.

Regards.

5 Likes

Thanks, super useful.

you’re welcome

Thank you!

Can this no longer be done in 5.5?