Hello All!
I am new to the C++ side of Unreal and its API so forgive me if I seem dumb at all.
I have been following this on the Wiki to create a better Loading Screen: Loading Screen
After moving this into my project Game Instance I am getting the error: “Incomplete Type is not allowed” from
FLoadingScreenAttributes
from
struct MOVIEPLAYER_API FLoadingScreenAttributes
I am getting this error no matter where I put the code:
struct MOVIEPLAYER_API FLoadingScreenAttributes
{
Blah Blah Blah. Code from the Wiki page
};
Also, here I get the error “identifier GetMoviePlayer is undefined”
GetMoviePlayer()->SetupLoadingScreen(LoadingScreen);
After adding this include:
#include "..\MoviePlayer\Public\MoviePlayer.h"
This code:
"FLoadingScreenAttributes LoadingScreen;"
starts throwing the error
expected a ";" on LoadingScreen
Sorry if this is very messy. As I said; I don’t know much about the Unreal API. Feel free to answer any sections of this question.
I understand that this is designed for an older version of UE4 so it needs updating.
Thanks for any help.
Just out of curiosity, try this as your include
#include “Runtime/MoviePlayer/Public/MoviePlayer.h”
Also LoadingScreenAttributes LoadingScreen should possibly be FLoadingScreenAttributes LoadingScreen;
Im no master of c++ either so apologies if the above don’t help at all, just suggesting ideas.
Sadly that doesn’t work. Think I may have made a spelling error above. It was already “FLoadingScreenAttributes LoadingScreen;” in my code.
Xavice
(Xavice)
October 1, 2017, 2:27am
4
Go to your Build.cs file and add “MoviePlayer” to your PublicDependencyModuleNames.
Should look something like this when it’s done:
PublicDependencyModuleNames.AddRange(new string[] { "Core", "CoreUObject", "Engine", "InputCore", "HeadMountedDisplay", "MoviePlayer" });
then in your class where you’re using the movie player,
#include "Runtime/MoviePlayer/Public/MoviePlayer.h"
It is enough to include movie player like this
#include "MoviePlayer.h"
but in order to make it work you should add the public dependencies in your build.cs
My for example looks like so:
PublicDependencyModuleNames.AddRange(new string[] { "Core", "CoreUObject", "Engine", "InputCore" , "UMG" , "AIModule", "RHI", "RenderCore" , "MoviePlayer" });
I think this is what you need so far
“MoviePlayer”
Also I know that the loading screen is also a slate based thingy so maybe you should also include a slate to the private dependencies:
PrivateDependencyModuleNames.AddRange(new string[] { "Slate", "SlateCore" });
I just ran into the same problem.
I got it to work by adding the movie player to PublicDependencyModuleNames as Xavice said and including the header
“Runtime/MoviePlayer/Public/MoviePlayer.h”
After that, you need to Regenerate your visual studio files by right clicking on your Unreal Engine Project File and hit “Generate Visual Studio Project Files”.