Download

[need help] Compare Wildcards

Hi there,

I tried to create a simple Macro, that Inputs a Wildcard Variable, and a CompareTo Wildcard variable.

Now i want to Compare those two Wildcards, if they are Equal, but can´t find a Node to check for that…

So…:
How can i compare two Wildcards?

For visual help what i want:
plc67g8z.jpg

has anyone an answer?

You can’t, because you don’t know what each of the two types will be. It’s the same thing as trying to compare a boolean with a vector, they can’t be compared because it’s not logical.

Okay…
But… Instead, is there a way to check if the Inout Type is an object, float, int, bool…etc?

so i can split up :confused:

Is this problem for convenience or a design problem that could be achieved in a different way?

The wildcard is a generic type. If you input an object, every wildcard will be an object at runtime(or even at compiletime).
Therefore you would be checking “if Object is an Object”. This doesn’t make sense.
For custom types, you can use interfaces.
For primitve types like int, vector,etc. and object types you should implement a macro for every type.

The idea was:

if i input two objects to my wildcards, or two ints, or floats, or vectors…etc

It would be nice to get a:
IsWildcard.typeOf == Object
IsWildcard.typeOf == Int32
IsWildcard.typeOf == float
… etc

And then go on with the specified input type to compare…

Cause… hell… One Macro of the same graph for EVERY Variable and Input Type? So… that would be 100+ Macros ._.

Why don’t you use the already implemented equals operator for basic types?
What exactly is your use case for this macro?

I want a TUNNEL, that Input Types, and Outputs them only:
A) when the Exec is called
B) if they are NOT equal

The basic equal operators can´t be started via exec or any others…

As second, i don´t want to have hundrets of nodes in my Graph, when i can use macros for that…

For better understanding…:

THIS, should be the tunnel macro:
09ba16be518fb7f1c910485a6d4aefb54619c489.jpeg
The Macro should compare the two Inputs (Object, Int, float, Vector, bool are possible), and Output One of them, based on the branch result.

BUT…
Cause the “equal” node is fixed to a single variable type only… it gives warnings/errors when trying to compile it, when twei Ints are attached… or two vectors…
The Warning is:
“Int/Vector/Float/Bool… is not compatible with Object reference”.

So, why i don´t use the “equal” nodes in my event graph? cause of this:
9dd5e754746d84c7d5c8dd1ff6359830b0db32cf.jpeg

Hurray - When using Input>equal>branch>outbut on every of this Variables… The Graph Tree would have a few hundret nodes, just for comparing the values… That´s why i want to have a Macro, that Inputs tweo wildcards, COMPARES THE WILDCARDS, and Outputs the result (as shown on screen 1).

Yes you can. I found a solution to this.

https://answers.unrealengine.com/questions/482017/how-to-compare-two-wildcards-in-blueprints.html#answer-606250

Regards.