I’m trying to figure out what string format should be for async loading. FStreamableManager::RequestAsyncLoad
take an const TArray<FSoftObjectPath>& TargetsToStream
argument. Following functions calls into the engine i found function FStreamableManager::StreamInternal
with the same argument and following code.
// We always queue a new request in case the existing one gets cancelled
FString Package = TargetName.ToString();
int32 FirstDot = Package.Find(TEXT("."));
if (FirstDot != INDEX_NONE)
{
Package = Package.Left(FirstDot);
}
Existing->bAsyncLoadRequestOutstanding = true;
Existing->bLoadFailed = false;
LoadPackageAsync(Package, FLoadPackageAsyncDelegate::CreateSP(Handle, &FStreamableHandle::AsyncLoadCallbackWrapper, TargetName), Priority);
It takes everything before first dot and tries to load it instead, using full name for callback it seems.
Next function int32 LoadPackageAsync(const FString& InName, const FGuid* InGuid, const TCHAR* InPackageToLoadFrom, FLoadPackageAsyncDelegate InCompletionDelegate, EPackageFlags InPackageFlags , int32 InPIEInstanceID, int32 InPackagePriority)
where InName
is a chunk of my actual string and nPackageToLoadFrom
always nullptr, since it’s looking for some variable in FAsyncPackage
class i don’t have access to.
What I’m trying to achieve is to mount pak file, read map asset and load it. That wasn’t going to well so i thought i’d to simply load asset first.