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,