Hey,
I’m trying to have a set of actors load when I’m in a particular game mode. It’s working, but I don’t have a way of detecting when it failed.
Here’s what I have so far:
And inside my PlantTheBomb::InitGameState
UWorld* TheWorld = GetWorld();
FString CurrentLevel = TheWorld->GetMapName();
// Assume the plant the bomb sub map is named "currentMap_PTB"
CurrentLevel += "_PTB";
FLatentActionInfo LatentActionInfo;
LatentActionInfo.CallbackTarget = this;
LatentActionInfo.UUID = 1;
LatentActionInfo.Linkage = 0;
// TODO: Find a way to get a completion callback with a success/fail indication
// and bonus points if I don't have to use a BP callable function...
LatentActionInfo.ExecutionFunction = FName(TEXT("OnStreamingPTBLevelComplete"));
UGameplayStatics::LoadStreamLevel(GetWorld(), *CurrentLevel, true, true, LatentActionInfo);
Is there a way to have some C++ callback with some indication of success/failure so I can report that back to the level designer if something isn’t setup right? Would be massively more helpful to them than having it silently fail (or having to read the output log for spelling mistakes like
LogLevel: Warning: Failed to find
streaming level object associated with
‘UEDPIE_0_DesertMapSm_PTC’
and interpret what that means.
Thanks for any suggestions!