Problem with custom QuestCondition

Announcements, support questions, and discussion for Quest Machine.
Post Reply
AArtlone
Posts: 37
Joined: Tue Mar 09, 2021 2:54 am

Problem with custom QuestCondition

Post 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 523 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.
User avatar
Tony Li
Posts: 21925
Joined: Thu Jul 18, 2013 1:27 pm

Re: Problem with custom QuestCondition

Post 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.
AArtlone
Posts: 37
Joined: Tue Mar 09, 2021 2:54 am

Re: Problem with custom QuestCondition

Post by AArtlone »

Thank you for your explanation :)
Post Reply