4.13 Transition Guide

Dear Community,

Here is a thread where you can share all of your learnings as you upgrade your projects to 4.13!

Here you can ask questions about strange compile errors, issues after upgrading a c++ project, and also share things you discover!


****
Online Subsystem 4.13

Critical And Easy Multiplayer Fix****

For anyone having trouble with OnlineSubsystem in 4.13, our lovely community member [MENTION=29846]Blue man[/MENTION] has posted a fix!

https://forums.unrealengine.com/showthread.php?121685-4-13-Transition-Guide&p=590210&viewfull=1#post590210


[QUOTE=Blue man;590210]


1: Go to your project's Build.cs and replace this


```


// Uncomment if you are using Slate UI
		 PrivateDependencyModuleNames.AddRange(new string] { "Slate", "SlateCore" });
		
		// Uncomment if you are using online features
		 PrivateDependencyModuleNames.Add("OnlineSubsystem");
		 if ((Target.Platform == UnrealTargetPlatform.Win32) || (Target.Platform == UnrealTargetPlatform.Win64))
		 {
				if (UEBuildConfiguration.bCompileSteamOSS == true)
				{
					DynamicallyLoadedModuleNames.Add("OnlineSubsystemSteam");
				}
		 }


```



with this 


```

// Uncomment if you are using Slate UI
         PrivateDependencyModuleNames.AddRange(new string] { "Slate", "SlateCore" });

        // Uncomment if you are using online features
         PrivateDependencyModuleNames.Add("OnlineSubsystem");

        // To include OnlineSubsystemSteam, add it to the plugins section in your uproject file with the Enabled attribute set to true

```




2: Open your project's .uproject file and add this


```

,
	"Plugins": 
		{
			"Name": "OnlineSubsystemSteam",
			"Enabled": true
		},
		{
			"Name": "OnlineFramework",
			"Enabled": true
		}
	]

```


 @Rama I think you should add this to the first post so users that have this problem can easily find a fix for it :)
[/QUOTE]




Tickable Object World

One change I’d like to draw to your attention as a C++ programmer:

Gameplay Framework


**Level Streaming Kismet ~ Load Level Instance**

My most exciting contributions in 4.13 are the the BP exposure of the Cheat Manager and Load Level Instance in LevelStreamingKismet:



```


/**  
 	* Stream in a level with a specific location and rotation. You can create multiple instances of the same level!
 	*
 	* The level to be loaded does not have to be in the persistent map's Levels list, however to ensure that the .umap does get
 	* packaged, please be sure to include the .umap in your Packaging Settings:
 	*
 	*   Project Settings -> Packaging -> List of Maps to Include in a Packaged Build (you may have to show advanced or type in filter)
 	* 
 	*          @param LevelName - Level package name, ex: /Game/Maps/MyMapName, specifying short name like MyMapName will force very slow search on disk
 	*          @param Location - World space location where the level should be spawned
 	*          @param Rotation - World space rotation for rotating the entire level
	*          @param bOutSuccess - Whether operation was successful (map was found and added to the sub-levels list)
 	*          @return Streaming level object for a level instance
 	*/ 
 	UFUNCTION(BlueprintCallable, Category = LevelStreaming,meta=(WorldContext="WorldContextObject"))
 	static ULevelStreamingKismet* LoadLevelInstance(UObject* WorldContextObject, const FString& LevelName, const FVector& Location, const FRotator& Rotation, bool& bOutSuccess);


```



My github on this node:
https://github.com/EpicGames/UnrealEngine/pull/2320/files

♥

Rama

Pics of my Load Level Instance function:

