I've implemented a composite called "JobChooser" which will assign a job (chop, mine, farm) to an agent.
It does so by checking the requirements and running the appropriate job, which looks like this:
The three jobs as seen above are references to external behavior trees that expand at the startup.
My problem is that I need to have dynamic variables passed to these jobs and I'm not sure what the best way is to do it.
I don't think I can use SharedVariables because I'd need to have ALL possible combinations of the required information (dozens, possibly hundreds) of shared variables defined in the "Job Chooser" so that they can get passed down to the individual tasks.
EXAMPLE: The "Chop" task gets chosen for execution. It requires two arguments - tree_position and tree_id. These two arguments become known in the Job Chooser's "CanExecute()" override, where it first checks if a job is possible, and if it is, it defines that that task will run next and needs to pass the arguments.
What's a good way of doing this?
It does so by checking the requirements and running the appropriate job, which looks like this:
The three jobs as seen above are references to external behavior trees that expand at the startup.
My problem is that I need to have dynamic variables passed to these jobs and I'm not sure what the best way is to do it.
I don't think I can use SharedVariables because I'd need to have ALL possible combinations of the required information (dozens, possibly hundreds) of shared variables defined in the "Job Chooser" so that they can get passed down to the individual tasks.
EXAMPLE: The "Chop" task gets chosen for execution. It requires two arguments - tree_position and tree_id. These two arguments become known in the Job Chooser's "CanExecute()" override, where it first checks if a job is possible, and if it is, it defines that that task will run next and needs to pass the arguments.
What's a good way of doing this?