Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
Tags
(3 edits)

See below for some more details on persistent variables in web games!
---
The value of a persistent variable does not save on web versions until after the game has saved. So, it’s best to force web games to save whenever you change the value of a persistent variable. You can use quicksaves for this so that the player can’t access the saves that you use.

First add this code to your script, outside of a label:

##stop players from manually creating or loading quicksaves
init python:
    config.has_quicksave = False 

Then, use this code whenever you want to change the value of a persistent variable:

## example: when the true ending is read. replace with your own persistent variable
$ persistent.true_ending = True
## save the new value of the persistent variable
$ renpy.save('quick-1') 

Saving web games only works with third-party cookies enabled, so if your game uses this system you may wish to mention in the description that third-party cookies are required.