Hello, i hope this has a simple answer.
So i am using this to enable custom maps in the game. if i hard code things it all works fine. loading the pak, registering the asset. and loading the level.
but the one thing i can’t figure out that i want to be able to dynamically do is how do i read any level files in a pak?
for instance:
CustomMapDIR/Map1.Pak -> has Level1.umap
CustomMapDIR/Map2.Pak -> has SweetLevel.umap
how do i read the level1.umap and sweetlevel.umap via blueprints. (aka i dont know the map name ahead of time).
EDIT: NVM i figured it out.
For info for anyone else looking for this.
Register Mount Point: (yes first)
Root: /CustomMap/
ContentPath: …/…/…/CustomMapProject/Plugins/CustomMap/Content/
(make all custom maps with this layout, i made MapName.umap + MapNameContent (folder))
Get Files in Pak Directory:
Pak Dir: C:\CustomMap (variable for location)
Recursive (your choice)
Get Files in Pak Directory output into for each loop:
Valid Pak file? (good practice)
Mount Pak File:
Link Array Element here
Mount Path “” (Leave empty)
Load Pak Asset Registry File:
Asset Registry File: …/…/…/CustomMapProject/Plugins/CustomMap/AssetRegistry.bin
Then w/e you are building your list of custom maps.
Get Asset Registry -> Get Assets by Class
Class Name “World”
into for each loop
Break Array element -> AssetData
You get package, asset name and path to put into array to call later for building map list.