4.3 Transition Guide

4.3 transition notes

Here are my transition notes while updating various projects to 4.3!

I will update this over time by adding new posts.

But please do contribute your own discoveries while transitioning your code bases, so we can centralize this information for !


**ALandscape** is no longer engine class level, you must include:
	


```

//Landscape Class
#include "Landscape/Landscape.h"

```


	
to get access to ALandscape

To Access FPositionVertexBuffer and other Static Mesh vertex types, include this:


//Static Mesh Vertex buffer
#include "StaticMeshResources.h"


**ASkeletalMeshActor** is not accessible unless you add:
	


```

#include "Animation/SkeletalMeshActor.h"

```


	

Replace OVERRIDE with override everywhere


**DependsOn** throws compile error now, you must #include the classes you previously used with DependsOn now, and make sure it is above your .generated  include :)

The new OnOverlap delegate requires this function signature:


void OnOverlap(class AActor* OtherActor, class UPrimitiveComponent* OtherComp, int32 OtherBodyIndex, **bool bFromSweep, const FHitResult & SweepResult**);

please feel free to add to this thread as they uncover solutions to the 4.3 C++ transition!

Enjoy!

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” });

Be sure to check out the “API Update Notes” section of the 4.3 release notes (Unreal Engine 4.3 Released! - Announcements - Epic Developer Community Forums), which should include any potential breaking C++ changes that require a code update like the AI being moved to a separate module.

Cheers,
Noland

I read it in the patch notes, that’s the only reason I had some idea of what the problem was when my AIController derived class wouldn’t compile. However, I haven’t had any reason to understand much about modules before today so I didn’t know what change had to be made to include the new module.

Nice to hear from you Noland!

:o


**UParticleSystemComponent**



```

#include "Particles/ParticleSystemComponent.h"

```



STextBlock


SetShadowColor() -> SetShadowColorAndOpacity()

SetForegroundColor() -> SetColorAndOpacity()

In previously-working project:



Error	8	error C2440: 'initializing' : cannot convert from 'UParticleSystem *' to 'UObject *'	c:\users\_____\desktop\unreal_data\4.3\engine\source\runtime\coreuobject\public\uobject\UObjectGlobals.h	569
Error	9	error C2439: 'TSubobjectPtrConstructor<UParticleSystem>::Object' : member could not be initialized	c:\users\_____\desktop\unreal_data\4.3\engine\source\runtime\coreuobject\public\uobject\UObjectGlobals.h	569

I’m not even making any particle systems in my own code. This is with 4.3 binaries.

EDIT: Turns out I did make a particle system somewhere.

Why do we need the #include “Particles/ParticleSystemComponent.h” now? Do we have to add it every time we want to make a particle component?

[=;98145]
In previously-working project:



Error	8	error C2440: 'initializing' : cannot convert from 'UParticleSystem *' to 'UObject *'	c:\users\_____\desktop\unreal_data\4.3\engine\source\runtime\coreuobject\public\uobject\UObjectGlobals.h	569
Error	9	error C2439: 'TSubobjectPtrConstructor<UParticleSystem>::Object' : member could not be initialized	c:\users\_____\desktop\unreal_data\4.3\engine\source\runtime\coreuobject\public\uobject\UObjectGlobals.h	569

I’m not even making any particle systems in my own code. This is with 4.3 binaries.
[/]

Are you sure you are not using UParticleSystem somewhre in your code?

As a UPROPERTY() in a .h somewhere maybe?

I’ve compiled and tested 2 different projects now and I’ve never gotten that error.

[=;98147]
Are you sure you are not using UParticleSystem somewhre in your code?

As a UPROPERTY() in a .h somewhere maybe?

I’ve compiled and tested 2 different projects now and I’ve never gotten that error.

[/]

You got me - I’ve corrected myself above :slight_smile:

[=;98151]
You got me - I’ve corrected myself above :slight_smile:
[/]

oooh nice!

I am glad you got it figured out!

[=;98151]
Why do we need the #include “Particles/ParticleSystemComponent.h” now? Do we have to add it every time we want to make a particle component?
[/]

It’s all in an effort to speed up compile times by not including headers by default that some projects wont need.

If you plan to use a particular header a lot you could add it to YourGame.h

but preferrably just add it above wherever you are going to need it, above that class’s #include .generated

:slight_smile:

So, here are the things I found during upgrading my project:

AI

Enable the AIModule in the YourProject.Build.cs, e.g.:


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

If working with Behaviour Trees, include:



#include "BehaviorTree/BehaviorTree.h"
#include "BehaviorTree/BehaviorTreeComponent.h"
#include "BehaviorTree/BlackboardComponent.h"


Include path for UPawnSensingComponent has changed:


#include "Perception/PawnSensingComponent.h"

Slate & UI

The argument .Heightoverride for SBox has changed to .HeightOverride:



(SBox)
.WidthOverride(FloatValue)
.HeightOverride(FloatValue)		


AddUIBlueoverrideRect has changed:


AddUIBluroverrideRect -> AddUIBlurOverrideRect 

Anyone getting errors like this:

1>C:\Program Files\Unreal Engine\4.3\Engine\Source\Runtime\SlateCore\Public\Layout\Margin.h(153): error C2061: syntax error : identifier ‘’

I can’t figure out what seems to be the problem.

[=Odiriuss;98348]
Anyone getting errors like this:

1>C:\Program Files\Unreal Engine\4.3\Engine\Source\Runtime\SlateCore\Public\Layout\Margin.h(153): error C2061: syntax error : identifier ‘’

I can’t figure out what seems to be the problem.
[/]

Can you post the code where you are the ?

template< Orientation>
float GetTotalSpaceAlong( ) const
{
return 0.0f;
}

That’s what’s there.

Thanks for sharing and !

[=Odiriuss;98416]
template< Orientation>
float GetTotalSpaceAlong( ) const
{
return 0.0f;
}

That’s what’s there.
[/]

Are you including Slate as a public depedency?

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

Hi Odiriuss,

If 's suggestion does not work, please post this to the answerhub at http://answers.unrealengine.com so we can track this potential bug. Thank you!

[=;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?

[/]

I have included Slate as a public dependency as well as the header file in code. I was actually learning slate by following a tutorial i found, HugeDomains.com

Part one goes well, problems start when implementing GlobalMenuStyle class in part two. It all worked in 4.2.1.

[= ;98524]
Hi Odiriuss,

If 's suggestion does not work, please post this to the answerhub at http://answers.unrealengine.com so we can track this potential bug. Thank you!
[/]

No problem, i will post it right now!

Just posted it, in case someone else runs into this problem here is the link:

UActorChannel needs to be #included when doing actor subobject replication



#include "Runtime/Engine/Classes/Engine/ActorChannel.h"


If you’re doing replication of custom subobjects in your actor, then you will now have to include UActorChannel’s header for Channel->ReplicateSubobject() to compile. Also, RF_WasLoaded flag is no longer needed for your replicated subobject to be supported for networking, instead override bool UObject::IsSupportedForNetworking() to return true.

[=The Beej;98570]
UActorChannel needs to be #included when doing actor subobject replication



#include "Runtime/Engine/Classes/Engine/ActorChannel.h"


If you’re doing replication of custom subobjects in your actor, then you will now have to include UActorChannel’s header for Channel->ReplicateSubobject() to compile. Also, RF_WasLoaded flag is no longer needed for your replicated subobject to be supported for networking, instead override bool UObject::IsSupportedForNetworking() to return true.
[/]

Wow really useful info, Thanks The Beej!

[=;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”