[Solved]__call__() got an unexpected keyword argument 'new_widget'

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
TRIDENT_12
Regular
Posts: 30
Joined: Tue Aug 03, 2021 4:29 pm
Projects: The Monster Within
Github: TRIDENT1313
Discord: TRIDENT_12#2285
Contact:

[Solved]__call__() got an unexpected keyword argument 'new_widget'

#1 Post by TRIDENT_12 »

I'm adding yes/no boxes, and an ok prompt.
I keep getting this error.
If anyone could tell me how to fix this, that would be greatly appreciated.
Last edited by TRIDENT_12 on Wed Aug 04, 2021 1:21 am, edited 2 times in total.

User avatar
Ocelot
Lemma-Class Veteran
Posts: 2384
Joined: Tue Aug 23, 2016 10:35 am
Github: MiiNiPaa
Discord: MiiNiPaa#4384
Contact:

Re: Help __call__() got an unexpected keyword argument 'new_widget'

#2 Post by Ocelot »

You clearly are trying to pass entity, absolutely not suited to this, to something.

Anything more concrete is impossible to guess without seeing faulty code.
< < insert Rick Cook quote here > >

TRIDENT_12
Regular
Posts: 30
Joined: Tue Aug 03, 2021 4:29 pm
Projects: The Monster Within
Github: TRIDENT1313
Discord: TRIDENT_12#2285
Contact:

Re: Help __call__() got an unexpected keyword argument 'new_widget'

#3 Post by TRIDENT_12 »

This seems to be the problem line
call screen confirm("Do you know who I am?", yes_action =[Hide("confirm"), Show(screen="dialog", message ="I don't believe you.", ok_action =[Hide("dialog", Call("liar"))])], no_action = None)
The idea is a box pops up asking if you know who it is, and when you select yes, another box pops up saying I dont believe you.
Once you click OK, the game should continue as normal.

TRIDENT_12
Regular
Posts: 30
Joined: Tue Aug 03, 2021 4:29 pm
Projects: The Monster Within
Github: TRIDENT1313
Discord: TRIDENT_12#2285
Contact:

Re: Help __call__() got an unexpected keyword argument 'new_widget'

#4 Post by TRIDENT_12 »

Here's the traceback
I'm sorry, but an uncaught exception occurred.

While running game code:
File "game/script.rpy", line 30, in script call
call ch6
File "game/script-ch6.rpy", line 8, in script
s "Hello "
TypeError: __call__() got an unexpected keyword argument 'new_widget'

-- Full Traceback ------------------------------------------------------------

Full traceback:
File "game/script.rpy", line 30, in script call
call ch6
File "game/script-ch6.rpy", line 8, in script
s "Hello "
File "renpy/ast.py", line 716, in execute
renpy.exports.say(who, what, *args, **kwargs)
File "renpy/exports.py", line 1417, in say
who(what, *args, **kwargs)
File "renpy/character.py", line 1219, in __call__
self.do_display(who, what, cb_args=self.cb_args, dtt=dtt, **display_args)
File "renpy/character.py", line 871, in do_display
**display_args)
File "renpy/character.py", line 621, in display_say
rv = renpy.ui.interact(mouse='say', type=type, roll_forward=roll_forward)
File "renpy/ui.py", line 298, in interact
rv = renpy.game.interface.interact(roll_forward=roll_forward, **kwargs)
File "renpy/display/core.py", line 3276, in interact
repeat, rv = self.interact_core(preloads=preloads, trans_pause=trans_pause, pause=pause, pause_start=pause_start, **kwargs)
File "renpy/display/core.py", line 3633, in interact_core
new_widget=layers_root)
TypeError: __call__() got an unexpected keyword argument 'new_widget'

Windows-10-10.0.19041
Ren'Py 7.4.7.1862
LibitinaV2 1.0
Tue Aug 3 16:13:40 2021

User avatar
hell_oh_world
Miko-Class Veteran
Posts: 777
Joined: Fri Jul 12, 2019 5:21 am
Contact:

Re: Help __call__() got an unexpected keyword argument 'new_widget'

#5 Post by hell_oh_world »

I tried to break down your code and it looks like this...

Code: Select all

confirm(
	"Do you know who I am?",
	yes_action =[
		Hide("confirm"),
		Show(screen="dialog", message ="I don't believe you.", ok_action =[
				Hide("dialog", Call("liar"))
			]
		)
	],
	no_action = None
)
This line...

Code: Select all

Hide("dialog", Call("liar"))
Seems to be the one causing the error, since the 2nd parameter in the action Hide should be a transition, yet you're passing an action here (Call(...)).
Hide(screen, transition=None, _layer=None)
This causes the screen named screen to be hidden, if it is shown.

transition
If not None, a transition that occurs when hiding the screen.
_layer
This is passed as the layer argument to renpy.hide_screen().

TRIDENT_12
Regular
Posts: 30
Joined: Tue Aug 03, 2021 4:29 pm
Projects: The Monster Within
Github: TRIDENT1313
Discord: TRIDENT_12#2285
Contact:

[Solved] Help __call__() got an unexpected keyword argument 'new_widget'

#6 Post by TRIDENT_12 »

Fixed it.
Thanks

Post Reply

Who is online

Users browsing this forum: Bing [Bot]