Changing variables after game over?

Hi everyone. I was wondering if there is a way to save some variables’ values after a game over.
For example, if VarA is 1. Then I lose and it’s game over. When I play again, I want the VarA to be 2.
Like some kind of game over counter.

This is not only for a counter, it’s also for saving some config and options after a game over. I just made the question in the most general way I could with variables.

If you could give me an example, that would be great.

1 Like

It sounds like you want to read and write files – either read and write text from files, or save and load tables / tabular data.

1 Like

Thanks, it was that. It took me a while to understand it, but I think I get it now. Thanks a lot!

1 Like

Also, take a look at Emily Short’s “Recorded Endings” extension. That writes information to a file that can be read during the game to modify parameters. The example is if the player drinks poison and dies, you can record “death by poison” as an ending, and if it is a “used” ending, the game can tell that and print a message that’s different from the first play.

I was able to modify it slightly for The Baker of Shireton to remember game info that wasn’t necessarily an ending.