Custom composite task to evaluate conditionals on a list

peetlepapers

New member
I am trying to create a custom composite task that will allow me to select a gameobject from a list that satisfies all the child tasks. In the case where there are multiple gameobjects that satisfy the conditions, the task can be configured to return either the first one that succeeds, a random one, the closest one, etc.

1774891990394.png
In this example I want to update the target player by iterating over the list of players, and finding the ones that are alive, have a backpack, and are close enough to the enemy. Then the "Pick Object In List" task should pick one of the results based on the condition (first, random, closest, etc) and return success, or return failure if no player satisfies the conditions.

I am currently trying to use a dynamic variable that is set by the parent task to an element of the list for the children tasks to evaluate against. The documentation for composite tasks is virtually non-existant though so this is proving to be a big headache.

Is there a better way to do this within the existing framework? or could you provide guidance on how to implement this sort of composite iterator task?
 
Are you thinking of upgrading to Behavior Designer Pro? There is an iterator task in that package.

I haven't tried to create an iterator for the original version. I believe I saw someone who did it, but I don't have the code for it. The parent task callbacks are a little more verbose in the original version, but for this you could likely use
 
I honestly did not realize there was a behavior designer pro until i tried to implement this.. I thought I had purchased "Behavior Designer" not "Behavior Designer Early Access". The documentation on composite tasks essentially says it's self explanatory, so I should just try to make sense of the decompiled binaries? I genuinely love the framework but whenever I try to extend it i feel like im jailbreaking an iphone. You should provide access to the source or document it properly or at the very least answer questions instead of telling me to buy a newer version of it...
 
I’m glad to hear you like the framework overall.

Just to clarify, Behavior Designer (version 1) is not an early access product.. it has been available on the Asset Store since 2014 and is a stable, fully released system. The full source code for version 1 is also included on the downloads page, as noted in the documentation.

Behavior Designer Pro (version 2) is a separate product with a redesigned architecture, including DOTS support and other improvements. It’s not required to use or extend version 1.
 
Back
Top