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"

Loading a map from a pak file

Hi everyone!

I currently have a pak file that I'm mounting to my game at runtime and it seems to be mounting okay. I'm using the following code to do so:

 FString FullFilePath = "D:/PAKS/usethis2.pak"
 if (FCoreDelegates::OnMountPak.IsBound())
 {
     if (FCoreDelegates::OnMountPak.Execute(FullFilePath, 0, nullptr))
     {
         GEngine->AddOnScreenDebugMessage(-1, 5.f, FColor::Green, FString::FString("Mount Success"));
     }
 }

I get the "Mount Success" message on packaged builds so that's great. From the reading I've done though, apparently I'm supposed to just be able to say UGameplayStatics::OpenLevel(GetWorld(), "test"); Where "test" is the name of the map inside the pak file that I just mounted. When I do that it tells me that it is unable to resolve name "test.umap" and just reloads the current map.

I've been having trouble finding out information about where paks get mounted with this approach and how to actually access the data inside of the pak file once mounted.

Does anyone have any insight on this? I know people have done it, but it seems like everyone who has done it has kind of disappeared.


Some information about my project, I think the problem has to do with where it is being mounted.

The project I'm loading the pak file into is located here: D:\UE4\4.17\PakTest
The project I'm building the pak file with is located here: D:\UE4\4.17\PakSource
The actual pak file I'm mounting is here: D:\PAKS\usethis2.pak
Within the pakfile it says the path to my map is: "PakSource/Content/test.umap"
The line in the PakList file it generates after building PakSource is this: "D:\UE4\4.17\PakSource\Saved\Cooked\WindowsNoEditor\PakSource\Content\test.umap" "../../../USETHIS/Content/test.umap" -compress
That is the PakList file I use to generate the .pak file.

If someone could give me a hand I would greatly appreciate it, I've been bashing my head into a wall on this step for about 1.5 weeks now and I might go crazy if this takes much longer.

Thank you,
Testy

Product Version: UE 4.17
Tags:
more ▼

asked May 02 '18 at 07:01 PM in C++ Programming

avatar image

TestyRabbit
336 7 6 12

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

0 answers: sort voted first
Be the first one to answer this question
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