$renpy.say and screen issues? (SOLVED)

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
User avatar
meiri
Regular
Posts: 177
Joined: Wed Jun 25, 2014 6:21 pm
Projects: Tutor Tabitha, Movement
Organization: Blue Bottlecap Games
Location: East Coast, US
Contact:

$renpy.say and screen issues? (SOLVED)

#1 Post by meiri »

First off, here is my code:

Code: Select all

screen home:
    tag menu
    add "browser_gfx/home_screen_bg.png"
    
    imagebutton auto "browser_gfx/home_icon1_%s.png" focus_mask True action Show("deeble_home") # This is the CERTAIN imagebutton
    imagebutton auto "browser_gfx/home_icon2_%s.png" focus_mask True action Show("deeble_home")  # this is the CERTAIN imagebutton
    if not viewed_websites:
        $ renpy.say(e, "But you aren't done on the web yet!")
    else:
        imagebutton auto "browser_gfx/home_button_%s.png" xpos 0 ypos 0 focus_mask True action Return()

        
screen deeble_home:
    tag menu
    use home
    $ viewed_websites = True
    text "Nothing yet"
Basically, during the game, a character is presented with a menu and one of the options will call screen "home" ...
I have a variable set to False after my start label, that variable is "viewed_websites." The point of this is that they have to click a certain imagebutton before they try to return to the place after the aforementioned menu. Clicking this certain imagebutton will send them to screen deeble_home at which the variable will be set to true, and then the player can return to screen home (after I add some more imagebuttons.) But if they DONT click the certain imagebutton, a bit of dialogue should show (using the say screen) telling them that they havent viewed all the websites yet, and theyll know to click on the certain imagebutton.

But this is the error I am receiving:

Code: Select all

I'm sorry, but an uncaught exception occurred.

While running game code:
  File "game/script.rpy", line 23, in script
    $ renpy.call_screen("home")
  File "game/script.rpy", line 23, in <module>
    $ renpy.call_screen("home")
  File "game/browser.rpy", line 1, in execute
    screen home:
  File "game/browser.rpy", line 7, in execute
    if not viewed_websites:
  File "game/browser.rpy", line 8, in execute
    $ renpy.say(e, "But you aren't done on the web yet!")
  File "game/browser.rpy", line 8, in <module>
    $ renpy.say(e, "But you aren't done on the web yet!")
Exception: ui.interact called with non-empty widget/layer stack. Did you forget a ui.close() somewhere?
Obvously, I see the suggestion to add in a ui.close() but I have no idea what that is or where it should go. Is renpy.say outdated? I'm really not sure how to do this. I'm also not sure if I'm being entirely clear, so if a reexplanation is needed, lemme know.
Thanks in advance.
Last edited by meiri on Thu Oct 16, 2014 9:19 pm, edited 1 time in total.
What's in a loop? A loop iterated in any other way would output as sweet.
--
Have a look at my GxG kinetic novel, Movement, if you have the chance?

User avatar
PyTom
Ren'Py Creator
Posts: 16096
Joined: Mon Feb 02, 2004 10:58 am
Completed: Moonlight Walks
Projects: Ren'Py
IRC Nick: renpytom
Github: renpytom
itch: renpytom
Location: Kings Park, NY
Contact:

Re: $renpy.say and screen issues?

#2 Post by PyTom »

You can't call renpy.say from inside a screen. That would start an interaction inside an interaction, which isn't allowed.
Supporting creators since 2004
(When was the last time you backed up your game?)
"Do good work." - Virgil Ivan "Gus" Grissom
Software > Drama • https://www.patreon.com/renpytom

User avatar
meiri
Regular
Posts: 177
Joined: Wed Jun 25, 2014 6:21 pm
Projects: Tutor Tabitha, Movement
Organization: Blue Bottlecap Games
Location: East Coast, US
Contact:

Re: $renpy.say and screen issues?

#3 Post by meiri »

Thanks, I understand why it happened now and have found an alternative (and much easier) way of doing it. :)
What's in a loop? A loop iterated in any other way would output as sweet.
--
Have a look at my GxG kinetic novel, Movement, if you have the chance?

Post Reply

Who is online

Users browsing this forum: Google [Bot], Majestic-12 [Bot]