How to use Show Stats

I’m having trouble with the ‘Show Stats’ portion

The error I’m getting is: line 4 of choicescript_stats: Non-existent variable ‘name’

My code looks like this:
This is a stats screen!

text name
percent intelligence
percent wisdom

I followed the one on the mygame folder from ChoiceScript. I was wondering if the mistake was the location of this code. Like, which page do I even input this code, in the choicescript_stats or startup?

Send help. I need help. Please. Thanks. Bless your kind soul. :smiley:

1 Like

Hi, you need to have all stats and variables listed in your startup.txt file. You list stats in your startup.txt file by using the *create command. So you would need to put

*create name ""

in your startup file for the name stat to work. The same goes for all your other stats. You can see more examples here on the ChoiceScript wiki. Do your best to try these tutorials out as well as utilizing the Ultimate Noob Coding thread!


Help sent. May this be helpful to you.


thank you for this very much. bless you.

1 Like

Hi. I’m having the same problem.
This is what I put in my startup file:
*create firstname “unknown”
This is what i put in my choicescript_stats file:
Name: $!{firstname}

And this is the error message I keep getting:
"line 5 of choicescript_stats: Non-exixtent variable ‘firstname’

I have no idea what to do. Shouldn’t it just show the Name as blank? It won’t even go to the stats page, at all. Thank you, David.

That’s weird! First thing I’d ask is: how are you coding? Did you save your startup file before running the game? Is your startup file named startup.txt and in the right place—e.g. in your game folder?

Yes, I saved the game before running. And, yes, the file is startup.txt - Maybe should i restart?

This kinda stuff happens to me all the time. Ugh

Are you using CSIDE or another way to run your game?

Yes. Does the error occured in dashingdon or in your computer locally?