How do I jump smoothly between labels containing screens?

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
JonuFilms
Newbie
Posts: 3
Joined: Mon Jan 29, 2024 9:32 am
Contact:

How do I jump smoothly between labels containing screens?

#1 Post by JonuFilms »

Dear Ren'Py people, I need help!
I still can't wrap my head around jumps between labels. In the video you can see how sometimes some frames squeeze inbetween screens. How do I get rid of them? It's so annoying. I tried playing around with "hide screen" but I don't really get how that works. What am I doing wrong?


Click link to see the post containing the video (scroll down a tiny bit)
https://discord.com/channels/2866338985 ... 6179293276

Code: Select all

screen KidsRoomScreen1():
    add Movie(play="images/backgrounds/KidsRoomShot1.webm")

    imagebutton:
        #some stuff

    imagebutton:
        focus_mask True
        idle "images/Overlays/KidsRoom1BoyOverlay.png"
        hover "images/Overlays/KidsRoomTalkBtn.png"
        hover_sound "audio/FX/softKlick.wav"
        action [Play("sound", "audio/FX/softKlick.wav"), Jump("ScaredBroLabel")]

    imagebutton:
        #some stuff


screen cowToyScreen():

    add ("images/backgrounds/CowToy.png")

screen ScaredBroScreen():

    add Movie(play="images/backgrounds/scaredBro.webm")

#...#

label KidsroomLabel1:

    
    call screen KidsRoomScreen1


label CowToyLabel:
    hide screen ScaredBroScreen
    hide screen KidsRoomScreen1
    show screen cowToyScreen

    me "Our favorite toy. A cow."
        


label KidsRoomLabel1_1:

    call screen KidsRoomScreen1

label ScaredBroLabel:
    hide screen KidsRoomScreen1
    hide cowToyScreen
    show screen ScaredBroScreen

    j "There is someone out there."
    j "Or something."
    j "Please don't go outside!"

label KidsRoomLabel1_2:
    hide ScaredBroScreen
    call screen KidsRoomScreen1

User avatar
m_from_space
Miko-Class Veteran
Posts: 978
Joined: Sun Feb 21, 2021 3:36 am
Contact:

Re: How do I jump smoothly between labels containing screens?

#2 Post by m_from_space »

JonuFilms wrote: Thu Feb 08, 2024 11:08 am Click link to see the post containing the video (scroll down a tiny bit)
https://discord.com/channels/2866338985 ... 6179293276
Hey, I cannot watch your video. Maybe put it somewhere where people do not need special accounts for accessing.

In general, a screen and a label are completely different things. Jumping from one label to another shouldn't have any effect on a screen. So I don't know what's going on in your game.

What I can see in your code looks a bit messy though.

Think of labels like jump points. It doesn't behave like a python function or a screen. So if you do not end a label with either a return or a jump statement, then the game pointer (called "control") will run after that label, maybe into another label. In best case it hits the end of the file and then return. So make sure to always "close" a label. If you use a "return" statement, it's only useful if you call that label instead of jumping to it.

Maybe read about the common gameflow here: https://www.renpy.org/doc/html/label.html

Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot], Baidu [Spider], Bing [Bot], Google [Bot], henne