Reply To: Various questions

Forums 💬 NodeCanvas ⚙️ Support Various questions Reply To: Various questions

#19334
Gavalakis
Keymaster

    Hello,

    To answer your questions:

    1. If the MoveTo function in your npc is an IEnumerator, you can use ExecuteFunction to execute it as a coroutine, without the need to write a custom task.
    Regarding your custom task code, it is correct although it can be improved. For example, within a Task, you always have access to the agent with the inherited ‘agent’ property. The ‘agent’ property returns a Component type. When using the [AgentType] attribute like you have done here, that Component is certain to be of the type you specified. So you already have a reference of BALA and you don’t really need to also use [GetFromAgent], although it’s certainly possible.
    Furthermore you can use BBVariables instead of normal variables, if you want to be allowed to assign the variables from the Blackboard. Here is the improved code:

    Also dont worry about get component since that is done only in initialize and is cached.

    2. You can Start/Resume, Stop, Pause a behaviour with relative functions that are in the BehaviourTreeOwner class.
    Please take a look here: http://nodecanvas.com/documentation/node-systems/behaviour-trees/control/

    3. You can either use Nested DialogueTrees, or use this action to make a DialogueActor say something without the need of creating a nested dialogue tree.

    Is this what you mean?

    Cheers