Blueprint to C++: Event recieve execute in C++ implementation? Bttask_Node, Bttask_BlackboardBase, Bttask_BlueprintBase?

Hi, i´ve been working with blueprints for about 3 mounths now, to make my AI, but my teacher dont want visual programming in the final version, so i have to start converting most of what i did in blueprints to C++.
First question, why cant i implement ReceiveExecute() in a created class based of BTTask_BlueprintBase(img1)?

][2]

Second, i want to call that bttask in the behaviortree in the editor, which base class will allow me to do that and how can i do it (img2)?
On the foruns they advice to use Bttask_Node, Bttask_BlackboardBase, but the only class that has the ReceiveExecute implementation is the Bttask_BlueprintBase.

Thanks in advance for everyone who can help.

BlueprintImplementableEvents aren’t overridable. So that’s why it won’t compile.

It seems like your teacher doesn’t want any blueprints, so using Bttask classes doesn’t seem like the right way to go. You probably should be inheriting from UBTTaskNode instead because it is Bttask_BlueprintBase's parent.

UBTTaskNode | Unreal Engine Documentation

Then you can override ExecuteTask which eventually calls RecieveExecute in the Blueprint version. https://github.com/EpicGames/UnrealEngine/blob/a27ad66f0a075f3b74ef8f68a4b2b0da4882425e/Engine/Source/Runtime/AIModule/Private/BehaviorTree/Tasks/BTTask_BlueprintBase.cpp#L50

1 Like

Thanks for the tip:

Its really simple to make in C++, but its still really sad to not have any exemples online. And this is what i´ve done, i´ve create a class base of Bttask_Node, override the execute task (receiveExecute its called within this function in BP), make in the .h blueprintable, the a BP class direved from that one, and in the behavior tree i could call it. You can see it in the image.

Hello! You can look at my plugin. I worked with BehaviorTree to create dialogues. It’s free and with source code) There are examples of task and composite nodes. https://forums.unrealengine.com/showthread.php?88313-Dialogue-System

I’ve seen your answer. And I think UBTTaskNode is a more general class to inherit from. However, I met a problem in my project. I need to tick in the task node, but I don’t know how to finish execute successfully. A simple return can’t finish the task node.