4.3 Transition Guide

[=;98273]
Enable the AIModule in the YourProject.Build.cs, e.g.:


PublicDependencyModuleNames.AddRange(new string] { "Core", "CoreUObject", "Engine", "InputCore", "AIModule" });

[/]

somehow this doesn’t work for me.
after adding the AIModule I get the following errors:


RPGAIController.h(8): error C2504: 'AAIController' : base class undefined
RPGAIController.h(9): error C2146: syntax error : missing ';' before identifier 'Super'

and more on that same class. which btw looks like this:


UCLASS()
class ARPGAIController : public AAIController
{
// rest of stuff

I tried rebuilding the solution, restarting VS and rebuilding the solution, and even re-compiling it from the UE4 launcher. nothing worked.
any ideas?

[edit: fixed]

I also needed this:
#include “AIController.h”

[=;98590]

[edit: fixed]

I also needed this:
#include “AIController.h”
[/]

Hi !

Great to hear from you!

:slight_smile:

[=;98513]
Thanks for sharing and !

Are you including Slate as a public depedency?

Are you including #Slate.h above your code where is not being found?

[/]

It turns out you were right after all, kind of feel silly now. :slight_smile: I just added Slate.h to my project.h and it took care of everything, missed the part where slate was no longer part of the engine, and i foolishly added it to the globalmenustyle class… Anyhow, since this is the first time i had the chance i just want to thank you for the wonderful work you have been doing for the community, i have used many of your examples and tutorials to further my knowledge of the engine and i can’t thank you enough for the time you have invested in making that possible. Keep up the good work!

[=Odiriuss;98601]
Anyhow, since this is the first time i had the chance i just want to thank you for the wonderful work you have been doing for the community, i have used many of your examples and tutorials to further my knowledge of the engine and i can’t thank you enough for the time you have invested in making that possible. Keep up the good work!
[/]

You’re welcome Odiriuss!

:slight_smile:

:slight_smile:

:slight_smile:

Hi, maybe someone can give me a hand on this…

After the update I can’t get a pointer to UNavigationComponent inside my Controller derived Class (worked until 4.2), now it’s shooting LNK2019 error
The weirdest is on the method shown on Engine code AController::UpdateNavigationComponents() there is a call and the code compiles…

UNavigationComponent* PathFindingComp = FindComponentByClass<UNavigationComponent>();

I did the include…

#include “Runtime/AIModule/Classes/Navigation/NavigationComponent.h”

Any ideas?

Thank you.

Hi creasso,

Are you depending on the new AI module?

[=ChrisJD;98026]
In general for anything that has been moved to the AI module (for instance the AAIController class) you’ll need an include and you need to edit your “MyProject.Build.cs” and change the PublicDependencyModuleNames.AddRange line to include “AIModule” so it looks like

PublicDependencyModuleNames.AddRange(new string] { “Core”, “CoreUObject”, “Engine”, “InputCore”, “AIModule” });
[/]

Cheers,
Noland

Thank you a lot !

I did the includes but forgot the build change as you said, work like a charm now!

The LNK errors gone and my character is back to action. :smiley:

Best Regards!

The following function has been removed from Character Movement Component:



AddMomentum(FVector Impulse, bool bVelocityChange=false)


You can use the following instead:



AddImpulse(FVector Impulse, bool bVelocityChange=false)


Also, creating instances of UObject-derived classes inside a constructor is not supported anymore, e.g.

MyActor.h



UPROPERTY()
UMyObject* MyObjectPointer;


The following is not allowed:

MyActor.cpp



MyActor::MyActor(const class FPostConstructInitializeProperties& PCIP)
	: Super(PCIP)
{
        MyObjectPointer = NewObject<UMyObject>(this, UMyObject::StaticClass());
}


It must be done somewhere else, e.g. in BeginPlay:



void MyActor::BeginPlay()
{
        MyObjectPointer = NewObject<UMyObject>(this, UMyObject::StaticClass());
}


The error message is:

NewObject can’t be used to create default subobjects (inside of UObject derived class constructor) as it produces inconsistent object names. Use PCIP.CreateDefaultSuobject<> instead.