x

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"

Office Holiday

Epic Games' offices will be on holiday from June 22nd to July 7th. During this period support will be limited. Our offices will reopen on Monday, July 8th. 

Runtime Mount PakFile

We had plugin that download chunk1 to doc folder in IOS, when it ready we mount it by

 bMount = FCoreDelegates::OnMountPak.Execute(pakFilePath, 3, nullptr);

And it mounts well, i saw there was a files by this func (= in IPlatformFIlePak.cpp bool FPakPlatformFile::HandleMountPakDelegate(const FString& PakFilePath, uint32 PakOrder,

 IPlatformFile::FDirectoryVisitor* Visitor)
 {
 
     bool bReturn = Mount(*PakFilePath, PakOrder);
 
 
     if (bReturn)// && Visitor != nullptr)
     {
         TArray<FPakListEntry> Paks;
         GetMountedPaks(Paks);
         // Find the single pak we just mounted
         for (auto Pak : Paks)
         {
             if (PakFilePath == Pak.PakFile->GetFilename())
             {
                 // Get a list of all of the files in the pak
                 for (FPakFile::FFileIterator It(*Pak.PakFile); It; ++It)
                 {
                     //Visitor->Visit(*It.Filename(), false);
                     UE_LOG(LogPakFile, Log, TEXT("Filename %s in Pak %s"), *It.Filename(), *Pak.PakFile->GetFilename());
                 }
                 return true;
             }
         }
     }
     return bReturn;
 }

But we cant load anything from this pak, whe i fully reload app, plugin mount chunk1 at startup cuz it exist, and all work. =\

So what i do wrong?

Product Version: UE 4.13
Tags:
more ▼

asked Oct 14 '16 at 11:56 AM in C++ Programming

avatar image

pRoxxx
61 1 5 8

avatar image pRoxxx Oct 19 '16 at 12:32 PM

So i get, i can load files by StaticLoadObject, but i need to reload Packages that are loaded as NULL cuz they dont exist at start map. How can i dot that? I try do it with Visitor when mount Chunk, but its never reach to Package Reseted!

     class FPakDirVisitor : public IPlatformFile::FDirectoryVisitor
     {
     public:
         FPakDirVisitor()
         {}
 
         virtual bool Visit(const TCHAR* Filename, bool bIsDirectory)
         {
             if (!bIsDirectory)
             {
                 FString GamePath = FPackageName::PackageFromPath(Filename);
 //                 FString GamePath(Filename);
 //                 GamePath.RemoveFromEnd(TEXT(".uasset"));
                 FString RelativePath = TEXT("/Game/") + GamePath;
                 //FName ObjectName = FName(*RelativePath);
 
                 UE_LOG(LogTemp, Log, TEXT("FileName is %s         Path %s"), *GamePath, *RelativePath);
                 UPackage *Tmp = NULL;
                 Tmp = FindObject<UPackage>(NULL, *RelativePath);
                 if (Tmp)
                 {
                     //Reset Package
                     ResetLoaders(Tmp);
                     Tmp->ClearFlags(RF_WasLoaded);
                     Tmp->bHasBeenFullyLoaded = false;
                     Tmp->GetMetaData()->RemoveMetaDataOutsidePackage();
 
                     UE_LOG(LogTemp, Log, TEXT("Package Reseted!<<<<<<<<<<<<<<<<<<<,"));
 
                 }
 
             }
             return true;
         }
     };
avatar image pRoxxx Oct 19 '16 at 04:26 PM

I need to reload all resources in game, how can i do that?

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

1 answer: sort voted first

Solved, there was singleton which helds resources(Blueprints) in memory.

more ▼

answered Oct 24 '16 at 02:41 PM

avatar image

pRoxxx
61 1 5 8

avatar image DisplaySweet Oct 02 '17 at 02:17 AM

Can you please explain more details. I need to mount a pak file at runtime as well .and, is there any git on this?

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
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