I was looking through the documentation about saving variable data during game saves and rollbacks and the like, and I think I understand the difference...but I'd love to have you veterans confirm:
Code: Select all
init:
$ cookies = 2
$ cakes = 1
$ poisons = 10
label start:
"Mary Goody-TwoShoes looked in her picnic basket...she found..."
So, if I understand correctly, in this instance, no variables are saved on the saved game and rollback data. Though...a question I have is...wouldn't you still have the initial values from the init block when the game is started up?
Code: Select all
init:
$ cookies = 2
$ cakes = 1
$ poisons = 10
label start:
$ cookies = 1
"Mary Goody-TwoShoes looked in her picnic basket...she found..."
$ cookies = 0
$ poison = 21
So in this instance if you save right before the "Mary Goody-TwoShoes" line the only data you save is cookies = 1, if you save at the end of the block, your saved variables are cookies = 0 and poison = 21. Right? But when you load the game, would the cake still be at default of 1?
My last question on this matter is, with this code:
Code: Select all
label start:
$ cookies = 2
$ cakes = 1
$ poisons = 10
"Mary Goody-TwoShoes looked in her picnic basket...she found..."
label grandma:
if cookies == 0:
m "Grandma, have some poison...um...cake."
Will that work? In other words, if you declare a variable in a start label block, can you refer to it in a different label block? Or, if you declare it in the start block, can you only refer to it in the start block? Because if so, it would make sense to declare in an init block so you can access the data in all blocks.
Lists seem to be the big red flag since appending seems to work differently than declaring...so none of that would be changed in saves. But generally, can you access the data declared under one label in a different label if the item wasn't declared in an init block?
I'd try it out myself, but I'm at work and away from Ren'Py!
Veterans, any insight in the details on this?
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?)
Check out My Clock Cookbook Recipe:
http://lemmasoft.renai.us/forums/viewto ... 51&t=21978