How do i add variables?

I need some help! I’m making the stat chart and there are som problems. I’m making a romance game so i want it to be possible to see the percent for each spouse for example
*stat_chart
percent Ethren
(Ethren is the name for one of the spouses)
but i get a message saying Non-existent variable “ethren”
i have tried another way like this:

*stat_chart
percent “Ethren”

And the same thing happend.
So pleas i need some help!


*stat_chart
 percent ethren

Do not use “” around the var you are calling.

*edit
Please note you should not use capitals as this can cause you a great deal of grief. Also make sure you have the var setup on the startup.txt Hope this helps.

I’m sorry it didn’t work i got the same problem again, but thanks for the help!

@Linnis how do you have the stat setup?

*edit so you are name the spouse?
startup.text


*create spouse1 10
*create spouse1_name “”

If it something like that then you can set the stat whatever name


*choice
 #Suzan
 *set spouse1_name "Susan"
 *goto whatever

Then in the stat screen


*stat_chart
 percent spouse1 ${spouse1_name}

Have you done

*create ethren 10 (or whatever number the relationship starts at?)

Thanks it works now! It was easier than i thought :stuck_out_tongue:

Happy we could help :slight_smile:

Yep. Just to be clear, cause this catches a lot of people out: you create stats in startup.txt, not choicescript_stats.txt. The latter is the stats display file, determining what shows up when readers click the Stats button. You can create plenty more stats than just the ones you display.

Good that you wrote that! because it was hard to understand how you should do in the begining and i think it’s more people than me who needs help with it :slight_smile: