Why can't i close a screen within a screen

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
SLim_Games
Newbie
Posts: 23
Joined: Tue Mar 20, 2018 11:37 am
itch: slim-games
Contact:

Why can't i close a screen within a screen

#1 Post by SLim_Games »

Hi,

I want to close a screen with another screen:

Code: Select all

screen idleTalk:
    add "c3animation2"
    timer 1.5 action Show("idleTalk2")
screen idleTalk2:
    $renpy.hide_screen("idleTalk")
why is renpy.hide_screen not closing the screen idleTalk.. am I doing something wrong?
The purpose of this is -> I have a talking animation and I want to add an idle animation after that while the text is being put on the screen. Is there a better way to do this?
Thanks :o
Play my game (nsfw) for free at: https://www.patreon.com/SLim_Games

User avatar
Imperf3kt
Lemma-Class Veteran
Posts: 3794
Joined: Mon Dec 14, 2015 5:05 am
itch: Imperf3kt
Location: Your monitor
Contact:

Re: Why can't i close a screen within a screen

#2 Post by Imperf3kt »

You can't close a screen with a screen.

Use this instead:

Code: Select all

screen idleTalk:
    add "c3animation2"
    timer 1.5 action Show("idleTalk2"), Hide("idletalk")
screen idleTalk2:
    
Warning: May contain trace amounts of gratuitous plot.
pro·gram·mer (noun) An organism capable of converting caffeine into code.

Current project: GGD Mentor

Twitter

kivik
Miko-Class Veteran
Posts: 786
Joined: Fri Jun 24, 2016 5:58 pm
Contact:

Re: Why can't i close a screen within a screen

#3 Post by kivik »

I think the conventional method of playing talking animations whilst text is being shown would be to just show the animated image. You should be able to achieve what you wanted with transforms and not using a screen (which is a very strange and probably inefficient way of approaching this).

What exactly is involved with your talking animations that made you use two screens?

Springblossoms3
Newbie
Posts: 1
Joined: Mon Jun 11, 2018 7:27 am
Location: Mumbai
Contact:

Re: Why can't i close a screen within a screen

#4 Post by Springblossoms3 »

Thank Imperf3kt... I too faced same issue problem resolved.

SLim_Games
Newbie
Posts: 23
Joined: Tue Mar 20, 2018 11:37 am
itch: slim-games
Contact:

Re: Why can't i close a screen within a screen

#5 Post by SLim_Games »

kivik wrote: Mon Jun 11, 2018 3:41 am I think the conventional method of playing talking animations whilst text is being shown would be to just show the animated image. You should be able to achieve what you wanted with transforms and not using a screen (which is a very strange and probably inefficient way of approaching this).

What exactly is involved with your talking animations that made you use two screens?
I just didnt know how to handle it when it loops. so when it loops I didn't want to play the talking part again. But now I understand it better thanks
Play my game (nsfw) for free at: https://www.patreon.com/SLim_Games

Post Reply

Who is online

Users browsing this forum: Bing [Bot], Google [Bot], Ocelot