Edit:
Well there is no point on continuing on this topic.
I was following this idea of using the pak file as a mod loader and using AI to help with the registry stuff, then I found this page, got excited, then after messing with it and looking at the links above, this answer in particular (How to mount pak files without breaking the loading of other assets? - #3 by Chatouille) trying this is basically useless, as any link will get confused with the origing of the link in the pak file.
So, seems like the Plugin alternative is the only solution as any link would have a different start mount point. I didn’t test with the plugin alternative yet…
Well if anyone had success doing it, please mark me in the thread!
Was this running on 5.4 as you said?
I can’t compile it, as it complains about having the Records.Add(It)
'FPakFile::FFilenameIterator::FFilenameIterator(const FPakFile::FFilenameIterator &)': attempting to reference a deleted function,
GetPakContent(const FString& PakFilePath, bool bOnlyCooked /*= true*/) {
...
TArray<FPakFile::FFilenameIterator> Records;
for (FPakFile::FFilenameIterator It(*Pak, false); It; ++It) {
Records.Add(It);
}
Well just move the code from the loop below inside the above loop, and problem solved.
Now that I’m looking at it, why would we do two loops instead of only 1?
TArray<FPakFile::FFilenameIterator> Records;
for (FPakFile::FFilenameIterator It(*Pak, false); It; ++It)
{
if (bOnlyCooked)
{
if (FPaths::GetExtension(It.Filename()) == TEXT("uasset"))
{
PakContent.Add(FString::Printf(TEXT("%s%s"), *PakAppendPath, *It.Filename()));
}
}
else
{
PakContent.Add(FString::Printf(TEXT("%s%s"), *PakAppendPath, *It.Filename()));
}
}