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.
That work just well. The problem is that as soon as I save and quit, or I reload the game, these two reset to their original value. No other variable do that, and I dont know what to do.
Last edited by nature1996 on Fri Jun 30, 2017 9:05 pm, edited 1 time in total.
default fact=[None, None, None, None]
default ifact=["item 1","item 2","item 3","item 4"]
label start:
"Whatever you have going on."
A Close Shave:
*Last Thing Done (Aug 17): Finished coding emotions and camera for 4/10 main labels.
*Currently Doing: Coding of emotions and camera for the labels--On 5/10
*First Next thing to do: Code in all CG and special animation stuff
*Next Next thing to do: Set up film animation
*Other Thing to Do: Do SFX and Score (maybe think about eye blinks?)
Also, i called them in a init section befor the start label
This is probably the case. Code in init section is executed every time game is started or loaded. So, if there is something setting variables to some value, these variables would be set to that value, overwriting any saved data.
Do not assign anything in init section unless you intend to never change those variables
As I sqid before, I tried it three way (default define and init) and all the time my value dissapear. Also, I have a lot of other variable wich value are saved wich are called in the init section.
I believe the problem might be because its an array, but I don't know....
I will try to put a part of my code later on.
Edit: I tryed it again as default, and I deleted the save file and recompiled everything, and now it works.
nature1996 wrote:
Edit: I tryed it again as default, and I deleted the save file and recompiled everything, and now it works.
Default is the way to go (except for persistent variables which use define). There was a more complicated way of doing it all before default was introduced, but now we have default, and that is the way to go.
A Close Shave:
*Last Thing Done (Aug 17): Finished coding emotions and camera for 4/10 main labels.
*Currently Doing: Coding of emotions and camera for the labels--On 5/10
*First Next thing to do: Code in all CG and special animation stuff
*Next Next thing to do: Set up film animation
*Other Thing to Do: Do SFX and Score (maybe think about eye blinks?)