*.obj file corresponds to *.cpp file. If it says that Whatever.obj contains another definition, you can check Whatever.cpp to which *.obj file corresponds. You should’ve known that already.
No. In original example the name of the type was “Type2”. Literally.
C++ identifier (that can be used to name types, functiosn, namespaces, etc) can contain mix of letters, numbers and underscore characters, as long as it is doesn’t start with a number and doesn’t match language keyword.
Each blueprint node corresponds to some C++ code. You can debug that code. You can also debug entire engine.
o_O
I have no idea how this could possibly be true.
If you’re running non-debug and non-development configuration, compiler may remove the line away, because result isn’t used anywhere.
So I wasted 15 minutes of my time and ran a test.
*.h:
USTRUCT(BlueprintType)
struct FTestStruct{
GENERATED_USTRUCT_BODY()
UPROPERTY(EditAnywhere, BlueprintReadWrite)
FName testName;
UPROPERTY(EditAnywhere, BlueprintReadWrite)
int32 testInt = 0;
};
inline bool operator==(const FTestStruct &arg1, const FTestStruct &arg2){
return (arg1.testName == arg2.testName) && (arg1.testInt == arg2.testInt);
}
UCLASS()
class MYGAME_API UTestStructLib: public UBlueprintFunctionLibrary{
GENERATED_BODY()
public:
UFUNCTION(BlueprintPure, meta=(DisplayName = "Equal Test Struct", CompactNodeTitle = "==", Keywords = "== equal"), Category="Math")
static bool EqualEqual_TestStructTestStruct(const FTestStruct &arg1, const FTestStruct &arg2);
};
*.cpp:
bool UTestStructLib::EqualEqual_TestStructTestStruct(const FTestStruct &arg1, const FTestStruct &arg2){
return arg1 == arg2;
}
The code is within “game engine” portion of code, because there was no point in putting that into separate plugin.
I can confirm that this works just fine.
First, operator== is not automatically exposed to the blueprints. You need to make a binding to ufunction. Error most likely happens in that binding.
Recheck your binding code and check if both values are plugged in. As far as I can tell, blueprint shouldn’t even compile unless both input nodes are plugged in.