Just another thing that I have found and wanted to share.
Remember we talked about the NullException error that would happen if no Urgencies Functions were assigned to any of the Entities, thus it would fail to Determine the Goal?
I have realized that you actually included a Debug for it, but it is positioned after the coroutine breaks, thus it does not get to the Debug statement.
In the QuestGenerator script, in the DetermineGoal()
Code:
Code: Select all
// Search world model for most urgent fact:
Fact[] mostUrgentFacts;
var cumulativeUrgency = worldModel.ComputeUrgency(goalSelectionMode, out mostUrgentFacts, ignoreList, detailedDebug);
var mostUrgentFact = ChooseWeightedMostUrgentFact(mostUrgentFacts);
if (mostUrgentFact == null) yield break;
if (cumulativeUrgency <= 0)
{
if (QuestMachine.debug || detailedDebug) Debug.Log("Quest Machine: [Generator] " + entity.displayName +
": No facts are currently urgent for " + entity.displayName + ". Not generating a new quest.", entity);
yield break;
}
Code: Select all
// Search world model for most urgent fact:
Fact[] mostUrgentFacts;
var cumulativeUrgency = worldModel.ComputeUrgency(goalSelectionMode, out mostUrgentFacts, ignoreList, detailedDebug);
var mostUrgentFact = ChooseWeightedMostUrgentFact(mostUrgentFacts);
if (cumulativeUrgency <= 0)
{
if (QuestMachine.debug || detailedDebug) Debug.Log("Quest Machine: [Generator] " + entity.displayName +
": No facts are currently urgent for " + entity.displayName + ". Not generating a new quest.", entity);
yield break;
}
if (mostUrgentFact == null) yield break;
Artem