Page 1 of 1

Problem with custom QuestCondition

Posted: Fri May 28, 2021 8:12 am
by AArtlone
Hi again!

I am having a small problem where the StopTracking method of QuestCondtion is being called twice after calling SetTrue().
One.png
One.png (59.05 KiB) Viewed 525 times
The screenshot above should provide enough context. Please let me know if something is not clear.

So after the textEvent is invoked, the console will print "a" twice.

My question is if it is intended or maybe I am doing something wrong.

Thanks in advance.

Re: Problem with custom QuestCondition

Posted: Fri May 28, 2021 10:51 am
by Tony Li
Hi,

That's a safegaurd. The condition should only be actively checking when its node is active. When the node changes state to true or inactive, it tells its conditions to stop checking. When the entire quest's state changes, it also tells all nodes' conditions to stop checking in case they're currently checking. This handles the edge case where something manually forces the entire quest's state.

If you're concerned about this in your custom condition, you can set a bool true in StartChecking. Then, in StopChecking you can check if the bool is set to true. If so, stop checking and set the bool false.

Re: Problem with custom QuestCondition

Posted: Fri May 28, 2021 11:53 am
by AArtlone
Thank you for your explanation :)