One thing I never quite cleared up in the interaction between ren'py / python, is how to use variables in the right way, so that rollbacks work well and that saving/reloading functions as it should.
I've recently picked up ren'py again, so I don't have a specific example. Let me express how I think things work. I'm sure I've made a false assumption somewhere in this short explanation:
----
Correct me where wrong:
* When you want to use variables that are constants and don't change, you set them in an "init python:" block.
* When you want to use variables that can change, you set them with "default variable = xxx"
* You are allowed to set or change these variables with python
----
Question 2:
I like to use plenty of objects. Do the questions above work for objects as well?
Sorry if these are basic questions!
-----
Question 3:
Are there other things I should keep in mind so that reverting things works well?
(I use a lot of nested call / return to navigate the logic, rather than jumps)
Why are things going wrong with reloading games?
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.
Re: Why are things going wrong with reloading games?
Without a specific example illustrating a case where "things go wrong after rollback", it's difficult to give a definitive answer.
Although I agree with you in principle that not cancelling operations properly is a recipe for failure, in my (~6 hours) experience with Ren'Py, I feel that data being not perfectly cleared during rollback wouldn't be too much a problem in the case of a VN, which has generally rather simple "flow". I mean, even if multiple story branches, those can be solved with a few (same number of branches) variables : if in the normal flow of the story (without going back), you shouldn't have already "seen" your future choices (ie. going back is "meta"), if necessary you just reset your variable(s) at the start of each branch just to make sure rollbacking won't bite you in the nose.
Specific counter-example :
Plus, complex customization screens should always contain a button "reset to defaults" anyway.
Although I agree with you in principle that not cancelling operations properly is a recipe for failure, in my (~6 hours) experience with Ren'Py, I feel that data being not perfectly cleared during rollback wouldn't be too much a problem in the case of a VN, which has generally rather simple "flow". I mean, even if multiple story branches, those can be solved with a few (same number of branches) variables : if in the normal flow of the story (without going back), you shouldn't have already "seen" your future choices (ie. going back is "meta"), if necessary you just reset your variable(s) at the start of each branch just to make sure rollbacking won't bite you in the nose.
Specific counter-example :
- you display to the player a character appearance customization screen
- player customizes stuff, then goes to the next screen(s)
- player goes back to the character customization screen
Plus, complex customization screens should always contain a button "reset to defaults" anyway.
Who is online
Users browsing this forum: No registered users