I have been working on mounting pak files at runtime and recently read here that FCoreDelegates::OnMountPak.Execute could simplify a lot my code and solve one of my problems.
Except that I didn’t find any documentation on this function. And my code doesn’t work :
In 4.11 there’s a new module called HotfixManager which can download PAK files used to patch your game at runtime (not exe, just BPs, content, etc.) Here’s the code I wrote to mount PAK files:
if (!FCoreDelegates::OnMountPak.IsBound())
{
UE_LOG(LogHotfixManager, Error, TEXT("PAK file (%s) could not be mounted because OnMountPak is not bound"), *FileHeader.FileName);
return false;
}
FString PakLocation = FString::Printf(TEXT("%s/%s"), *GetCachedDirectory(), *FileHeader.DLName);
if (FCoreDelegates::OnMountPak.Execute(PakLocation, 0))
{
MountedPakFiles.Add(FileHeader.DLName);
UE_LOG(LogHotfixManager, Log, TEXT("Hotfix mounted PAK file (%s)"), *FileHeader.FileName);
Thank you for your answer, but it looks like your code is very similar to mine :
You are using a FileHeader (what class is this?) but I don’t see how it can affect the mounting
“MountedPakFiles.Add(FileHeader.DLName);” is only here to remember which pak file has been mounted, right ? Or some other use ?
I am using the 4.10 so maybe I am missing something here but I don’t see what. Are you using the HotfixManager from 4.11 that you are talking about in this code ?
Maybe the reference path is updated during mounting with a “Engine/” or something ? Here I assume that the reference is exactly how it was in the original unreal project used to create the pak file.
Hi, I am having the same problem. Have you figured it out? I generated PAK files manually with UnrealPak.exe but then I have no idea where in my packaged game directories should I put these PAKs, and I don’t know how to implement GetFileLocalPakPath() in your code snippet.
I loaded map from pak file, it can be loaded into the map, but the map of uasset gone, how to load the map with uasset? Thanks. (现在加载出的关卡没有uasset,(没有索引关系),关卡的索引关系在哪儿存放呢?怎么加载可以加载出索引)
Where the heck is this path “Engine/Runtime/Online/Hotfix”?
I can’t find this path in the API documentation. I can’t find it in any engine source on GitHub. If this is online documentation please provide direct links and not a file path description.
Sorry Engine/Source/Runtime/Online/Hotfix. FiF would have found it too. In later releases it was moved to a plugin along with the other online*, so Engine/Plugins/Online/OnlineFramework/Source/Hotfix
Thanks for the quick response. I have a connected question to this one. Should I just open up a another topic or append it here? It relates to mounting PAK files as well but it involves an unusual use case. FWIW, it’s been suggested I identify as being from Missing Worlds Media, Inc. due to our contract with Epic games.