Ok as I said before maybe I’ve put the bar a little too high BUT and it is a BIG BUT I want to write this and apparently I am unable to find the answers myself… I feel very stupid I must admit.
Here is problem two for today…
Trying to see if I’ve got the stats page working ok but keep getting this message: choicescript_stats line 79: Non-existent variable ‘animalcare_text’
But here is everything I have linked to animal care.
“temp” stats only work in the document that they’re in. I don’t know how you set up your game documents, but I’ll use an example to help describe this.
Let’s say you have three documents:
Your startup document, where you create the “animalcare” stat
Your game documents, where you have all of the code and other writing for your game (You should have multiple game documents, one for each chapter or section, but the only one we need is the document that you wrote the “temp animalcare_text” in).
Your stats page, where you are trying to display the “temp animalcare_text” stat.
So, the problem is - like Gower said - the temp stat is only a stat in the document you created the temp stat in, which probably isn’t the stats page. So outside of the document it was created in, your “temp animalcare_text” stat doesn’t exist. To solve your problem, you just have the change the temp stat into a real stat by creating a *create animalcare_text “” into your startup page. Then your animalcare_text stat will exist throughout all of your game documents, and not just the one it was created in.
Yeah the problem is that the temp variable is only good for the scene file it’s in. The choicescript stats counts as a separate file, so when you go into the stats page that variable is wiped and you’re telling ChoiceScript to display something that doesn’t exist.
Two things come to mind, though I’m unclear if either is actually an issue here. First: Is line 79 properly indented under a *stat_chart statement on line 78? 78 and 79 together should look something like this:
*stat_chart
text animalcare_text Animal Care Level
Okay, technically you can put several different stat charts under a single *stat_chart statement, so the *stat_chart line 79 depends on doesn’t, strictly speaking, need to be line 78. But line 79 absolute does need to be indented under a *stat_chart somewhere nearby.
Second: Is the code that creates the temporary variable and sets its value (starting with *temp animalcare_text "") before or after lines 78 and 79? ChoiceScript needs to be able to run those lines before it gets to line 79 where the variable will actually be used.
If none of that works to clear up the issue, what happens if you try deleting the *temp animalcare_text "" line entirely, then add a *create animalcare_text "" in the startup.txt file?
Hey guys I know I’ve already decided to do it differently but you do understand that I did have my create in the startup and the temp in the stats right?
I figured what was wrong. I was setting up variables before putting them in the game so the tests must have seen them as useless or not needed.
I did it!!