Hello, I'm trying to make a generic menu that can load a dynamic set of indipendent(downloadable) maps and I've been looking into the pak system.
I made a project with only a map and some assets inside it(some custom and some unreals), and built it as a pak.
In another project that acts as a menu I've written some code to load and mount a pak.
The pack mounts correctly and it lets me open the map, but when loaded it doesent display any objects!
Looking into the Log file showed me that the reference paths for the map didnt get updated with the new mount directory but they still reference the /Game/ folder.
Here's the code I'm using to mount the pak.
FString AbsolutePathToPak = TEXT("D:/PakTest/IndipendentMap.pak");
FString StandardFilename = FPaths::ProjectPluginsDir() + TEXT("DLC1/");
StandardFilename = FPaths::GetPath(StandardFilename);
if (!pakPlatformFile->Mount(*AbsolutePathToPak, 0, *StandardFilename))
FAssetRegistryModule& AssetRegistryModule = FModuleManager::LoadModuleChecked<FAssetRegistryModule>(FName("AssetRegistry"));
IAssetRegistry& assetRegistry = AssetRegistryModule.Get();
The pak gets correctly mounted and the map gets placed here:
LogTemp: Map path:/DLC1/CustomMap/Content/MyMap.MyMap
LogTemp: Map Package:/DLC1/CustomMap/Content/MyMap
LogTemp Map Name: MyMap
And here's the log file output after I use the comand "open MyMap"
LogNet: Browse: /DLC1/CustomMap/Content/MyMap
LogLoad: LoadMap: /DLC1/CustomMap/Content/MyMap
LogStreaming: Display: Flushing async loaders.
LogStreaming: Error: Couldn't find file for package /Game/customassetone requested by async loading code. NameToLoad: /Game/customassetone
LogStreaming: Error: Found 1 dependent packages...
LogStreaming: Error: /DLC1/CustomMap/Content/MyMap
LogStreaming: Error: Couldn't find file for package /Game/customassettwo requested by async loading code. NameToLoad: /Game/customassettwo
Basically the map tries to open customassetone and customassettwo from the /Game/ directory, when instead its in /DLC1/CustomMap/Content/ , the same directory as the map.
Does anyone know how can I update these references?
Thanks in advance for your time!
Feb 15 '19 at 02:44 PM
in Packaging & Deployment