Use Syntax to drive Boolean in Level BluePrint

I am following up from a previous post that did not get a response. Internal Utility Function To Report Back Boolean in Blueprints - Blueprint - Epic Developer Community Forums

I figured I would explain it differently under the hopes it might be more clear and I get an answer.

At the core of it, I am looking for the method of using the Syntax found here:(FPaths::FileExists | Unreal Engine Documentation) to report back a Boolean back back to my level Blueprint.

Any guidance would be greatly appreciated.

Thank you in advance.

I’m sorry to say your question is rather vague. I saw your earlier thread(which you have linked above), but I am still not clear as to what you are trying to achieve.

Could you please explain exactly what you want to achieve and what difficulty are you facing?

Is this what you want:
Call FileExists from Blueprint and get True/False depending on the result?

Assuming that you want to call FileExists or a similar C++ function from your Blueprint,

This is what you should do when you want to expose a built-in function which is not available in BP to blueprint:
Create a new C++ class extended from UBlueprintFunctionLibrary. Declare a wrapper function that accepts the same parameters as the function you want to expose.
So in this case:

UFUNCTION(BlueprintPure, Category="Wrapper")
public static bool MyFileExists(const FString & InPath)

Later you define this function something like this:

bool MyFileExists(const FString & InPath) {
  return FPaths::FileExists(InPath);
}

Now once you compile the code, your custom function MyFileExists will be available in all your blueprints (you might want to disable ‘ContextSensitive’).

This should be useful:

}

Thanks Mindfane!

This is a push in the right direction.

I had not done any C++ work in UE4 in the past. So for anyone reading this thread that is in my same shoes. The video below was helpful and the free version of Visual Studio is below that.

I tried creating the C++ class as directed, but I got the following error:

1>     Creating library C:\Users\Jack\Documents\Unreal Projects\Princess_Castle\Intermediate\Build\Win64\FPS_StartEditor\Development\UE4Editor-FPS_Start-5958.lib and object C:\Users\Jack\Documents\Unreal Projects\Princess_Castle\Intermediate\Build\Win64\FPS_StartEditor\Development\UE4Editor-FPS_Start-5958.exp
1>FPS_Start.generated.cpp.obj : error LNK2019: unresolved external symbol "public: __cdecl UCheckIfFileExhists::UCheckIfFileExhists(class FObjectInitializer const &)" (??0UCheckIfFileExhists@@QEAA@AEBVFObjectInitializer@@@Z) referenced in function "void __cdecl InternalConstructor<class UCheckIfFileExhists>(class FObjectInitializer const &)" (??$InternalConstructor@VUCheckIfFileExhists@@@@YAXAEBVFObjectInitializer@@@Z)
1>FPS_Start.generated.cpp.obj : error LNK2019: unresolved external symbol "public: static bool __cdecl UCheckIfFileExhists::MyFileExists(class FString const &)" (?MyFileExists@UCheckIfFileExhists@@SA_NAEBVFString@@@Z) referenced in function "public: void __cdecl UCheckIfFileExhists::execMyFileExists(struct FFrame &,void * const)" (?execMyFileExists@UCheckIfFileExhists@@QEAAXAEAUFFrame@@QEAX@Z)
1>C:\Users\Jack\Documents\Unreal Projects\Princess_Castle\Binaries\Win64\UE4Editor-FPS_Start-5958.dll : fatal error LNK1120: 2 unresolved externals

Below is the code I am using in this new class:

CheckIfFileExhists.h CODE:

#pragma once

#include "Kismet/BlueprintFunctionLibrary.h"
#include "CheckIfFileExhists.generated.h"

UCLASS()
class UCheckIfFileExhists : public UBlueprintFunctionLibrary

{
	GENERATED_UCLASS_BODY()
		UFUNCTION(BlueprintCallable, Category = "Wrapper")
		static bool MyFileExists(const FString & InPath);
	
};

CheckIfFileExhists.ccp CODE:

#include "FPS_Start.h"
#include "CheckIfFileExhists.h"

bool MyFileExists(const FString & InPath) {
return FPaths::FileExists(InPath);
}

This is the last piece in a 10 month project, and I really appreciate your help! I will be happy to throw you a couple $$ on PayPal for your help in getting this to work.

Thanks again!

Looks like it is complainig about the constructor. So create a constructor for your new class (in Cpp file). This should be enough:

UCheckIfFileExhists::UCheckIfFileExhists(const FObjectInitializer & ObjectInitializer)
	: Super(PCIP)
{
 
}

–I am using an older version of the engine, so it is possible that the above code might not work for you.

BTW replace BlueprintCallable with BlueprintPure. This function has no side effects (ie it does not affect state or data). Such functions should be BlueprintPure.

PS:
Answerhub is a place where the community help each other. And any help is FREE.

However if you want to hire someone to help you with something, you should add a request in the ‘Got Skills/Looking For Talent’ section in the forums.