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.
So I'd like some clarification on how game menus work. I'm making a menu that is a 3 page booklet, where there are buttons to flip pages. Here's some code I whipped up to do this.
My question is this:
If I call page2, I am then given the option to flip to page1 or page3 (I know it works because the textbuttons highlight), but once I do, it flips to the said page and is then stuck; the button to flip back then becomes inactive. Why does this happen, and how do I fix it? This isn't a problem for the default using the navigation menu, so I know what I'm asking for is possible, but I'm very confused about it.
Last edited by TellerFarsight on Tue Jun 05, 2018 10:49 pm, edited 1 time in total.
Can you add tag menu in all the screens and see if that works?
Also your page3 screen is called playbill_page3() instead of page3 - but I'm guessing it's a modified version of your coded for our reference and you missed deleting the playbill part?
Alright so here's what happened. I had *tag menu* in the code before posting this but that didn't change anything, but I think I got mixed up and didn't re-run the program after saving the new code. Anyway, it works now.
Ah, that's when the Developer Tools are quite handy. If you do Shift-R to switch your game to autoreload mode, your game will reload automatically during script changes and image file changes.
Yeah I've been using that for a long time too, but the test build for my game is, for now, coded in such a way that when it autoreloads certain variable values get lost and the whole thing crashes, so often I just quit out and relaunch.
Long story short - use default for all variables that will change during gameplay (and thus needs saving) and only define variables that should never change during the course of the game.
Autoreload works by saving the game first then loading it when code is reloaded, so if it crashes during autoreload, chances are good it'll crash when players save and load the game. (speaking from experience here)
Yeah, trooper6 beat that lesson into me last year, I just hadn't gotten around to it. It never came up as a problem for this project until I started working with screens, and only then it crashes if I'm working with screens, I autoreload it to alter the screen, and then exit the screen to go back to the main game again and then quit out anyway. I'll fix it when I get home today, thanks for the reminder.