As LucaSouza H2A mentioned in his reply, this subject has already have a tutorial. I’ll leave this in case (I think corrections are a little differents here and there, anyway, principles are the same).
Hi,
I’ve been trying to use Action RPG sample (Action RPG in Epic Content - UE Marketplace) with UE 5.3 recently, and encountered a few migration problems, and found no solutions on internet, so I tried to come up with mines.
Context:
This project might be outdated, so I suggest looking for newer sample projects to learn, but it might still be usefull for some (get animated characters as a starter for your own project, code study, inspiration and what not).
I personnally decided to use it as it was suggested in an online course I follow where they suggest using the characters of this course, or use echo from valley of the ancient, or others. I Chose this one cause it’s “lightweight” compared to the others.
Result:
Port seems overall functional, I didn’t find a bug up till now, but there might be some, IDK. I just did the port to be able to open the project, and study how things are done, but it happens to still work very well for me.
I publish my walkthrough to make the migration, for those interested.
Enjoy <3
Step 1:
Get the project from the marketplace: It’s free. Action RPG in Epic Content - UE Marketplace
Create a new project. I only have UE 5.3 installed, and as the project requires UE 4 version, it warns you. Select to install for UE 4.27 version even if you don’t have it.
Step 2:
Go to the install dir. Edit ActionRPG.uproject
Remove the 4 lines (for me, it was line 119-124, but I don’t guaranty this will be the same for you):
{
"Name": "SlateRemote",
"Enabled": true
},
Step 3:
Right click ActionRPG.uproject and select “Generate Visual Studio project files”
Select 5.3 version
Step 4:
Open the solution with VS 2022: Double click ActionRPG.sln
Step 5:
In solution explorer, go to Games → ActionRPG
Step 6:
Edit : ‘Config\DefaultGame.ini’
Replace all: IniKeyBlacklist by IniKeyDenylist
Step 7:
Edit both Source\ActionRPG.Target.cs and Source\ActionRPGEditor.Target.cs, and in both replace:
DefaultBuildSettings = BuildSettingsVersion.V2;
with:
DefaultBuildSettings = BuildSettingsVersion.Latest;
IncludeOrderVersion = EngineIncludeOrderVersion.Latest;
Step 8:
Edit Source\ActionRPG\Private\Abilities\RPGTargetType.cpp
Replace ligne 26:
OutActors.Add(const_cast<AActor*>(EventData.Target));
with:
OutActors.Add(const_cast<AActor*>(EventData.Target.Get()));
Step 9:
Edit Source\ActionRPG\Private\Abilities\RPGAbilityTask_PlayMontageAndWaitForEvent.cpp
Replace line 180:
check(AbilitySystemComponent);
with:
check(AbilitySystemComponent.IsValid());
Replace line 228:
if (AbilitySystemComponent && Ability)
with:
if (AbilitySystemComponent.IsValid() && Ability)
Finally, in this file, the macro ABILITY_LOG is used 3 times, and Visual Studio can’t find where it is defined.
As LucaSouza H2A mentioned in his reply, it is now included in:
#include "AbilitySystemLog.h"
Copy paste this line at the top of the file, with the other includes (not the first include that should remain unchanged). You should have something like:
#include "Abilities/RPGAbilityTask_PlayMontageAndWaitForEvent.h"
#include "Abilities/RPGAbilitySystemComponent.h"
#include "GameFramework/Character.h"
#include "AbilitySystemComponent.h"
#include "AbilitySystemGlobals.h"
#include "AbilitySystemLog.h"
#include "Animation/AnimInstance.h"
Step 10:
I’m not really sure about thi solution. Basically, as to implement FGCObject, FRPGLoadingScreenBrush must implement GetReferencerName(). I don’t know what name it is supposed to return, and I used the texture name passed as parameter as Name for this object… Might be bad solution, let me know it you have better solution.
Edit Source\ActionRPGLoadingScreen\Private\ActionRPGLoadingScreen.cpp
And add to struct FRPGLoadingScreenBrush:
FName TextureName;
virtual FString GetReferencerName() const override
{
return TextureName.ToString();
}
and add in its constructor:
TextureName = InTextureName;
So, the whole struct become:
struct FRPGLoadingScreenBrush : public FSlateDynamicImageBrush, public FGCObject
{
FRPGLoadingScreenBrush(const FName InTextureName, const FVector2D& InImageSize)
: FSlateDynamicImageBrush(InTextureName, InImageSize)
{
TextureName = InTextureName;
SetResourceObject(LoadObject<UObject>(NULL, *InTextureName.ToString()));
}
virtual void AddReferencedObjects(FReferenceCollector& Collector)
{
if (UObject* CachedResourceObject = GetResourceObject())
{
Collector.AddReferencedObject(CachedResourceObject);
}
}
FName TextureName;
virtual FString GetReferencerName() const override
{
return TextureName.ToString();
}
};
Step 11:
Generate the solution
Step 12:
Open the project with UE by double clicking the ActionRPG.uproject
Step 13:
Press Play and enjoy
Step 14:
Send some love or suggestions (Which name can be registered for the GC, which macro should replace ABILITY_LOG… where is it defined ??? Oo)
Hope it helps <3