I need implement a Feature:
- .PAK File Download from server at Run-time.
- Mount PAK File to content At Run-time.
- Open a Level from PAK File contain content At Run-time.
I encountered The Problem like : link text
My Program downloaded and Mounted Pak File Is complete. Level happen exception when open Level. Like
a lot of Mesh have error.
But restart the My program after Download .PAK File. once again Open Level is no problem.
I Package Pak File Ways is follow :
Add mod-support to your Unreal Engine 4 Game
I think i miss some Step when mount PAK File.
I do not know how solve it ,Who can help me?
my mount PAK File code :
if(/** Download Pak File Write Disk is Successful */)
{
IPlatformFile& InnerPlatformFile = FPlatformFileManager::Get().GetPlatformFile();
FPakPlatformFile* PakPlatformFile = new FPakPlatformFile();
PakPlatformFile->Initialize(&InnerPlatformFile, TEXT(""));
FPlatformFileManager::Get().SetPlatformFile(*PakPlatformFile);
PakPlatformFile->Mount( *temp_filePath, 0,TEXT(""));
TSet<FString> FileList;
FPakFile pakFile(*temp_filePath, false);
pakFile.FindFilesAtPath(FileList, *pakFile.GetMountPoint(), true, false, true);
for (auto item : FileList)
{
if (item.EndsWith(FPackageName::GetAssetPackageExtension()) ||
item.EndsWith(FPackageName::GetMapPackageExtension()))
{
UE_LOG(LogTemp, Log, TEXT("Test = %s"), *item);
}
else
{
UE_LOG(LogTemp, Log, TEXT("PakFile Asset Failed : %s"), *item);
}
}
}