Disabling clicks during transitions

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.
Message
Author
Suikama
Regular
Posts: 119
Joined: Tue Apr 13, 2010 3:38 pm
Completed: Down on the Corner
Projects: Stories of an Eastern Paradise
Location: Ontario, Canada
Contact:

Disabling clicks during transitions

#1 Post by Suikama »

So I've been messing with Ren'Py for a bit now, and so far I'm linking all of it's features except how you can click to instantly skip transitions. Sometimes I like to use long (well not too long) fade outs for effect but if the play accidently clicks then that kinda ruins the effect. I've seen other renpy VNs have it disabled during transitions and things like the credits but I can't seem to figure out or find any information on how to do this.

Jake
Support Hero
Posts: 3826
Joined: Sat Jun 17, 2006 7:28 pm
Contact:

Re: Disabling clicks during transitions

#2 Post by Jake »

Suikama wrote:I've seen other renpy VNs have it disabled during transitions and things like the credits but I can't seem to figure out or find any information on how to do this.
On one hand, the answer is to use renpy.pause with the 'hard' parameter, e.g.:

Code: Select all

    scene bg black with Dissolve(2)
    $ renpy.pause(2, hard=True)
I seem to recall that this is undocumented, because PyTom doesn't like the idea of people using it for everyday things and prefers to keep it for long periods of transition-fuelled animation.

On the other hand, you should seriously consider whether it's a good idea or not. Forcing the player to sit through a long fade (where by 'long' I mean 'more than half a second') if they don't want to is pretty annoying; you should possibly consider that for most purposes, if they player clicks to skip your transition it's because they want to skip your transition, they don't care about the effect being spoiled, they just want to progress with the game... and removing from them the ability to do this may well frustrate them a lot.

I know I've not even tried to play games before because I heard from more than one source that there were annoying pauses or slow text sections; I doubt I'm alone.
Server error: user 'Jake' not found

Fireserpent
Regular
Posts: 57
Joined: Wed May 05, 2010 3:11 pm
Location: Sweden
Contact:

Re: Disabling clicks during transitions

#3 Post by Fireserpent »

I think it all depends on where it's used.

I have been looking for a way to do this as well, but only for specific instances. I like the idea of being able to skip things that you've done before, and stuff like that. But as an example where it could be used.

A character in my current dating sim gets psychic visions when she gets emotional, it's a form of magic, so they spread onto those around her, including the player, who sees them too. They are very quick flashes that last maybe a second or so. I found myself accidentily clicking right when they appeared, and I would miss them all together, which would completely mess up the dialogue, when the character talks about a vision, and nothing happened.. In those cases the hard pause makes a lot of sense..

Where it would be annoying would be to force the player to wait for long, drawn out scenes that he's already seen. (That drives me nuts when playing games)
A way to make this more tasteful could be to have a hard pause in the first second or two of the scene, and then make it clickable, just to make sure you don't miss an important event completely.. But if you've already seen it, just skip it..

Just some perspective on it. :)

Jake
Support Hero
Posts: 3826
Joined: Sat Jun 17, 2006 7:28 pm
Contact:

Re: Disabling clicks during transitions

#4 Post by Jake »

Fireserpent wrote: I found myself accidentily clicking right when they appeared, and I would miss them all together, which would completely mess up the dialogue, when the character talks about a vision, and nothing happened.. In those cases the hard pause makes a lot of sense..
Does it, though? A second could also be an annoyance on your second or subsequent playthroughs of the same game, when you're thinking "yeah, yeah, psychic vision, seen it before - just let me get on with the game". Remember that people playing the game for the first time won't be so click-happy as you are when you're skipping through for testing purposes, and there's always rollback if they think they've missed something.

Fireserpent wrote: A way to make this more tasteful could be to have a hard pause in the first second or two of the scene, and then make it clickable, just to make sure you don't miss an important event completely.. But if you've already seen it, just skip it..
Same problem - if the player's seen it before and wants to skip, you're not letting them... and if you pause for too much at the beginning the player may well try and skip, then find they can't, and assume they can't skip the scene at all and wait for the whole thing to play out, rather than waiting a second or two and trying to skip again.
Server error: user 'Jake' not found

Fireserpent
Regular
Posts: 57
Joined: Wed May 05, 2010 3:11 pm
Location: Sweden
Contact:

Re: Disabling clicks during transitions

#5 Post by Fireserpent »

You have a point. I guess it's something that would have to be tested for that particular game (with people who play it through a couple of times)

I personally see both sides of the argument, and I'm not really biased towards any particular way to do it.. I'm just looking to create the best experience for whoever plays the game.

