DaedalicEntertainment / ue4-orders-abilities

Sample code of the talk "Hero AI: Gameplay Abilities Meet Behaviour Trees" at Unreal Fest Europe 2019.
https://www.daedalic.com
MIT License
191 stars 57 forks source link

Unreal Engine 4.22 compatibility #2

Open Skjolnir opened 5 years ago

Skjolnir commented 5 years ago

Hey Nick,

thanks for the presentation and the code sample, might prove very useful for our current project.

One thing to mention though: With UE 4.22 you can't directly override AController::Possess anymore, but have to override AController:OnPossess instead.

MatzeOGH commented 4 years ago

Do you know how you can have a player controller owning a pawn but the ai controller possessing it? https://github.com/DaedalicEntertainment/ue4-orders-abilities/blob/develop/Source/OrdersAbilities/Private/AbilitySystem/RTSAbilitySystemComponent.cpp#L36

Skjolnir commented 4 years ago

I would guess you just need to set the owner of the pawn to be the player controller, but possess it by an AI controller.

MatzeOGH commented 4 years ago

overriding the GetNetConnection of the actor and returning the connection of the player controller did the job. I'm not sure if it's not breaking something else.

MatzeOGH commented 4 years ago

To bad that it doesn't work with the ability component