How to return failure in OnStart

caleidon

Member
I have a JobChooser composite that selects which job should be done.

The job first evaluates initial conditions that have to be met for the Action tasks to start running.

However, some conditions may only be evaluated in the Actions themselves.

Is there any way to make an early TaskStatus.Failure return from OnStart in an Action task?

I know I can have a bool prerequisitesMet = true; and in OnStart, I can check the conditions and if they all succeed then I can set it to true, otherwise to false. Then I can check in OnUpdate if prerequesitesMet is false, and if it is, return failure.

However this requires a local variable that I'd have to reset all the time, and I'd have to needlessly check this every update, even though it only needs to be checked once.
 
You cannot return failure within OnStart. You will need to go with your flag idea.
 
Top