What is the correct format for FString Options when using UGameplayStatics::OpenLevel

I’m trying to use the UGameplayStatics::OpenLevel method:

FString levelURL = FString(OpenLevelOptionsKeyConstants::LevelAlias::Key + "=" + LevelAlias.ToString());
// Open the base level and pass through the requested level to the GameMode (The game) to be digested by that class instead
UGameplayStatics::OpenLevel(this, StartLevelGameMode->BaseLevelName, true, levelURL);

Here is the LevelAlias::Key constant:

const FString OpenLevelOptionsKeyConstants::LevelAlias::Key = FString("LevelAlias");

Essentially, the Options string ends up being: "LevelAlias=LevelFileName"

And yet I get the following error:

There seems to be an absence of documentation of the FString Options format.

Source code of GameplayStatics.cpp::OpenLevel:



What is the format for Options when using UGameplayStatics::OpenLevel ?

I’m not sure, but if you create the nodes in BP, then go to file>Developer>CreateC++ class or something along them lines, it will spit out a pretty nasty c++ version of your BP. Look for ‘OpenLevel’ in the newly created .h file and it will have the syntax.

Probably the harder way but if Docs cant help or help here is too distant, this method is pretty handy!

Regarding the None error. That was because i’m an idiot and didn’t save my changes to my blueprint that has information on the map loaded. I repopulated it with a name and now the level loads correctly