TruongBui
(Truong Bui)
September 11, 2020, 11:48pm
5
dominikpavlicek:
Hi,
This is a great plugin and worth a lot. That said I really admire you for making the decision to make it free for us. Thank you.
And now to the code itself. I have been using Darnell’s LoadingScreen for a long time, trying to modify it (kinda works), and I have one burning question that I couldn’t figure out: how to manually stop the MoviePlayer (for instance I don’t want to play the loading screen before loading the MainMenu level). What I have tried to do:
UGameplayStatics::GetCurrentLevelName(GetWorld())) == GetMainMenuLevelName.ToStrin() -> just compared the names
GetMoviePlayer()->StopMovie(); -> called when condition is met
This didn’t work very well, it sometimes didn’t show up at all. But I guess it was my mistake.
Anyway, the real pain comes when you set bWaitForManualStop = true. In this case, you must somehow stop the MoviePlayer (level loading is done, but spawning actors and setting their positions from a saved game is not yet done, so I want the LoadingScreen to be preset). In this scenario I have a function that is broadcasted:
FOnLoadingCompleted OnLoadingCompleted
OnLoadingCompleted calls GetMoviePlayer()->StopMovie();
Yet the LoadingScreen doesn’t disappear. I know this is a big step above the support of the plugin yet I would like to ask you if you know about any solution to solve this mystery To me it appears that the StopMovie() function doesn’t work properly. I took a look into the code of the StopMovie, all steps to stop the Movie were met, yet nothing happened.
My workaround is very primitive, I have created WBP that has only a black image and is displayed until OnLoadingCompleted is called, but you can imagine that the full loading screen logic would be much nicer.
…
You’re welcome TheStoryTellers,
I was able to manually stop the Loading Screen in the plugin module code, but unable to execute that function in blueprint while Loading Screen was showing. I think if the Loading Screen is showing, then the game thread still blocks other game logics even all levels have been loaded. That’s why you couldn’t call StopMovie() in the game thread.
You have to call StopMovie() in Slate’s thread , which means you have to modify the plugin’s source and implementing your own logic code.