Suikama
Regular
Posts: 119
Joined: Tue Apr 13, 2010 3:38 pm
Completed: Down on the Corner
Projects: Stories of an Eastern Paradise
Location: Ontario, Canada
Contact:

Re: Disabling clicks during transitions

#6 Post by Suikama »

Jake wrote:
Suikama wrote:I've seen other renpy VNs have it disabled during transitions and things like the credits but I can't seem to figure out or find any information on how to do this.
On one hand, the answer is to use renpy.pause with the 'hard' parameter, e.g.:

Code: Select all

    scene bg black with Dissolve(2)
    $ renpy.pause(2, hard=True)
I seem to recall that this is undocumented, because PyTom doesn't like the idea of people using it for everyday things and prefers to keep it for long periods of transition-fuelled animation.

On the other hand, you should seriously consider whether it's a good idea or not. Forcing the player to sit through a long fade (where by 'long' I mean 'more than half a second') if they don't want to is pretty annoying; you should possibly consider that for most purposes, if they player clicks to skip your transition it's because they want to skip your transition, they don't care about the effect being spoiled, they just want to progress with the game... and removing from them the ability to do this may well frustrate them a lot.

I know I've not even tried to play games before because I heard from more than one source that there were annoying pauses or slow text sections; I doubt I'm alone.
This is it's not just for transitions, but thing like animations as well. Anyways thanks for the help!

Suikama
Regular
Posts: 119
Joined: Tue Apr 13, 2010 3:38 pm
Completed: Down on the Corner
Projects: Stories of an Eastern Paradise
Location: Ontario, Canada
Contact:

Re: Disabling clicks during transitions

#7 Post by Suikama »

Hmm... I tried i out and unfortunately it doesn't work. Clicking still skips the transition, only now it forces a random pause afterwards on top of that.

Suikama
Regular
Posts: 119
Joined: Tue Apr 13, 2010 3:38 pm
Completed: Down on the Corner
Projects: Stories of an Eastern Paradise
Location: Ontario, Canada
Contact:

Re: Disabling clicks during transitions

#8 Post by Suikama »

Alright I've messed with renpy.pause for a bit and figured out what it can and can't do.

What it can do is allow for animation of something, say for example a splash screen, and make it unskipable. So for example let's say the good ol SEGA logo is 60 frames long at 10 frames per second. If I wanted to have it appear in my Ren'Py game at the beginning but I wanted it to be unskippable (because I worked for SEGA or something), then I'd have to define every frame, then show each frame and then pause for a frames worth of time for each image, which in this case would be 1/10=0.1 seconds.
So the code would look something like:

Code: Select all

$ renpy.pause(0.01, hard=True)
    show s 00
    $ renpy.pause(0.01, hard=True)
    show s 01
    $ renpy.pause(0.01, hard=True)
    show s 02
    $ renpy.pause(0.01, hard=True)
    show s 03
    ...
And so on. Of course not only is this tedious, but you would need to have every frame of the thing you wanted to animate beforehand.

Now let's say I wanted the logo to fade out after that little animation. I could simply use with Fade, but wait! renpy.pause does not apply to any transitions, so if I wanted to make the logo fade and have that fade unskippable, then I'd have to animate the fade in a different program, then load and display them one by one in Ren'Py, adding to the tediousness.

Also the main gripe I have with being able to skip transitions and stuff is for battle scenes. If I want to make something along the lines of Fate/Stay Night or Umineko, it's really annoying when I click and then not only is that transition skipped, but the whole string of effects I set up are. For instance if I show an explosion with a shake effect, which is followed by a quick transition into a sky, then the ground, then finally a thumping sound, if I click anywhere inbetween it immediately skips everything up to the end.

So basically all I need is something to prevent the click or keypress or whatever from skipping everything. That's about it.


Edit: Alright I discovered ui.pausebehavior, but I'm not quite sure how to use it because it's not really documented much.

Jake
Support Hero
Posts: 3826
Joined: Sat Jun 17, 2006 7:28 pm
Contact:

Re: Disabling clicks during transitions

#9 Post by Jake »

Suikama wrote: I'd have to define every frame, then show each frame and then pause for a frames worth of time for each image, which in this case would be 1/10=0.1 seconds.
...
Of course not only is this tedious, but you would need to have every frame of the thing you wanted to animate beforehand.
It's not only tedious, it's also unnecessary. You can define an animation separately that lasts for a certain amount of time (look up 'Animation' or look into ATL), just show that once and then pause once for the whole duration of the animation.
Suikama wrote: Now let's say I wanted the logo to fade out after that little animation. I could simply use with Fade, but wait! renpy.pause does not apply to any transitions, so if I wanted to make the logo fade and have that fade unskippable, then I'd have to animate the fade in a different program, then load and display them one by one in Ren'Py, adding to the tediousness.
Not entirely true. The call to renpy.pause() doesn't "apply" to anything; it just causes Ren'Py to stop doing anything for a period of time after the last thing you told it to do.

