What type of task to use for getting information?

caleidon

Member
Let's say that 3 of my Action tasks all need to get and use a random position on the map.

For this purpose, before my Actions in a specific sequence, I'd want to make a "Get Random Position" task.
My question is - what type of task should this be?

It's definitely not a composite.
From the given examples I'd say that it isn't a decorator.
It's not an action because it doesn't change world state but only observes and returns information.
The closest thing it seems it could be is a Conditional - however that name is pretty self explanatory and when I hear "conditional" I think of tasks that return true/false values (like WithinSight in the tutorial).

What is a good way to write reusable tasks like described above, that only observe a certain part of the world and then return that information to then share it via SharedVariables to the next tasks in sequence?
 
This does sound like it fits as an action task. It's similar to the Get Position transform task. While it doesn't change the state of the scene, it does change the state of the behavior tree (you now have a new variable value) so action task makes the most sense.
 
  • Like
Reactions: zsj
Top