Loading assets from a pak file

Hey everyone,

I am stuck at the same point.

I tried both methods (FCoreDelegates::OnMountPak and FPakPlatformFile) with no success.

My pak file is created using the custom launch profile with the DLC option checked (+ UsePakFile both in the general packaging options and in the custom launch profile).

I can mount it (or can i ??), change its mount point, even list its content using FPakFile::FindFilesAtPath(), but i can’t access any of the content, neither with a system related function nor through StaticLoadObject().

For instance IFileManager::Get().FindFilesRecursive waits 50 minutes (yes, i waited this long :smiley: ) before… doing nothing (but at least this very long time shows something is happening: the function sees or tries to see something).

I have been using IFileManager::Get().FindFilesRecursive for several months to search the main pak file so i know it can work.
Talking of which, the packaging logs for the main pak and the dlc pak seem to be the same (as far as path are concerned) so in principle the dlc pak should be functionnal.

But i can do nothing with the DLC pak file except reading it with FindFilesAtPath, and setting/getting its mountpoint.

I have read (Add Mod-support to Unreal Engine 4 Projects - Tom Looman) that all the pak files put in Content/Paks were automatically mounted at start, but that doesn’t seem to work in my case.

FCoreDelegates::OnMountPak apparently does all the work behind the curtains for some people, but not in my case.

As i can access the pak through FPakFile functions but not file manager functions, i suspect a mount point problem. I tried various mount points (using FPakFile::SetMountPoint() and FPakPlatformFile::Mount()), no success.
By various mount points i mean: Content, Content/Paks, …/…/…/MyGame/Content, etc. each time in relative and absolute path.
I test as much as i can but as i have no solid point to cling on so it’s tedious: not sure about my paths, not sure about the method, not sure about my pak file, not sure about the functions i use, i understand basically nothing.
I feel like a blind cat trying to catch a fly, it would be nice to have some sort of anchor here.

Did anyone understand what exactly SetMountPoint and Mount are doing ? Are they the equivalent of mounting a file system on unix ? Why use both ?
Besides all the functions returning true, is there a way to check if the Pak is correctly mounted and where ?

Sorry bout the wall of infos, just trying to show that i tried to do my homework before posting here :slight_smile:
I have already spent many hours on this, it can’t be that complicated so it’s obvious i’m missing something big or doing something stupid. Any help welcome.

As always, if i understand something or come up with some working code, i’ll post the full solution here.

Cheers