StateTree: Change the value of a variable in an Evaluator through a Task

Hello, currently I am experimenting with the StateTree-Plugin as an alternative to the BehaviorTree.

My goal: I Want to change a value of a variable in a StateTree-Evaluator but through a StateTree-Task.

Problem: I tried several ways in StateTree like via binding variables, but that doesn’t work… No matter what i do, the StateTree-Task doesn’t change the value in the StateTree-Evaluator’s variable.

My understanding of the the StateTree-Evaluator is that is behaves similar to the BehvaiorTree’s BlackBoard, which holds a set of global variables for the BehvaiorTree. But somehow, no matter what, I cannot change the variable’s value in the StateTree-Evaluator through a StateTree-Task…

Maybe I am wrong about the concept. If that’s the case, how can I accomplish something similar and create a global set of variables for the StateTree-Tasks?

For anyone out there interested in the answer of my question:

It’s not possible manipulating the value of a variable of an Evaluator via a StateTree-Task. People I have talked with told me, if that is realy needed, to create global variables e.g in the Player’s AcotrBP and is refere to that Actor in the “Context”-Section of the StateTree so that the tasks or any other area of StateTree can read/write those values via the vairable in that Actor.

The StateTree-Evaluator is NOT similar to the BehaviorTree’s BlackBoard (!).

Cheers.

Hi OppaAi,

You are correct that Evaluators are not meant to be the “Blackboard” of StateTree. We also introduced Global Tasks that I would recommend using instead of Evaluators. Global Tasks run for the lifetime of the StateTree. These can be useful in exposing external data to the tree, configuring event listeners, and cleaning up the tree when stopping.

If you are wanting something similar to a blackboard, you should look into StateTree parameters. In 5.4, we introduced FStateTreePropertyRef which you can use to get a pointer to the data which allows changing the value of the parameter. There are limitations on the types that can work with the property ref and those are found in the StateTreePropertyRef header.

-James