Hi,
I am trying to use command line to get options from it. So, for this, I have instantiated the GameModeBase class and re-defined InitGame in there as following:
void AMyGameModeBase::InitGame(const FString& MapName, const FString& Options, FString& ErrorMessage)
{
FString file_path;
if (FParse::Value(FCommandLine::Get(), TEXT("file="), file_path))
{
UE_LOG(LogGameMode, Warning, TEXT("File path detected and it is %s"), *file_path);
}
else
{
UE_LOG(LogGameMode, Warning, TEXT("File path not detected!"));
}
Super::InitGame(MapName, Options, ErrorMessage);
}
When I launched the executable as following:
myExe.sh MapName -file=myfile.txt (I am on Linux)
I do not see anything on the log.
I did it with Blueprint also, I have created a GameModeBase Blueprint and I tried to capture the Command line like so:
But still cannot see anything on the log when starting the executable.
Any help on that?