Please Help: How to load a map from a Pak file?

I am trying to load a map from a Pak file in UE 4.10. I’ve looked over several of the AnswerHubs and the code and process that I use are based on the information I found there but I’m still not getting any love.

First I’ve created the pak file like so:

  • Created a new TopDownTemplate project and deleted everything but the map and geometry.
  • Built the project with the “For Distribution” flag set.
  • Ran the UnrealPak utility on the cooked map to create a new Pak file (MyPak.pak).
  • This is the pak that I will try to load.
  • Note that I’ve also just tried using the resulting pak from the build and still no dice.

Second I load the pak in my main application like so:

  • Package the project for Windows 64
  • Copy the MyPak file from above to the Paks folder of this packaged build.
  • On some keypress I call the following code from PlayerController


if (FCoreDelegates::OnMountPak.IsBound()) 
    {
        UE_LOG(LogTemp, Warning, TEXT("ARPGPlayerControllerBase::OnMountPak.IsBound == TRUE"));

        const FString PakFilPath = FPaths::GameContentDir() + TEXT("Paks/MyPak.pak");
        if (FCoreDelegates::OnMountPak.Execute(PakFilPath, 0))
        {
            UE_LOG(LogTemp, Warning, TEXT("ARPGPlayerControllerBase::OnMountPak.Execute == TRUE"));
        }
        else
        {
            UE_LOG(LogTemp, Warning, TEXT("ARPGPlayerControllerBase::OnMountPak.Execute == FALSE"));
        }
    }


Please note that at this point both IsBound and Execute return TRUE so I am assuming the Pak file is successfully mounted.

I then try to open the map from the console using “open TopDownExampleMap”
… and nothing happens. I do get the following message in my log:
LogPackageName: SearchForPackageOnDisk took 0.293s, but failed to resolve topdownexamplemap.umap.

I have seen references to external apps like UnrealFileServer but I’m not sure if this is necessary or not. Obviously I’m missing something important though. Any help would be greatly appreciated.

Thanks,

Hi,

I’m having a similar problem but trying to load via code - have you had any success? I contacted Epic over a week ago and they still have not got back to me about this.

I know this is been more than a few months on the dormant side, but If anyone has an answer for this, I would love to know it. I am using OnMountPak.Execute to load a .pak file that has a single .umap file in it at root level. As debug I have a FDirectoryVisitor that lists out the files found on mounting, and it does show the file, but will not load with open test123…

Thanks anyone who knows how to fix this.

BUMP! Same situation as the comment above^^^

Please and thank you!