![LoadLevelInstance.jpg|1366x768](upload://hHTMCDlaRYTwwkLhh9FRMucCsVo.jpeg)

![c80b57dcf740d2ea8f58f3db78991718e65cbb36.jpeg|1366x768](upload://sxFNoXKhualLi7OjlLZ07gOGh5I.jpeg)

![LoadLevelInstance3.jpg|1366x768](upload://hpI8DggmRfTTNmsVdkuUgHZGD8k.jpeg)

Depricated on 4.13:



FClassIconFinder::RegisterIconSource(StyleSet.Get());


Unreal 4.13 now registers custom editor classes’ icons automatically! Awesome :o

Depricated on 4.13:



virtual FName GetPaletteIcon(FLinearColor &OutColor) const override;


Now must be:



//virtual FName GetPaletteIcon(FLinearColor &OutColor) const override;
virtual FSlateIcon GetIconAndTint(FLinearColor& OutColor) const override;

FSlateIcon GraphNode::GetIconAndTint(FLinearColor& OutColor) const {
	//return TEXT("GraphEditor.Macro_16x");
	return FSlateIconFinder::FindIcon("GraphEditor.Macro_16x");
}


How should the implementation of this look like? I can’t even find the function you’re referencing.

Hey in 4.13 this no longer compiles what do i have to do differently?
DeathAnimDuration = GetMesh()->AnimScriptInstance->Montage_Play(DeathAnim1P, 1.0f);

2> C:\Program Files (x86)\Epic Games\4.13\Engine\Source\Runtime\Engine\Classes\Animation/AnimBlueprintGeneratedClass.h(15): note: see declaration of ‘UAnimInstance’
2>F:\Users\dark5\Documents\Unreal Projects\darkstorm\Source\darkstorm\darkstormCharacter.cpp(3791): error C2227: left of ‘->Montage_Play’ must point to class/struct/union/generic type

I didn’t look into this yet, but what does that means for us? Does the default behavior is not already set to run as in previous UE version?

I bet this is a way to handle “rendering” of world on the background to display 3D character in UI or to manage Replay functionality. Any other usage of this?

Thanks

Try include:

include “Animation/AnimInstance.h”

Get Tickable Game Object World

Dear Community,

In regards to the questions about GetTickableGameObjectWorld():

There are not that many examples in 4.13 code base, presumably because game objects are your role, not Epic’s, Epic is just providing the system for you to use to craft your own game objects :slight_smile:

Here’s some 4.13 source code to check out!

See Tickable.h




/**
 * This class provides common registration for gamethread tickable objects. It is an
 * abstract base class requiring you to implement the Tick() method.
 */
class ENGINE_API FTickableGameObject : public FTickableObjectBase
{
	//...

	virtual UWorld* GetTickableGameObjectWorld() const 
	{ 
		return nullptr;
	}
};


Some examples:



AIPerceptionSystem.h
virtual UWorld* GetTickableGameObjectWorld() const override { return GetWorld(); }

ActiveMovieSceneCaptures.h
virtual UWorld* GetTickableGameObjectWorld() const override { return ActiveCaptures.Num() != 0 ? ActiveCaptures[0]->GetWorld() : nullptr; }

LevelBounds.h
/** FTickableGameObject interface */
virtual void Tick(float DeltaTime) override;
virtual UWorld* GetTickableGameObjectWorld() const override { return GetWorld(); }
virtual TStatId GetStatId() const override;
virtual bool IsTickable() const override;
virtual bool IsTickableInEditor() const override;



So for the most part what I am seeing in the 4.13 code is that you’d probably just want to return GetWorld(), what I find rather odd is that Actor.h doesn’t seem to do this.

I am sure Epic can explain this better than I can :slight_smile:

:heart:

Rama


ViewAPlayer(1);

called from within the playercontroller::UnFreeze method is no longer working for me to get a player to specate another player. It always tries to spectate its own playerstate.
This was working fine in 4.12 so not sure what the correct way to get a player controller to view another player is?

Hi,

I have a problem if I declare a UPROPERTY inside a UE_SERVER or WITH_SERVER_CODE preprocessor like:



#if WITH_SERVER_CODE
UPROPERTY()
FString StringVariable;
#endif


And the error message is : “UPROPERTY inside this preprocessor block will be skipped”

Well if someone have a workaround for this, I will really appreciate :smiley:

AAI_Object_DefensePoint * CurrentDefensePointTest = Cast<AAI_Object_DefensePoint>(*ActorItr);

This generated the current error and thanks Pierdek that solution worked after the update.

2>F:\Users\dark5\Documents\Unreal Projects\darkstorm\Source\darkstorm\AIController_Base.cpp(718): warning C4458: declaration of ‘CurrentDefensePointTest’ hides class member
2> f:\users\dark5\documents\unreal projects\darkstorm\source\darkstorm\AIController_Base.h(209): note: see declaration of ‘AAIController_Base::CurrentDefensePointTest’

Same here with USTRUCT, this must be a bug.

I was going through the c++ fps tutorial and this tripped me up since AttachParent is used to attach Components. I added notes to the wiki for the tutorial. I used the AttachTo() function instead like this…


FirstPersonCameraComponent->AttachTo(this->GetCapsuleComponent());
FirstPersonMesh->AttachTo(FirstPersonCameraComponent);

Also the api reference for AttachTo() has a code example that doesn’t include the AttachTo() function! :stuck_out_tongue:

Taking a look at the 4.13 code, AttachTo() looks similar to 4.11.2 (version I currently work with the most):



bool USceneComponent::AttachTo(class USceneComponent* Parent, FName InSocketName, EAttachLocation::Type AttachType /*= EAttachLocation::KeepRelativeOffset */, bool bWeldSimulatedBodies /*= false*/)


The following should work fine for you basic attachment:



FirstPersonCameraComponent->AttachTo(this->GetCapsuleComponent(), NAME_None);
FirstPersonMesh->AttachTo(FirstPersonCameraComponent, NAME_None);


Unless you need to offset it etc.

FConstraintInstance has had a major overhaul, most members are deprecated and have been moved into the new ProfileInstance member.
There are getters and setters for some, but unfortunately not all, though they can be accessed directly via the above member.

From what I can see, joint drives are now bugged to the point that I’ve reverted to 4.12 - see AH post here.

Yup, that change kept me on 4.12 as well.

Does anyone know what happened to FCoreUObjectDelegates::PreLoadMap ?

FCoreUObjectDelegates::PreLoadMap.AddUObject(this, &UMyGameInstance::BeginLoadingScreen);

no longer works.

Just add to your UMyGameInstance::BeginLoadingScreen function parameter: “const FString& MapName”, and it should work fine.

It’s quite strange also that by default on Actor, they didn’t do it. I bet they didn’t want to set a “default world” on actor just to avoid to have to unset it if it no fit your needs.

All in All, I have to move on all my actors to be sure they are implementing this properly.

Hope to see some new tutorial using a “Preview” world in order to draw in HUD a sub scene with antialiasing / post effect and so on ^^ - Like Character Preview

What happened to the OnlineSubsystem on 4.13?? the whole code from Engine is now on the Plugins folder, and I cannot find how to compile my online projects now, I found others have the same issue like this: Online SubSystem plugin - Plugins - Unreal Engine Forums

I will appreciate any help :slight_smile:

I had the same problem, I found a solution for it.

1: Go to your project’s Build.cs and replace this



// Uncomment if you are using Slate UI
		 PrivateDependencyModuleNames.AddRange(new string] { "Slate", "SlateCore" });
		
		// Uncomment if you are using online features
		 PrivateDependencyModuleNames.Add("OnlineSubsystem");
		 if ((Target.Platform == UnrealTargetPlatform.Win32) || (Target.Platform == UnrealTargetPlatform.Win64))
		 {
				if (UEBuildConfiguration.bCompileSteamOSS == true)
				{
					DynamicallyLoadedModuleNames.Add("OnlineSubsystemSteam");
				}
		 }


with this


// Uncomment if you are using Slate UI
         PrivateDependencyModuleNames.AddRange(new string] { "Slate", "SlateCore" });

        // Uncomment if you are using online features
         PrivateDependencyModuleNames.Add("OnlineSubsystem");

        // To include OnlineSubsystemSteam, add it to the plugins section in your uproject file with the Enabled attribute set to true

2: Open your project’s .uproject file and add this


,
	"Plugins": 
		{
			"Name": "OnlineSubsystemSteam",
			"Enabled": true
		},
		{
			"Name": "OnlineFramework",
			"Enabled": true
		}
	]

@Rama I think you should add this to the first post so users that have this problem can easily find a fix for it :slight_smile: