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"

DLC system with .pak files. Mounting .pak files.

Houston we have a problem!

I'm working on downloadable content system for my game project. I'm creating .pak files with cooked .uassets and .umaps using UnrealPak.exe. Mounting .pak files works fine, but when i try to load any object from this file like that:

 ULevel* obj = Cast<ULevel>(StaticLoadObject(ULevel::StaticClass(), nullptr, TEXT("/Engine/pyramid_torus_map.umap")));

i get this error:

 LogLinker:Warning: Unable to load package (../../../Engine/Content/pyramid_torus_map.umap). Package contains EditorOnly data which is not supported by the current build or vice versa.

It's kinda dead end for me. Any tips on what might i be doing wrong?

Product Version: UE 4.8
Tags:
more ▼

asked Jul 07 '15 at 02:18 PM in C++ Programming

avatar image

RDS-Wojtek
106 6 4 86

avatar image MeakinInt Jul 08 '15 at 03:03 PM

I think you need to cook your package, but I am not sure how to do that without putting it with your other game content and cooking the whole thing.

avatar image RDS-Wojtek Jul 09 '15 at 09:27 AM

My assets are all cooked before putting them in .pak file. I m not sure if it is possible to cook finished .pak.

I'm still stuck on reading assets from paks. Divine intervention is needed :)

avatar image TheMainStark Jul 01 '18 at 05:18 AM

I'm stuck on how to load and unload pak files, is it possible in blueprints?

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

4 answers: sort voted first

Ok this is solved. This error happens, when you try to load cooked assets in editor, or try to load not-cooked assets in released game. Kinda obvious but still...

more ▼

answered Jul 13 '15 at 10:02 AM

avatar image

RDS-Wojtek
106 6 4 86

avatar image rmenon98 Jul 28 '15 at 08:28 PM

Hi, I am trying to do something similar to this, but I'm having a lot of trouble.

Could you share how you were able to create a pak file and mount it?

Thanks!

avatar image RDS-Wojtek Jul 29 '15 at 09:03 AM

First i m cooking all my assets with command line. You can use FMonitoredProcess class to call command line from code. Then i call UnrealPak.exe using the same class to create pak file. To mount pak files you can use this code:

 IPlatformFile& InnerPlatformFile = FPlatformFileManager::Get().GetPlatformFile();
 FPakPlatformFile* PakPlatformFile = new FPakPlatformFile();
 FPlatformFileManager::Get().SetPlatformFile(*PakPlatformFile);
 PakPlatformFile->Initialize(&InnerPlatformFile, TEXT(""));
 
 bResult = PakPlatformFile->Mount(*PakFileName, PakOrder, *MountPoint);

The most not obvious thing about this process are paths to files. Files need to be mounted in engine dir. Game dir just doesnt work - i have no idea why. Also remember that assets are referenced with relative paths, so you need to keep the same catalog structure.

If you have more specific questions feel free to ask. Good luck.

avatar image AmyLin Dec 11 '15 at 12:05 PM

Hi, I'm trying to create pak files recently, but now I'm stuck. Would you mind sharing more details in the pak file creating part? thx a lot.

avatar image MeakinInt Dec 14 '15 at 03:54 PM

I've been doing the following from the command line:

Engine/Binaries/Win64/UnrealPak.exe [path to the directory you want the pak in] -create=[path to a text file that lists the paths to the .uassets you want in the pak]

You can also make them from the editor by following the steps in this post: http://www.tomlooman.com/add-mod-support-to-your-unreal-engine-4-game/

avatar image AmyLin Dec 15 '15 at 02:41 AM

Ok, I will have a try and thank you very much. :)

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

I've been doing the following from the command line:

Engine/Binaries/Win64/UnrealPak.exe [path to the directory you want the pak in] -create=[path to a text file that lists the paths to the .uassets you want in the pak]

You can also make them from the editor by following the steps in this post: http://www.tomlooman.com/add-mod-support-to-your-unreal-engine-4-game/

more ▼

answered Dec 14 '15 at 03:53 PM

avatar image

MeakinInt
21 2 1

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

Hello!From the UnrealEngine community,How to dynamically load the specified content in the PAK (as in a blueprint, material, and the name of the image from the PAK).Can you give me a demo code?My email address is 3217142879@qq.comThanks to you!

more ▼

answered Sep 08 '16 at 10:27 AM

avatar image

FoorKang
0 1

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

answered Nov 05 '16 at 08:15 AM

avatar image

肖吉星
31 1 3 1

(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