disable rollback button and skip button when you're inside a screen

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
dasauto1
Newbie
Posts: 21
Joined: Sun Oct 31, 2021 2:26 pm
Contact:

disable rollback button and skip button when you're inside a screen

#1 Post by dasauto1 » Fri Dec 17, 2021 7:56 am

Hello, the title kinda explains it. How to to disable skip and rollback for all screens? Like all together?

User avatar
zmook
Veteran
Posts: 421
Joined: Wed Aug 26, 2020 6:44 pm
Contact:

Re: disable rollback button and skip button when you're inside a screen

#2 Post by zmook » Fri Dec 17, 2021 11:27 am

"Inside a screen" isn't really a concept. It's perfectly common, for instance, to have a status overlay screen with money or time-of-day or something, and have it always visible. Technically the quick menu with the skip and rollback buttons *is* a screen. The dialog box is a screen.

Probably the best way to do something like this is to create a pair of functions, "disable_skip_rollback()" and "enable_skip_rollback()" and call them where it makes sense. I'd be happy to help more than that, but you'll need to explain more what you actually want to do.
colin r
➔ if you're an artist and need a bit of help coding your game, feel free to send me a PM

User avatar
Imperf3kt
Lemma-Class Veteran
Posts: 3636
Joined: Mon Dec 14, 2015 5:05 am
Location: Your monitor
Contact:

Re: disable rollback button and skip button when you're inside a screen

#3 Post by Imperf3kt » Fri Dec 17, 2021 8:10 pm

I assume you have some kind of inventory screen or other screen you use for something and don't want players to be accidentally rolling forwards or backwards while that screen is shown?
Set modal to True for the screen, and that will fix issues with rollback/rollforward accidentally advancing the game etc.

Code: Select all

screen myscreen():
    modal True
Alternatively, you can use

Code: Select all

call screen myscreen
to make a non-modal screen, modal until an action is performed and the user is returned to the game flow.
Warning: May contain trace amounts of gratuitous plot.
pro·gram·mer (noun) An organism capable of converting caffeine into code.

Current project: GGD Mentor
Free Android GUI - Updated occasionally
Twitter
Imperf3kt Blackjack - a WIP blackjack game for Android made using Ren'Py

Post Reply

Who is online

Users browsing this forum: No registered users