I noticed QuestMachine uses a counting mechanism when checking if the conditions for a questnode etc. are met. However, it would be handy if QuestMachine could keep track of all the different conditions and only count a true condition if it had not already been true.
I refer to the following code in the class QuestConditionSet:
Code: Select all
private void OnTrueCondition()
{
numTrueConditions++;
if (areConditionsMet) SetTrue();
}
public bool areConditionsMet
{
get
{
if (conditionList == null || conditionList.Count == 0) return true;
switch (conditionCountMode)
{
case ConditionCountMode.All:
return (numTrueConditions >= conditionList.Count);
case ConditionCountMode.Any:
return (numTrueConditions > 0);
case ConditionCountMode.Min:
return (numTrueConditions >= minConditionCount);
default:
if (Debug.isDebugBuild) Debug.LogWarning("Quest Machine: Internal error. Unrecognized condition count mode '" + conditionCountMode + "'. Please contact the developer.");
return false;
}
}
}
I thought about removing true conditions from the quest condition set, but maybe you don't always want this behaviour... anyway, is it possible to add a feature like this or should I use custom quest conditions for that?