Discuss how to use the Ren'Py engine to create visual novels and story-based games. New releases are announced in this section.
Forum rules
This is the right place for Ren'Py help. Please ask one question per thread, use a descriptive subject like 'NotFound error in option.rpy' , and include all the relevant information - especially any relevant code and traceback messages. Use the code tag to format scripts.
I was told that I must use default when declaring flags for variables that can change during gameplay. It turns out that variables declared with $ can also be changed and saved. Was this a recent change to renpy?
It does the same thing - sets the variable's value, but also adds the variable if it wasn't declared before (useful for patches and addons for the game).
So, you still can declare (sets the default value) your variables in label (at the very beginning of the start label - to prevent situation when you try to evaluate variable that wasn't declared (set, created) yet).
As you have read(https://www.renpy.org/doc/html/save_load_rollback.html), things that have changed in game are saveable, so it's ok if you change the variable using one line python code ($-sign), or use screen action, or python block. Take note, that "Saves occur at the start of a Ren'Py statement ", so you unable to properly save game state in the middle of python block. The same is about screens - you can interact with screen, change variables, but changes will be saved when the next Ren'Py statement will be executed (unless you've use renpy.retain_after_load).