Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
Tags
(1 edit)

Sometimes the default value is null and sometimes it's '' (empty string).  There is an issue with inconsistent usage of default values, but it shouldn't have caused error messages if the GUI was correct.

Adding this line to the end of _on_alchemy_pressed() will disable the "Brew" button until a new potion is selected and the ingredients are checked.
          get_node("MainScreen/mansion/alchemypanel/brewbutton").set_disabled(true)

typeof() returns the current type of the variable using the enum values found in this link:
https://docs.godotengine.org/en/3.1/classes/class_@globalscope.html#enum-globals...
Someone was lazy and left a 4 instead of TYPE_STRING. They are equivalent, but the latter is more clear.

Your changes to the default value usage are a valid way to stop the error messages. Though "&& typeof(potselected) != 4" could be removed as it was checking that potselected was not the default value of ''.

The faster way to fix the default value usage would be to change the first condition in _on_brewbutton_pressed() to compare against '' instead of null, but I prefer using a null default value as it is much more clear.