Renpy Coding - Preventing Unintended Image Skipping

Xavster

Well-Known Member
Game Developer
Mar 27, 2018
1,249
7,625
My first attempt at a VN is in final testing, however I have come across and unintended feature. In several instances, I have used an array of images with dissolves that are intended to slideshow one after the other. However if the user clicks the mouse at the wrong time, it skips over the whole sequence. Hence is there a way that the images can automatically slideshow, however the mouse click will only advance to the next image? Sample of code I am currently working with below.
Code:
    scene e01 013
    tif nervous "{i}Ok Tiffany, let's show him what you can do.{/i}"

    scene e01 014
    with Dissolve(0.5)
    with Pause(1.5)

    scene e01 015
    with Dissolve(0.5)
    with Pause(1.5)

    scene e01 016
    with Dissolve(0.5)
    with Pause(1.5)
 

anne O'nymous

I'm not grumpy, I'm just coded that way.
Modder
Donor
Respected User
Jun 10, 2017
10,969
16,222
The correct way to do this is to use the .
Code:
image myAnim:
   "e01 014"
   1.5
   "e01 015"
   1.5
   "e01 016"
   1.5

label whatever:
   show myAnim
 
  • Like
Reactions: Xavster

aphrodisia

Eccentric Empress
Game Developer
Jul 18, 2019
57
153
You could use
Python:
$ renpy.pause(1.5, hard=True)
instead of changing to ATL. This will cause a 1.5 second pause that will not be skipped even if the player clicks. You should be able to remove your Pause(1.5) if you do this.

So the result would be this (I'm on mobile, so check indentation. But I'm pretty sure this should work for you.)

Code:
    scene e01 013
    tif nervous "{i}Ok Tiffany, let's show him what you can do.{/i}"

    scene e01 014
    with Dissolve(0.5)
$ renpy.pause(1.5, hard=True)

    scene e01 015
    with Dissolve(0.5)
$ renpy.pause(1.5, hard=True)

    scene e01 016
    with Dissolve(0.5)
$ renpy.pause(1.5, hard=True)
 
Last edited:
  • Like
Reactions: 9thCrux and Xavster

Penfold Mole

Engaged Member
Respected User
May 22, 2017
3,118
7,617
Unskippable slow animations are incredibly annoying after you have already seen them a few times.

For example, there's a game where every time you move between rooms in the house, there's a slideshow of 3 or 4 extremely slow frames of the guy climbing the stairs. Every. Goddamn. Freaking. Time. And unskippable.

After you've seen it more than 10 times you'll either:

1. drop that annoying game and never look at it again
2. remove that annoying slideshow yourself
or
3. kill yourself

Therefore I would strongly recommend to either use ATL the way Anne recommended or at least make every slideshow skippable after its first run. For example, you can use a persistent variable to set it after the first run.

Previous example would look something like

Code:
define persistent.sc_e01FirstRun=True

label scene_e01:
    scene e01 013
    tif nervous "{i}Ok Tiffany, let's show him what you can do.{/i}"

    scene e01 014
    with Dissolve(0.5)
    $ renpy.pause(1.5, hard=persistent.sc_e01FirstRun)

    scene e01 015
    with Dissolve(0.5)
    $ renpy.pause(1.5, hard=persistent.sc_e01FirstRun)

    scene e01 016
    with Dissolve(0.5)
    $ renpy.pause(1.5, hard=persistent.sc_e01FirstRun)
    $ persistent.sc_e01FirstRun=False
 
Last edited:

Xavster

Well-Known Member
Game Developer
Mar 27, 2018
1,249
7,625
Thanks for the responses.

Ended up going with aphrodisia's solution which works like a charm. Suspect AON's method is more efficient in terms of coding, so I will likely try that in future. VN should be out next week.
 
  • Like
Reactions: aphrodisia

Xavster

Well-Known Member
Game Developer
Mar 27, 2018
1,249
7,625
Unskippable slow animations are incredibly annoying after you have already seen them a few times.

For example, there's a game where every time you move between rooms in the house, there's a slideshow of 3 or 4 extremely slow frames of the guy climbing the stairs. Every. Goddamn. Freaking. Time. And unskippable.

