I am doing all of this during Runtime, not in the editor.
#Goal
I am trying to create a set of .umaps that are tiles, that will all be loaded into a persistent world to generate a semi-random world made of the tiles placed in different ways.
I have gotten this far
obtain list of .umap files from content dir
load each .umap via the code below
the added level’s levelscript actor runs just fine! Level BP is running!
The problem is that the loaded levels blink constantly.
And a message appears that lighting needs to be rebuilt.
The Lighting rebuild counter keeps stuttering as it is trying to go down to 0, and going back to its highest number.
So if the highest is 20, it keeps trying to go down to 19 or 18 and then going back to 20
Indicating that the some process is being continually restarted and never finished.
This would also explain the incessant blinking.
#Question
What additional steps do I need to take besides the code below in order to finalize the loading of a map from file name without using level streaming volumes?
I had to spawn a level bounds actor for each level loaded from .umap
now there is no more flickering!
Yay!
if(!EachLevel->LevelBoundsActor.IsValid())
{
UE_LOG(Victory,Error,TEXT("THERE IS NO LEVEL BOUNDS ACTOR!!!!!!!!!!!!!!!!!!!!"));
FActorSpawnParameters SpawnParameters;
//spawn in the tile level instead of persistent
//so the tile picks it up as its level bounds actor
SpawnParameters.OverrideLevel = EachLevel;
PersistentWorld->SpawnActor<ALevelBounds>(SpawnParameters);
}
No luck, I did what you said and it’s still flickering.
I’ve discovered a few things:
This is happening because it keeps reloading the umap (the LevelBP and OnLoad get fired once and again)
The bounds are kept by the editor between calls to onLoad but if compiled without it, the are not
If I remove the ULevelStreaming from the UWorld right after setting the bounds in the OnLoad function, the level doesn’t show and the LevelBP is not called
If I remove the ULevelSteaming from the UWorld on the OnLoad function only if the level already has bounds (second call) The first tile doesn’t show, but the second works fine in the editor.
If I compile this last scenario without the editor, everything still flickers (the bounds are not kept from one call to onload to another, so the ULevelStreaming does not get removed)
This is kind of strange, I’ll keep looking tomorrow and if I can’t find an explanation I might start a proper question about it