64. Complex Conditions, Talk with enemy8 error

When I talk with enemy8, the error message disappears on the console window.

IndexOutOfRangeException: Index was outside the bounds of the array.
RPG.Quests.QuestList.Evaluate (System.String predicate, System.String parameters) (at Assets/Scripts/Quests/QuestList.cs:115)

		public bool? Evaluate(string predicate, string[] parameters)
		{
			switch (predicate)
			{
				case "HasQuest":
					return HasQuest(Quest.GetByName(parameters[0]));//<==problem
				case "CompletedQuest":
					return GetQuestStatus(Quest.GetByName(parameters[0])).IsComplete();
			}
			return null;
		}

Sorry about the delay on this, sometimes questions fall through the cracks.

The error is telling you that there are no parameters for the HasQuest to act on. If you take a look at your DialogueNode, you’ll see that this is the case:
image
Add a parameter with the name of the quest and you should be good to go.

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.

Privacy & Terms