After you've seen it more than 10 times you'll either:

1. drop that annoying game and never look at it again
2. remove that annoying slideshow yourself
or
3. kill yourself

Therefore I would strongly recommend to either use ATL the way Anne recommended or at least make every slideshow skippable after its first run. For example, you can use a persistent variable to set it after the first run.

Previous example would look something like

Code:
define persistent.sc_e01FirstRun=True

label scene_e01:
    scene e01 013
    tif nervous "{i}Ok Tiffany, let's show him what you can do.{/i}"

    scene e01 014
    with Dissolve(0.5)
    $ renpy.pause(1.5, hard=persistent.sc_e01FirstRun)

    scene e01 015
    with Dissolve(0.5)
    $ renpy.pause(1.5, hard=persistent.sc_e01FirstRun)

    scene e01 016
    with Dissolve(0.5)
    $ renpy.pause(1.5, hard=persistent.sc_e01FirstRun)
    $ persistent.sc_e01FirstRun=False
I hear you on filler slideshows. I have only created a linear VN at this point, hence I'm sure that readers won't be concerned by the unskipable portion. It essentially will work as the prologue / character introduction for the real game. Next update will rework the game into more of a first person game in a similar style as Harem Hotel / Milfy City.

I suspect that I will likely have a number of other questions in order to achieve this goal.
 
  • Like
Reactions: Penfold Mole

Penfold Mole

Engaged Member
Respected User
May 22, 2017
3,118
7,617
In a linear VN with several paths it could also be an annoyance for a player who is trying to cover several paths or all possible paths and is forced to wait through all these hard pauses on each of them. Just something to think about. :)

A general recommendation is to use hard pauses as little as possible. It shouldn't be used thoughtlessly in places where a regular soft pause could also work.

Good luck with your game!
 
Last edited:

aphrodisia

Eccentric Empress
Game Developer
Jul 18, 2019
57
153
Thanks for the responses.

Ended up going with aphrodisia's solution which works like a charm. Suspect AON's method is more efficient in terms of coding, so I will likely try that in future. VN should be out next week.
I'm glad you found my solution helpful. It's definitely a bit easier, but I will agree with Penfold Mole that it might get annoying. I'd try out his suggestion if you get the time. Good luck~
 
  • Like
Reactions: Xavster

anne O'nymous

I'm not grumpy, I'm just coded that way.
Modder
Donor
Respected User
Jun 10, 2017
10,969
16,222
After you've seen it more than 10 times you'll either:

1. drop that annoying game and never look at it again
2. remove that annoying slideshow yourself
or
3. kill yourself
Personally I have two small dirty scripts especially for this, both hijacking the pause. The first one to force hard at False, and the second, for the extreme cases (there's few games that put a pause between every single image and line of dialog, god I hate them), that simply don't perform the pause.


I understand that devs want their animation to be seen. They worked hard for them and don't want this time and energy to have been spent uselessly. But globally we will all see them, just perhaps not now, or not every time.
Plus, the ATL version present another advantage. If for a reason or another the player save in the middle of the animation, it will restart from the first frame, which make more sense. This opposed to the "pure code" approach, where the animation should restart from the frame where the save was done.
Anyway, the problem itself prove that the "pure code" approach isn't the best one, since its behavior isn't fixed. It can (and effectively have) evolve with time, leading to a code that don't works anymore as expected simply because the dev was serious and update its version of Ren'py.
 

Xavster

Well-Known Member
Game Developer
Mar 27, 2018
1,249
7,625
Thanks for all the input. However to provide clarification, the content will only be seen just the once and the pauses aren't extensive or long. The problem I was having is that a stray click, simply clicked over content that the player would not realise existed at all.

As a teaser, this is frame 018 out of the simple slideshow (slideshow is frames 014 to 019). I'm pretty sure the readers wouldn't want to accidentally miss it (click at the wrong time was resulting in frame 013 to 020). There are only a few short slideshows out of a total of about 550 renders. For the next version of the game I will likely avoid slideshows in preference for animations (that can be skipped if desired).
e01 018.jpg

As mentioned before, the VN (Galactic Rogue) will be out in a week or so.
 
  • Like
Reactions: Abhai