Basically, (IIRC) if you show an image with a transition using Ren'Py-script's 'show' command, then yeah - Ren'Py will by-default wait until the transition is over before proceeding to the next instruction, so your pause will occur after the transition is over, and a hard pause won't block the transition from skipping.

However, if you include the transition in your ATL animation, then the 'show' instruction will complete instantly, same as any other simple show, and you can hard-pause. If you write the show and transition in Python code instead of Ren'Py script - something like this:

Code: Select all

    $ renpy.show("myImageName")
    $ renpy.transition(Dissolve(2))
    $ renpy.pause(2, hard=True)
- then Ren'Py will quite happily pause for the duration of your transform.

I seem to vageuly recall there being some way to get the 'show' command in Ren'Py-script to skip immediately to the next command without waiting, but I can't remember it if I'm not imagining it.
Suikama wrote: it's really annoying when I click and then not only is that transition skipped, but the whole string of effects I set up are. For instance if I show an explosion with a shake effect, which is followed by a quick transition into a sky, then the ground, then finally a thumping sound, if I click anywhere inbetween it immediately skips everything up to the end.
That sounds like desirable behaviour to me. Otherwise whenever someone plays through your game for a second or fifteenth time, they'll have to sit through your lengthy animations each and every time no matter how many times they've seen them before.

If the user clicks and skips by accident, there's always rollback. If they click to skip on purpose, you should probably let them.
Suikama wrote: I'm not quite sure how to use it because it's not really documented much.
Welcome to Ren'Py's Python API! :3
Server error: user 'Jake' not found

User avatar
curry nochi rice
Miko-Class Veteran
Posts: 746
Joined: Sat Mar 27, 2010 3:12 am
Projects: Delicatessen, Whom to Notice, Start of Something, Love Sorcery
Organization: Circle Cosine
IRC Nick: Curry
Skype: after.curry.rice
itch: project-rothera
Contact:

Re: Disabling clicks during transitions

#10 Post by curry nochi rice »

this was useful....

guys.... during initialization of $ renpy.pause(0. hard=true), would it carry the "hard=true" statement on all "Pause" statements???

Code: Select all

label splashscreen:
    $ renpy.pause(0, hard=true)
    scene black
    with Pause(0.5)

    show splash3
    with dissolve
    with Pause(2.0)
    
    scene black
    with dissolve
    with Pause(1.0)
or, I still need to write "Hard=True" statements on every "pause" like this:

Code: Select all

label splashscreen:
    $ renpy.pause(0, hard=true)
    scene black
    with Pause(0.5, hard=true)

    show splash3
    with dissolve
    with Pause(2.0, hard=true)
    
    scene black
    with dissolve
    with Pause(1.0, hard=true)
??? really, which is easier to use????
Personal (R-13) | Now at IndieDB | Circle Cosine's itch.io
I wanna be done.

Jake
Support Hero
Posts: 3826
Joined: Sat Jun 17, 2006 7:28 pm
Contact:

Re: Disabling clicks during transitions

#11 Post by Jake »

curry nochi rice wrote: during initialization of $ renpy.pause(0. hard=true), would it carry the "hard=true" statement on all "Pause" statements???
Nope; it only ever holds for the one statement you set it in.

For your splashscreen, though, you should really investigate ATL, which will mean - if you define your splash as a single ATL animation - that you'll only need to use one pause statement anyway.
Server error: user 'Jake' not found

Suikama
Regular
Posts: 119
Joined: Tue Apr 13, 2010 3:38 pm
Completed: Down on the Corner
Projects: Stories of an Eastern Paradise
Location: Ontario, Canada
Contact:

Re: Disabling clicks during transitions

#12 Post by Suikama »

Jake wrote:
Suikama wrote: I'd have to define every frame, then show each frame and then pause for a frames worth of time for each image, which in this case would be 1/10=0.1 seconds.
...
Of course not only is this tedious, but you would need to have every frame of the thing you wanted to animate beforehand.
It's not only tedious, it's also unnecessary. You can define an animation separately that lasts for a certain amount of time (look up 'Animation' or look into ATL), just show that once and then pause once for the whole duration of the animation.
Suikama wrote: Now let's say I wanted the logo to fade out after that little animation. I could simply use with Fade, but wait! renpy.pause does not apply to any transitions, so if I wanted to make the logo fade and have that fade unskippable, then I'd have to animate the fade in a different program, then load and display them one by one in Ren'Py, adding to the tediousness.
Not entirely true. The call to renpy.pause() doesn't "apply" to anything; it just causes Ren'Py to stop doing anything for a period of time after the last thing you told it to do.

