ui.interact called with non-empty widget/layer stack

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
Misamor98
Regular
Posts: 45
Joined: Wed Jul 14, 2021 4:43 pm
Contact:

ui.interact called with non-empty widget/layer stack

#1 Post by Misamor98 »

Hi,

I'm sure this error is quite common, but roaming around other topics with the same issue hasn't helped me.

So in my game, I'm using a screen which controls everything. The screen background shows my locations, and on that same screen there's an HUD with 3 "skip time" buttons, and one extra to open a menu.
The screen is called inside a while loop which goes as follows :

While etc:
if SceneToCall == "empty":
$ SceneToCall = renpy.call_screen("Overlay", _layer="screens")
jump expression SceneToCall (for example, "Add_1H")

That way that screen will RETURN label names (through imagebuttons, action()) and the game will jump to the desired expression like "Add_1H", and then inside that label I can make all the verifications I need to make.
For a while now I've come to the conclusion that this system is a bit clumsy, but when I started Ren'py that's the only way I found to make the system work. So I wanna change things a bit and ditch the whole while loop and, and that's what's causing me problems right now, the "Return value/SceneToCall variable" system and directly, in the imagebuttons, call the desired labels.
In short, remove the "imagebutton -> action(Return)" and replace it with "imagebutton -> action(renpy.call("label")".
Problem is, renpy gives me an error at a dialogue that's present in my "add_1H" label, which tells the player why they can't skip time.

This system worked fine with the old system, and I don't get why it's not working now.

User avatar
_ticlock_
Miko-Class Veteran
Posts: 910
Joined: Mon Oct 26, 2020 5:41 pm
Contact:

Re: ui.interact called with non-empty widget/layer stack

#2 Post by _ticlock_ »

Misamor98 wrote: Fri Nov 18, 2022 12:52 pm jump expression SceneToCall (for example, "Add_1H")
If you used jump then you probably want to use Jump action:

Code: Select all

imagebutton:
    action Jump("label_name_as_string")
Or if you want to call label - use Call action:

Code: Select all

imagebutton:
    action Call("label_name_as_string")
Misamor98 wrote: Fri Nov 18, 2022 12:52 pm In short, remove the "imagebutton -> action(Return)" and replace it with "imagebutton -> action(renpy.call("label")".
Your mistake is likely how you call label. if you use Function with renpy.call, you need to pass arguments after the comma:

Code: Select all

imagebutton:
    action Function(renpy.call, "label_name_as_string")

Misamor98
Regular
Posts: 45
Joined: Wed Jul 14, 2021 4:43 pm
Contact:

Re: ui.interact called with non-empty widget/layer stack

#3 Post by Misamor98 »

Hey, thank you for your answer!

Yes, I replaced renpy.call() with just Call() and it worked... This engine is a mistery to me sometimes...

Anyway, thanks again!

Post Reply

Who is online

Users browsing this forum: Bing [Bot]