Block continue or click

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
bluna
Newbie
Posts: 9
Joined: Sat Mar 30, 2013 1:36 am
Contact:

Block continue or click

#1 Post by bluna » Sun Mar 31, 2013 8:07 pm

How do you make it so throughout a certain portion of the code, the player cannot click or skip what is currently going on? I'm trying to make it so a certain part of the scene happens and match it up right with the music; But it won't flow right if the player skips through this portion, or opens the menue? How do i make it so that can't happen?

User avatar
nyaatrap
Crawling Chaos
Posts: 1824
Joined: Mon Feb 13, 2012 5:37 am
Location: Kimashi Tower, Japan
Contact:

Re: Block continue or click

#2 Post by nyaatrap » Sun Mar 31, 2013 8:17 pm

Code: Select all

$config.skipping = None
$config.rollback_enabled = False
$_game_menu_screen = None
#block of scene codes here
$renpy.pause(time, hard=True)
Don't forget to redeem rollback and game_menu later.

User avatar
bluna
Newbie
Posts: 9
Joined: Sat Mar 30, 2013 1:36 am
Contact:

Re: Block continue or click

#3 Post by bluna » Sun Mar 31, 2013 10:14 pm

Ah, ok. So say i have a sequence of things i want to happen, i put that before it, and when i want to give the player the ability to click and play again, i put that same code, but set them to true?
(kinda new to this)

User avatar
Gear
Miko-Class Veteran
Posts: 764
Joined: Tue Apr 05, 2011 10:15 pm
Projects: Tempestus Sum
Organization: Xenokos Interactive
IRC Nick: Gear
Skype: Skye.Gear
Location: Grand Prairie, TX
Contact:

Re: Block continue or click

#4 Post by Gear » Sun Mar 31, 2013 11:05 pm

I tried the code, but it didn't work for me; I didn't get any errors, but my sequence could still be interrupted by a mouse click. Adding the pause at the end only seems to make a hard pause you can't click past AFTER the section you're trying to make uninterruptible, unless I'm doing something wrong here.
The best reason to get up in the morning is to outdo yourself: to do it better than you've ever done it before. But if you haven't done it better by nightfall... look at your globe and pick a spot: it's always morning somewhere.

User avatar
nyaatrap
Crawling Chaos
Posts: 1824
Joined: Mon Feb 13, 2012 5:37 am
Location: Kimashi Tower, Japan
Contact:

Re: Block continue or click

#5 Post by nyaatrap » Sun Mar 31, 2013 11:15 pm

Code: Select all

config.rollback_enabled = True
_game_menu_screen = "save_screen"
is what you need to write later.

Also, you can't use say dialogues. If you need to show text, you need to use text displayables instead.
To do a complete auto advance requires several advanced knowledge on ren'py.

User avatar
nyaatrap
Crawling Chaos
Posts: 1824
Joined: Mon Feb 13, 2012 5:37 am
Location: Kimashi Tower, Japan
Contact:

Re: Block continue or click

#6 Post by nyaatrap » Sun Mar 31, 2013 11:30 pm

Lol I find a way to disable leftclick on say dialogue:

Code: Select all

screen disable_leftclick:
    key "mousedown_1" action With(None)

Code: Select all

label ending:
   show screen disble_leftclick
   "auto message{w=3}{nw}" 
I don't know if there is some side effect :P

User avatar
bluna
Newbie
Posts: 9
Joined: Sat Mar 30, 2013 1:36 am
Contact:

Re: Block continue or click

#7 Post by bluna » Mon Apr 01, 2013 3:45 am

Hmm..this doesn't seem to be doing what i'm trying to do; the first code didn't work for me either.

Is there a way i could just simply disable any input whatsoever and then enable it again later in the script?
Sorry for the bouncing back and forth. :(

apricotorange
Veteran
Posts: 479
Joined: Tue Jun 05, 2012 2:01 am
Contact:

Re: Block continue or click

#8 Post by apricotorange » Mon Apr 01, 2013 5:17 am

The way Ren'Py works, there isn't really any global switch to turn off keyboard/mouse processing.

The way to suppress processing of all keyboard/mouse input for a specific message is something like this:

Code: Select all

    $ narrator("You can't get rid of this message!", interact=False)
    $ ui.pausebehavior(5)
    $ ui.interact(suppress_overlay = True, suppress_underlay = True)
(This is similar to the first suggestion, but a bit more thorough, and hopefully a bit more clear.)

I wouldn't recommend it unless it's truly necessary, though: disabling access to menus etc. is really annoying for users.

User avatar
nyaatrap
Crawling Chaos
Posts: 1824
Joined: Mon Feb 13, 2012 5:37 am
Location: Kimashi Tower, Japan
Contact:

Re: Block continue or click

#9 Post by nyaatrap » Mon Apr 01, 2013 6:33 am

I like ren'py doesn't provide an easy way to stop interacts. People always use it in a frustrated way and its result is just annoy players. I only block it to execute high speed animation correctly.

User avatar
bluna
Newbie
Posts: 9
Joined: Sat Mar 30, 2013 1:36 am
Contact:

Re: Block continue or click

#10 Post by bluna » Wed Apr 03, 2013 2:24 pm

Hmm, i see. Is pause behavior the only type of code that can prevent keyboard/mouse input?

If so, how would you implement it for a scripted sequence?
The thing is, with a hard pause like that, it stops any progress for images, transitions, or any type of code to progress; when the goal is to allow the code to progress, but disable the user from skipping or interrupting it until a specified point in the script.

I apologize if i'm being redundant and stubborn, but is there really no way around this? I see things like this happen in VNs all the time; it just seems like a simple thing to do.

I understand that this might be annoying for users to not be able to skip, but is that a reason to have the player miss out on an experience you, the developer, want them to experience? It only happens once in the entire VN, so its not something i plan to be continuous.

apricotorange
Veteran
Posts: 479
Joined: Tue Jun 05, 2012 2:01 am
Contact:

Re: Block continue or click

#11 Post by apricotorange » Wed Apr 03, 2013 10:25 pm

You can implement complex scripted sequence using ATL: http://www.renpy.org/doc/html/atl.html .

User avatar
bluna
Newbie
Posts: 9
Joined: Sat Mar 30, 2013 1:36 am
Contact:

Re: Block continue or click

#12 Post by bluna » Thu Apr 04, 2013 5:46 pm

I see...thanks for the the help. It doesn't solve my problem, but i'll see if i can work around it.

Post Reply

Who is online

Users browsing this forum: No registered users