Renpy Help

Lucrezia&Augusto

Storia di Stef
Game Developer
Dec 25, 2019
1,223
4,091
Hi everyone
I need advice or information
I've been using Ren'Py and have found a problem since I entered the Menu.
Since I entered the menu I can no longer make the images in sequence, that is:
scenes 01with dissolves
scene 02 with dissolve
breaks
(Granted, I don't get any errors from the system.)
Instead of automatically changing the image it takes me directly to the last image or scene 02 without showing the image change.
Can you give me a way to solve my problem, thank you
 

Talothral

Well-Known Member
Game Developer
Jul 8, 2020
1,387
6,415
Use pause between the images.

Python:
scene 01 with dissolve
$ renpy.pause()
scene 02 with dissolve
 

Talothral

Well-Known Member
Game Developer
Jul 8, 2020
1,387
6,415
If you use scene statements back to back it just displays all the images instantly, efficiently skipping to the last one. If you put $ renpy.pause() between the scene statements it stops the images from changing instantly, and thus showing them until the user clicks the mouse button (or presses the space).

Note, this is just for image sequences, dialogue acts as a pause. Here is something I'm working at the moment:
Python:
    TAM "He is safe, for now."
    scene 010090
    $ renpy.pause(1.25)
    scene 010091
    $ renpy.pause(1.25)
    scene 010092
    $ renpy.pause(1.25)
    scene 010093
    $ renpy.pause(1.25)
    scene 010094
    $ renpy.pause(1.25)
    scene 010095
    TAM "And so it begins."
If I remove the pause statements between the scene 010090 and 010095, it just skips to the scene 010095 when the the player clicks the mouse button when he/she has read the "He is safe, for now" line.
 

recreation

pure evil!
Respected User
Game Developer
Jun 10, 2018
6,327
22,773
Code:
scene 01 with dissolves
pause .5
scene 02 with dissolve
pause
 

79flavors

Well-Known Member
Respected User
Jun 14, 2018
1,607
2,256
Can you give me a way to solve my problem, thank you
Use pause between the images.
No, they are one image after another.
I only put Pause at the end
So... you want a solution... but don't want a solution?

pause is one answer here... most likely the easiest and correct one.
Personally, I would use pause instead of $ renpy.pause(), but either will work.

RenPy is optimizing the display of the images, removing those that aren't slowed down by any other effects. You might think that with dissolve would be that slowing effect, but it's only a transition effect and doesn't actually force RenPy to slow the display of the images.

It sounds like you want some form of slideshow... in which case, I'd probably code something like...

Python:
    scene picture_01 with dissolve
    pause 0.75
    scene picture_02 with dissolve
    pause 0.75
    scene picture_03 with dissolve
    pause
    "Some dialogue."
That last pause on it's own isn't really needed, since the dialogue will pause the progress of the game - I just wanted to highlight the difference between pause used with a timer and pause used without one.

Your other alternative is to construct an image to be used as a slidedown...
It's using something called , which is one of the ways RenPy' can creating complex images (like slideshows/animations).

Python:
image my_first_scene:
    "picture_01" with dissolve
    pause 0.75
    "picture_02" with dissolve
    pause 0.75
    "picture_03" with dissolve

label start:

    scene black with fade

    scene my_first scene
    "Some dialogue."

    return
ATL can be highly complex or really easy. In this case, it's easy and really isn't necessary. But hey ho... you're choice.

One advantage of ATL though is that you can set up a loop.

Python:
image my_first_scene:
    "picture_01" with dissolve
    pause 0.75
    "picture_02" with dissolve
    pause 0.75
    "picture_03" with dissolve
    pause 0.75
    repeat
If used this way, RenPy will cycle through those 3 images forever if the player didn't advance the game.
 
Last edited:
  • Like
Reactions: anne O'nymous

Lucrezia&Augusto

Storia di Stef
Game Developer
Dec 25, 2019
1,223
4,091
Meanwhile, thank you all for your help
I have created a test game and I also put pause 0.75
and everything works regularly.
Then I enter the menu
And it no longer works
disperato.png
 

79flavors

Well-Known Member
Respected User
Jun 14, 2018
1,607
2,256
I'm not seeing any programming problems there.
What do you mean by "And it no longer works"?


If you use "No", then the game will quit to the main menu.

If you use "Si", then you would see the scene avvertenze and then everything after label after_menu:. Then the game quits to the main menu.

I'm seeing the code as this (without the music lines):

Python:
define lucrezia = Character("Lucrezia")

label start:

    menu:
        "By clicking on the YES button you declare that you are of legal age."
        "Yes":
            scene my_warnings

        "No":
            return

label after_menu:

    pause
    scene my_background with dissolve
    scene my_background with dissolve
    show my_title with vpunch
    show my_title with vpunch
    pause

    scene my_background with dissolve
    show my_scene_1 with dissolve
    show my_scene_1 with dissolve
    pause

    scene my_scene_1 with dissolve
    lucrezia "Hello, and welcome to my story... Oops! Nothing to see here."

    scene my_scene_2 with dissolve
    lucrezia "Sorry I got the camera wrong."
    
    scene my_scene_2m with dissolve
    pause 0.75
    scene my_scene_2m1 with dissolve
    pause 0.75
    scene my_scene_2m with dissolve
    pause 0.75
    scene my_scene_2m2 with dissolve
    pause 0.75
    scene my_scene_2m3 with dissolve
    pause 0.75
    scene my_scene_2m2 with dissolve
    pause 0.75

    scene my_background_black with dissolve
    pause 0.75
    scene my_background_black with dissolve
    pause 0.75
    scene my_background_black with dissolve
    pause
    
    return

It's not clear to me why you are using show:, but then I can't see your images - so maybe it's fine. Though you probably want a few some more pause's in there, between those show statements too.

You probably won't see any transition between those 3 black screens... because you're going from black -> black -> black.

I'd probably add a "*** THE END ***" before each return: statement too... just so you're aware that return used this way, will end the game.

My version of your same code would more like:

You don't have permission to view the spoiler content. Log in or register now.
 

Lucrezia&Augusto

Storia di Stef
Game Developer
Dec 25, 2019
1,223
4,091
I'm not seeing any programming problems there.
What do you mean by "And it no longer works"?


If you use "No", then the game will quit to the main menu.

If you use "Si", then you would see the scene avvertenze and then everything after label after_menu:. Then the game quits to the main menu.

I'm seeing the code as this (without the music lines):

Python:
define lucrezia = Character("Lucrezia")

label start:

    menu:
        "By clicking on the YES button you declare that you are of legal age."
        "Yes":
            scene my_warnings

        "No":
            return

label after_menu:

    pause
    scene my_background with dissolve
    scene my_background with dissolve
    show my_title with vpunch
    show my_title with vpunch
    pause

    scene my_background with dissolve
    show my_scene_1 with dissolve
    show my_scene_1 with dissolve
    pause

    scene my_scene_1 with dissolve
    lucrezia "Hello, and welcome to my story... Oops! Nothing to see here."

    scene my_scene_2 with dissolve
    lucrezia "Sorry I got the camera wrong."
   
    scene my_scene_2m with dissolve
    pause 0.75
    scene my_scene_2m1 with dissolve
    pause 0.75
    scene my_scene_2m with dissolve
    pause 0.75
    scene my_scene_2m2 with dissolve
    pause 0.75
    scene my_scene_2m3 with dissolve
    pause 0.75
    scene my_scene_2m2 with dissolve
    pause 0.75

    scene my_background_black with dissolve
    pause 0.75
    scene my_background_black with dissolve
    pause 0.75
    scene my_background_black with dissolve
    pause
   
    return

It's not clear to me why you are using show:, but then I can't see your images - so maybe it's fine. Though you probably want a few some more pause's in there, between those show statements too.

You probably won't see any transition between those 3 black screens... because you're going from black -> black -> black.

I'd probably add a "*** THE END ***" before each return: statement too... just so you're aware that return used this way, will end the game.

My version of your same code would more like:

You don't have permission to view the spoiler content. Log in or register now.
 

anne O'nymous

I'm not grumpy, I'm just coded that way.
Modder
Donor
Respected User
Jun 10, 2017
10,957
16,191
It's not clear to me why you are using show:, but then I can't see your images - so maybe it's fine. Though you probably want a few some more pause's in there, between those show statements too.
And a hide in between to make Ren'py not uselessly display it twice.


This said, I don't understand what he expect with his after_menu label. I don't remember said special label, and it's not listed as such in the documentation ; there's also no ocurence in the core's code.
Like the code works like it should, it mean that the problem come from the expectation, not from the realization. And it appear that the after_menu label can be found in the . I suspect that all the problem come from a misunderstanding of this said example.

So, Lucrezia&Augusto , can you tell us what you expected by doing this ?
 

79flavors

Well-Known Member
Respected User
Jun 14, 2018
1,607
2,256
Allore is quite involved.

I created a new project and everything works

Then I put the menu and everything works

Then I copied my old game code and it no longer works

That is, when I launch the project, the moving images are no longer seen.

Then I go back to the script and delete the old code ... I relaunch the game and I no longer see the images move before.
Hmm....

I'm really not sure what to suggest.

You've said it has worked, but something you did when copying the old code back broke it.
To me, that sounds like a simple typing mistake or some problem with indentation.

anne O'nymous , I don't think there's any special meeting to label after_menu:. I think it's just another random label name. The menu gets run, then falls into the next section of code... which happens to have that name.

Overall, I think the dev needs to check his code and compare what works to what doesn't. Since we haven't seen the actual broken code, it's really difficult to diagnose.
 

Lucrezia&Augusto

Storia di Stef
Game Developer
Dec 25, 2019
1,223
4,091
So here I am guys
a very strange case
I opened a new project, I rewrote the code, I put the menu
and now everything is fine. The only thing I did I removed from the vpunch codes
 

Lucrezia&Augusto

Storia di Stef
Game Developer
Dec 25, 2019
1,223
4,091
I admit to being an apapssioanto and not an expert.
But the strange fact that everything worked properly.
Then yesterday I put some vpunch so to give some effect.
And today I noticed the news
 

anne O'nymous

I'm not grumpy, I'm just coded that way.
Modder
Donor
Respected User
Jun 10, 2017
10,957
16,191
anne O'nymous , I don't think there's any special meeting to label after_menu:.
I think it's just another random label name. The menu gets run, then falls into the next section of code... which happens to have that name.
There's no meaning, yes, but it appear on the documentation in a really confusing way :
You don't have permission to view the spoiler content. Log in or register now.

  • The label is useless ; Ren'py will go there anyway if there's no branching inside the menu.
  • The branching is bogus ; it's an implicit one ("the label ended, what is there after that I can process"), not an explicit one.
  • The name of the label is potentially misleading, especially for novices.
In the end, you have a label named "after_menu", placed after a menu, in an example regarding menus, and that is proceeded magically, since it isn't jumped to, nor called ; which are the way to activate a label, as said by the documentation. For anyone having few knowledge both regarding codding and Ren'py, it's confusing and can looks like some meta label that, by example, you have to place after each menu to continue the game.
 
  • Like
Reactions: 79flavors