Showing/Excluding a Custom Screen during Rollback

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.
Post Reply
Message
Author
User avatar
A Hazard
Regular
Posts: 25
Joined: Sun Jun 29, 2014 4:02 pm
Completed: Gilded - The Lily & the Cage
Projects: Fragment - A Broken Fairy Tale
Tumblr: fragmentfairytale
Deviantart: fragmentfairytale
Contact:

Showing/Excluding a Custom Screen during Rollback

#1 Post by A Hazard »

Hello, Ren'Py coding newbie here.

I currently have my Quick Menu set up as an expandable/collapsible menu. Click on a button (shown on the normal quick_menu screen) to show or hide the options (shown on a custom sub_quick_menu screen). It works great except during rollback.

If the player is trying to use the Back button on the GUI to rollback through several lines (instead of the mouse or keyboard shortcut) and didn't have the expandable menu open throughout, then they will have to keep re-opening the menu again with every line (since the sub_quick_menu screen is rolling back to a time before it was open every time).

Is there a way to exclude that particular screen from rollback or otherwise have it appear during rollback? I tried adding it to the action of the rollback button like so...

Code: Select all

textbutton _("Back") action [Rollback(), Show('sub_quick_menu'), SetVariable("sub_quick_menu_is_open", 1)]
but no dice there. I've also been dithering around with NoRollback, but I either end up blocking rollback entirely once the sub_quick_menu screen is shown or not excluding the screen at all. Any help is appreciated.

Valiowk
Newbie
Posts: 22
Joined: Sat Jan 02, 2016 8:32 pm
Contact:

Re: Showing/Excluding a Custom Screen during Rollback

#2 Post by Valiowk »

Upping this thread as I have the same question and am wondering if anyone has come up with a solution since then.

User avatar
Winterslice
Veteran
Posts: 230
Joined: Mon Sep 28, 2015 3:51 am
Completed: The Next World, Golem Creation Kit
Organization: Illuminated Games
Contact:

Re: Showing/Excluding a Custom Screen during Rollback

#3 Post by Winterslice »

You should be able to make the quick_menu show with a conditional based on a persistent variable, like:
$ persistent.your_variable_name

As I recall persistent variables don't participate in rollback. Someone correct me if I'm wrong.

Post Reply

Who is online

Users browsing this forum: Google [Bot], mirceea