Choicescript stats page and variables

Afternoon all!

I’m having a look at the stats page and I want to have a variable that increases every time you go on the stats page.

At the beginning of my choicescript_stats page I have a simple line that says

*set count +1

This variable is defined at the beginning of the startup file.

The value increases fine but then if I leave the stats page and then go back to it the value won’t have increased any further.

I’m using CSIDE and the track variable option (i’ve also used some conditional if statements to check the values are being reported correctly).

So I enter the stats page and this values goes from 0 to 1.
I leave the page (via the return to game button) and CSIDE reports the value hasn’t changed.
I then go to the stats page and it reports the value goes from 0 to 1 again.

I did wonder if I was being stupid with my *set command syntax so I tried *set count count+1 just in case. Same difference. I’ve reloaded all my files and rerun the game and it’s the same. I must be missing something obvious but
I’ve got family visiting unexpectedly so I am a bit rushed.

Hopefully this all makes sense. Finally I DID get this to work once, when I had two consecutive line with the *set count +1 in place. But then when I reloaded it stopped working and I cannot replicate it.

Sorry for the chaotic post!

edit: the only possible scenarios I can see are that I’m either setting the variable incorrectly and it’s just assigning the value rather than adding to it. I have checked my code and I have other lines that work absolutely find outside of the stats screen. Or the values reset when you leave the stats page - but I’m not seeing the value change when I track it…

1 Like

There’s actually a similar problem posted few weeks ago.

This is the thread if you want to take a peek.

But to summarize it, the change happened inside the stats page will only take place when you progress on the main story (which is done by either pressing NEXT button or making a choice on the story)

That being said, you can go stats screen > main game > stats screen > main game over and over again, but only the changes occured on the most latest “> stats screen” will take place.

As for a note, tablet user can play CoG/HG games with both main story and the stats screen page active at the same time. Perhaps, this helps you to imagine how altering stats on the stats screen works.

P.S. It’s night at here :roll_eyes: