When someone loads my game, I want it to also load the same variables that were originally saved, not to continue using variable values gained from progression in the game.
For example. Let's say I have the variable vcheck = "false". Right now if I save a gameplay and then continue on to points in the game that set, vcheck = "true". then when I load back to that save, vcheck is still equal to "true" instead of "false". I want the game to load back to when vcheck = "false", how do I do this?
Sorry if this is a stupid question. I'm still pretty new to the language and I had no idea how to search for this kind of question.
I already read up on persistent variables and such, but that seems to be the opposite of what I'm looking for.
Q on variables and save/load
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.
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.
-
- Newbie
- Posts: 1
- Joined: Sun May 08, 2011 10:48 am
- Contact:
Re: Q on variables and save/load
quite strange behaviour, 'cause it must use "vcheck"'s value that was saved before. So, are you shure that you use proper save, or saved value was actually "True"?
Random thoughts:
1. When you make changes to your code you should start your game from very beginning and make new saves - old saves uses old (unchanged) code.
2. How do you change your variable?
Also, Ren'py is unable to save game state in the middle of python block. Or you can met some troubles when change values through the functions or use "call" function.
It would be much easier to find the problem if you post your code.
Random thoughts:
1. When you make changes to your code you should start your game from very beginning and make new saves - old saves uses old (unchanged) code.
2. How do you change your variable?
Code: Select all
label start:
$ my_var = False
"If you save here, the value would be 'False'."
scene black
$ renpy.pause (3.0) # the value would be 'False'
$ my_var = True
"If you save here, the value would be 'True'."
It would be much easier to find the problem if you post your code.
Who is online
Users browsing this forum: Google [Bot]