Basically, (IIRC) if you show an image with a transition using Ren'Py-script's 'show' command, then yeah - Ren'Py will by-default wait until the transition is over before proceeding to the next instruction, so your pause will occur after the transition is over, and a hard pause won't block the transition from skipping.

However, if you include the transition in your ATL animation, then the 'show' instruction will complete instantly, same as any other simple show, and you can hard-pause. If you write the show and transition in Python code instead of Ren'Py script - something like this:

Code: Select all

    $ renpy.show("myImageName")
    $ renpy.transition(Dissolve(2))
    $ renpy.pause(2, hard=True)
- then Ren'Py will quite happily pause for the duration of your transform.

I seem to vageuly recall there being some way to get the 'show' command in Ren'Py-script to skip immediately to the next command without waiting, but I can't remember it if I'm not imagining it.
Suikama wrote: it's really annoying when I click and then not only is that transition skipped, but the whole string of effects I set up are. For instance if I show an explosion with a shake effect, which is followed by a quick transition into a sky, then the ground, then finally a thumping sound, if I click anywhere inbetween it immediately skips everything up to the end.
That sounds like desirable behaviour to me. Otherwise whenever someone plays through your game for a second or fifteenth time, they'll have to sit through your lengthy animations each and every time no matter how many times they've seen them before.

If the user clicks and skips by accident, there's always rollback. If they click to skip on purpose, you should probably let them.
Suikama wrote: I'm not quite sure how to use it because it's not really documented much.
Welcome to Ren'Py's Python API! :3
Well there's always the skip button to skip transitions. Eh I guess it's just a personal peeve of mine because I usually click spam and I don't like rolling back to see what I missed :lol:

Anyways using $ renpy commands worked like a charm. Thanks!

Jake
Support Hero
Posts: 3826
Joined: Sat Jun 17, 2006 7:28 pm
Contact:

Re: Disabling clicks during transitions

#13 Post by Jake »

Suikama wrote: Well there's always the skip button to skip transitions.
There is, but it's pretty indiscriminate, while click-to-skip is very precise.
Suikama wrote: Eh I guess it's just a personal peeve of mine because I usually click spam and I don't like rolling back to see what I missed :lol:
Sure, but the end-user isn't likely to be doing this when they're playing your game for the first time!
Server error: user 'Jake' not found

adeRuZet
Newbie
Posts: 13
Joined: Wed Oct 04, 2017 11:23 am
Github: aderuZet
Contact:

Re: Disabling clicks during transitions

#14 Post by adeRuZet »

Jake wrote: Fri May 21, 2010 4:59 am
However, if you include the transition in your ATL animation, then the 'show' instruction will complete instantly, same as any other simple show, and you can hard-pause. If you write the show and transition in Python code instead of Ren'Py script - something like this:

Code: Select all

    $ renpy.show("myImageName")
    $ renpy.transition(Dissolve(2))
    $ renpy.pause(2, hard=True)
- then Ren'Py will quite happily pause for the duration of your transform.
Could u provide me the whole example for this ATL. Im totally new here.

User avatar
Ibitz
Regular
Posts: 63
Joined: Thu Jul 27, 2017 4:47 pm
Projects: Magical Disarray (WIP)
Organization: Ibitz Visual Novels
Deviantart: http://ibitz.deviant
itch: ibitz
Contact:

Re: Disabling clicks during transitions

#15 Post by Ibitz »

adeRuZet wrote: Mon Oct 30, 2017 12:18 am
Jake wrote: Fri May 21, 2010 4:59 am
However, if you include the transition in your ATL animation, then the 'show' instruction will complete instantly, same as any other simple show, and you can hard-pause. If you write the show and transition in Python code instead of Ren'Py script - something like this:

Code: Select all

    $ renpy.show("myImageName")
    $ renpy.transition(Dissolve(2))
    $ renpy.pause(2, hard=True)
- then Ren'Py will quite happily pause for the duration of your transform.
Could u provide me the whole example for this ATL. Im totally new here.
This Ren'Py Documentation should help you out with ATLs: https://www.renpy.org/doc/html/atl.html

Best way to understand ATLs, is to copy what you see in the documentation above and make your own transformations in a mini-game, using your own pics. I'm still a newbie, myself, but I've read all the documentations and played Python coding games and taught myself how to code. It's hard, but you will slowly understand it better as you practice.
Image

Ibitz is a self-taught coder/artist who works alone on their games. All games I create are freeware. If you need any help with coding or creating your game, just let me know. I'd be more than happy to help.

Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot], barsunduk