So i’ve recently started working on a lobby mechanic. And i searched for a way to dynamically start or close servers. And one function i came across was the “FPlatformProcess::CreateProc()” function to obviously start my server instances. It only works when I call it in c++ in the begin play function but when i call it as a BP script it returns this error:
“LogWindows: Warning: CreateProc failed: The system cannot find the file specified. (0x00000002)”
UFUNCTION looks like this:
UFUNCTION(BlueprintCallable, Category = "Function")
void ExecuteProgramm();
For my location i escaped the \ like this \ so i have: “C:\Users\MyName\Programms\ServerFolder\Server.exe”
void AServerCreator::ExecuteProgramm()
{
FPlatformProcess::CreateProc(TEXT("C:\\Users\\MyName\\Programms\\ServerFolder\\Server.exe"), nullptr, true, false, false, nullptr, 0, nullptr, nullptr);
return;
UE_LOG(LogTemp, Warning, TEXT("Code should have been executed hopefully"));
}
I used the log to determine if it was even working as im 103% of a noob in c++
Thanks for the help
magerbeton
Eddit1:
I tested it a second time now to put the FPlatformProcess::CreateProc() in the BeginPlay Function but now it allways returns the error above