Download

How does ActionRPG display the loading screen at startup?

Hello,

I was trying to figure out how does the ActionRPG example display the loading screen on startup. I get the part how it shows the loading screen when entering the level. But not on startup. But when I package the app, I can see the loading screen also before entering main menu right after I start up the app.

Well, where is the logic that triggers it? I cannot find it anywhere. Also in


IActionRPGLoadingScreenModule

there is this function…



/** Kicks off the loading screen for in game loading (not startup) */
virtual void StartInGameLoadingScreen(bool bPlayUntilStopped, float PlayTime) = 0;

So even the comment says it’s not meant to be launched on startup. So, how does it work?

Thanks!
Jan

in ActionRPGLoadingScreen.cpp there is a class declared/defined
line89 classFActionRPGLoadingScreenModule : publicIActionRPGLoadingScreenModule
and in ActionRPGLoadingScreen.h you will find
line9 classIActionRPGLoadingScreenModule : publicIModuleInterface

And within this IModuleInterface class is a virtual function named ‘StartupModule’ which FActionRPGLoadingScreenModule overrides to load the transparentlogo and then CreateScreen.

The StartupModule virtual function is described here:-
https://docs.unrealengine.com/en-US/…ace/index.html
It says:-
[FONT=OpenSans Regular]Called right after the module DLL has been loaded and the module object has been created Load dependent modules here, and they will be guaranteed to be available during ShutdownModule.
The crucial part being Called right after the module DLL has been loaded.

So, when is this module loaded?
Well, in the uproject file we find this:-
“LoadingPhase”: “PreLoadingScreen”
PreLoadingScreen is an Unreal keyword. Which is described here:-
https://docs.unrealengine.com/en-US/…ype/index.html
It says:-

PreLoadingScreen:-
Loaded before the engine is fully initialized for modules that need to hook into the loading screen before it triggers.

So, the module is loaded, FActionRPGLoadingScreenModule::StartupModule()
runs, it loads the image it needs to use and then displays the Loading Screen.

I think.