How do I use PrepareMapChange/CommitMapChange?

Also, if you want a nice UI too selelect your levels instead of write them as strings you can use:

TAssetPtr<UWorld> LevelAsset;

And get the package name like this:

FString LevelPath = LevelAsset.GetLongPackageName();

And add it to the levels array:

Levels.Add(*LevelPath);