Community Tutorial: Updating Action RPG from UE4 to UE5

Hello! Thank you for replying, I believe we can narrow down the source of our misunderstanding now. :slight_smile:

So in the original UE 4.27 source code there is no if-statement.

As you can see here.

In case the image doesn’t load here I’ll quote the original code before the upgrade to UE 5.1:

void URPGAbilityTask_PlayMontageAndWaitForEvent::ExternalCancel()
{
	check(AbilitySystemComponent);

	OnAbilityCancelled();

	Super::ExternalCancel();
}

As you can see there’s no if-statement.

And for reference this is how the instructions look to me on the website:

ActionRPG Upgrade

And I didn’t get the sense when I asked my question that what you meant was:

	UAbilitySystemComponent* ASC = GetTargetASC();
	if (ASC)
		OnAbilityCancelled();

Which would’ve been fine, but I think you said this isn’t it?

As for whether I test it yet, not yet as the main thing I was aiming for from the ActionRPG project was the Preloading Screen as it is literally the only tutorial resource for how to have a pre-loading screen instead of a black application window. But I think we can clearly see as long as the ASC exists then there is no change in behaviour. The question was, “What should happen if the ASC doesn’t exist?” and what this intent was wasn’t clear with the upgrade to 5.1.

I assume the Lyra Starter Game is a different game template project? If they happened to have the exact same code without brackets and without a statement clearly on the next line and indented then the only thing I can speculate is that they made a mistake.

Like its fine to have:

if (bFrogsAreCool)
    print("Yeah Frogs are Cool");

It’s a legitimate style, what is not fine I feel is:

if (bFrogsAreNotCool)



print("I hate frogs >:(");

Because the print statement in the second example is still going to be enclosed in the scope of the if, but it isn’t clear to anyone reviewing the code; which is what the update instructions for the ActionRPG project seem to imply should be the change?

I hope this clears up the discussion and resolves the misunderstanding I think we were having, I hope you’re travelling safely. :slight_smile:

1 Like