Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

How to use FCoreDelegates::OnMountPak.Execute


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 :

 if (FCoreDelegates::OnMountPak.IsBound()) // returns true
         const FString PakFilPath = GetFileLocalPakPath();
         FCoreDelegates::OnMountPak.Execute(PakFilPath, 0); // returns true
         LoadedMesh = Cast<UStaticMesh>(StaticLoadObject(UStaticMesh::StaticClass(), NULL,TEXT(" /Game/BigRoom/placard_cuisine_7/placard_cuisine_7.placard_cuisine_7" )));
         if (LoadedMesh)

It just returns the following errors, just like if nothing had been mounted at all :

 [2015.12.10-11.12.48:546][  7]LogLinker:Warning: Can't find file '/Game/BigRoom/placard_cuisine_7/placard_cuisine_7'
 [2015.12.10-11.12.48:547][  7]LogUObjectGlobals:Warning: Failed to load '/Game/BigRoom/placard_cuisine_7/placard_cuisine_7': Can't find file '/Game/BigRoom/placard_cuisine_7/placard_cuisine_7'
 [2015.12.10-11.12.48:547][  7]LogLinker:Warning: Can't find file '/Game/BigRoom/placard_cuisine_7/placard_cuisine_7'
 [2015.12.10-11.12.48:548][  7]LogUObjectGlobals:Warning: Failed to load '/Game/BigRoom/placard_cuisine_7/placard_cuisine_7': Can't find file '/Game/BigRoom/placard_cuisine_7/placard_cuisine_7'
 [2015.12.10-11.12.48:548][  7]LogUObjectGlobals:Warning: Failed to find object 'StaticMesh /Game/BigRoom/placard_cuisine_7/placard_cuisine_7.placard_cuisine_7'

Does anyone have an idea ? Is there a way to list all the currently mounted assets ?

Product Version: UE 4.10
more ▼

asked Dec 10 '15 at 11:23 AM in C++ Programming

avatar image

43 3 7 11

avatar image Xiaoxiong Xing Jan 28 '16 at 02:49 AM

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.

avatar image Xiaoxiong Xing Jan 28 '16 at 08:10 AM

How should I specify the path to StaticLoadObject, which in your case is " /Game/BigRoom/placard_cuisine_7/placard_cuisine_7.placard_cuisine_7"

(comments are locked)
10|2000 characters needed characters left

3 answers: sort voted first

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))
     UE_LOG(LogHotfixManager, Log, TEXT("Hotfix mounted PAK file (%s)"), *FileHeader.FileName);
more ▼

answered Dec 10 '15 at 09:03 PM

avatar image

joeGraf STAFF
1.5k 35 12 67

avatar image Schopi Dec 11 '15 at 08:57 AM

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 ?

Could my error simply be here:

 LoadedMesh = Cast<UStaticMesh>(StaticLoadObject(UStaticMesh::StaticClass(), NULL, TEXT("Game/BigRoom/placard_cuisine_7/placard_cuisine_7.placard_cuisine_7" )));

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.

avatar image joeGraf STAFF Dec 11 '15 at 05:38 PM

Note I said 4.11 so I you'll need that first. It's in Engine/Runtime/Online/Hotfix

My guess is your path does not match what is in the PAK file. Use UnrealPAK to dump it back out and see if that's the problem

avatar image Avelworldcreator Feb 01 '17 at 11:21 PM

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.

avatar image joeGraf STAFF Feb 01 '17 at 11:41 PM

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

avatar image Avelworldcreator Feb 02 '17 at 06:33 PM

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.

avatar image joeGraf STAFF Feb 02 '17 at 06:40 PM

You should ask on UDN then.

avatar image Schopi Dec 14 '15 at 01:42 PM

No that is not the problem either. I am going to wait for the 4.11 to try the HotfixManager. For now my workaround will do the trick.

Thank you

avatar image Xiaoxiong Xing Jan 28 '16 at 08:03 AM

After the PAK files are loaded, how to get the uasset files out from its inside?

(comments are locked)
10|2000 characters needed characters left

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,(没有索引关系),关卡的索引关系在哪儿存放呢?怎么加载可以加载出索引)

more ▼

answered Jul 28 '16 at 03:43 AM

avatar image

1 1 4

(comments are locked)
10|2000 characters needed characters left
more ▼

answered Apr 07 '17 at 04:38 PM

avatar image

31 1 3 1

(comments are locked)
10|2000 characters needed characters left
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question