This time, I’m struggling with errors regarding my stats. I am using CSIDE on Windows.
I clicked the arrow to run the Project. Then I clicked the “Show Stats” button and then I selected Inventory. My stats screen is giving me the error “non-existent variable.” But I have the variables listed and set in my startup.txt. I’ve tried it a few different ways, and I’m still getting the same message.
This is what it is currently:
Stat Screen ~
*label screen
*choice
------ #Inventory
-------------*stat_chart
------------------- text Ingredients
Startup.txt ~
*create Ingredients
*temp Ingredients 0
I’ve tried it this way:
Startup.txt ~
*create Ingredients
*set Ingredients 0
and
*create Ingredients 0
(There are more variables under Ingredients, and I assume they would show the same error.)
And still it’s showing “non-existent variable” on my stats for Ingredients. I can’t see what I’m missing, so any help would be greatly appreciated!!
EDIT: The dashes are not in my coding. They indicate indentation.
Just to get the obvious out of the way, are you being wholly consistent as to the capitalization of “Ingredients” throughout?
Also, “create Ingredients” won’t do anything–if you want it to be numerical, then
is fine.
But if you want it to be a string, you have to say something like *create Ingredients “mandrake” or *create Ingredients “none” or even *create Ingredients “”
Finally, remember that you have to *create everything before you start *setting stuff.
I used *create Ingredients 0 and it said error. I want the variable to be Ingredients. Ingredients is the variable.
@EclecticEccentric So . . . I can’t start the variable at zero? I wanted it to start at zero and go up and down throughout the game as ingredients are found/used. I want the variable Ingredients to be numerical.
It’s always good to post all your code whenever you can (though this obviously gets difficult with full games). Errors are very often caused by code unrelated to where the error is actually occurring. I’m glad this one easy to solve for you. Enjoy!