I’m bumping into NullPointerExceptions and IndexOutOfRange exceptions left and right in this course even when trying to do exactly what Sam is doing in the course. I actually don’t know how Sam managed to get through some of these videos without triggering an exception on the video
I’ve managed to figure out two of them and it looks like many people here did too. Does a consolidated list exist? It would be great to have a consolidated reference (no pun intended) of bugs to fix especially while the course is fresh in our heads.
If no list exists maybe we can start one:
-
Attempting to get status on a quest you don’t have returns a null because we attempt to call IsComplete() on null This happens a lot on the condition checks in dialogue
CompletedQuest -
Any dialogue that ends with the player turn returns an IndexOutOfRangeException because PlayerConversant.Next() attempts to get the an element out of an array that has 0 elements.
Index out of range exception
I like these courses a lot but there are three main categories of feedback for making them better.
- Would like to see better habits with checking null values and boundary conditions
- I am not expecting bug-free code. It would be great if each course had a forum post maintained by gamedev.tv containing all the unresolved bugs and their fixes in a consolidated spot.
- It would be great if some of these gnarly bugs were selected for examples of how to write unit tests and regression tests in Unity. I have explored this a tiny bit and it’s non-obvious how to do this Unity.