GameMaker <unknown variable> not set?

JEMcG

Member
Hi, I've been following FriendlyCosmonaut's video series that instructs on how to make a Farming RPG.

In the section about Item descriptions I get the following error:



___________________________________________
############################################################################################
FATAL ERROR in
action number 1
of Draw Event
for object inventory:

Variable game.<unknown variable>(100084, -2147483648) not set before reading it.
at gml_Object_inventory_Draw_64 (line 78) - iitem = inv_grid[# 0, selected_slot];
############################################################################################
--------------------------------------------------------------------------------------------
stack frame is
gml_Object_inventory_Draw_64 (line 78)


I feel I understand variables and making sure they are set.
But I don't understand how GameMaker cannot know what variable is causing the issue?

I have tried swapping out "inv_grid" to just stating the grid being used and using 1 instead of "selected_slot".
iitem is used earlier in the code and I tried declaring, and then using a new variable for it. I still get this error.

Thanks for any help!
 

JEMcG

Member
Thank you for the help.

I didn't think to look above, assuming it was that line that was the problem.
It seems to have been the line above, I have no idea why but thanks for pointing me in that direction.
It had "var = description" which was the culprit... this does not link to "game" at all but when I changed this to "var = the text" it seems like it magically fixed.
 
Top