Documentation

Learn how to use NodeCanvas

Creating Custom Tasks

NodeCanvas is built around the concept that the nodes of the graph are responsible only for the flow and not what and if it happens. Tasks are responsible for that and thus there are two kinds of Tasks those being Action Task and Condition Task. Tasks are assigned to nodes that require them and thus Tasks can be reusable between different types of systems. This concept allows to decouple the graph design from the actual implementation of actions or conditions thus allow for a non-destructive workflow.

NodeCanvas includes a Task Wizard utility window that makes it easier for you to create new tasks. The Task Wizard can be accessed via the right click menu in your “Assets” and under “Create/ParadoxNotion/NodeCanvas/New Task”.

Action Tasks

In short, to create an Action Task you must derive from the ActionTask base class and override the virtual methods as needed. When the Action is complete you must call EndAction(bool) to end the Action either in success or failure depending on the bool argument passed and that’s it!

Following is the core API that you can use to create your own action tasks.

Examples

A simple action would be like this:

A simple delay would be like this:

Condition Tasks

In short, to create a Condition Task you must derive from the ConditionTask base class, override the virtual OnCheck method and return the result.

Following is the core API for creating custom condition tasks:

Examples

A simple condition example.

Yes No Suggest edit
57 of 60 users found this section helpful
Suggest Edit

© Paradox Notion 2014-2024. All rights reserved.