I require some help with the QuestConditon.
What I was trying to achieve, is to have a custom QuestCondition which in StartChecking() would check if the condition is already true, and if it is, then calls SetTrue().
Code: Select all
public override void StartChecking(System.Action trueAction)
{
base.StartChecking(trueAction);
//if (AlreadyTrue())
//{
// SetTrue();
// return;
//}
Subscribe();
}
I am using this custom QuestCondition as an AutoStartCondition.
The problem with my approach is that it causes a StackOverflow error in this bit of the code:
Code: Select all
public void BecomeOfferable()
{
try
{
QuestState state = GetState();
Debug.Log(state);
if (GetState() != QuestState.WaitingToStart)
SetState(QuestState.WaitingToStart);
questOfferable(this);
SetQuestIndicatorState(questGiverID, QuestIndicatorState.Offer);
}
catch (Exception e) // Don't let exceptions in user-added events break our code.
{
if (Debug.isDebugBuild) Debug.LogException(e);
}
}
Please let me know if the above explanation is clear.