[SOLVED] "Unbound method get_tooltip() must be called with Return"

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
Kinmoku
Miko-Class Veteran
Posts: 591
Joined: Mon Aug 11, 2014 9:39 am
Completed: One Night Stand
Projects: VIDEOVERSE
Tumblr: gamesbykinmoku
itch: kinmoku
Location: Germany
Contact:

[SOLVED] "Unbound method get_tooltip() must be called with Return"

#1 Post by Kinmoku »

Hi all,

I'm revisiting an older project and whenever I hover over the text button in a screen, I get an error:

Code: Select all

I'm sorry, but an uncaught exception occurred.

While running game code:
  File "game/script.rpy", line 6022, in script call
    call first_memory
  File "game/memories.rpy", line 398, in script
    call screen help_katie
  File "renpy/common/000statements.rpy", line 531, in execute_call_screen
    store._return = renpy.call_screen(name, *args, **kwargs)
TypeError: unbound method get_tooltip() must be called with Return instance as first argument (got nothing instead)

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

Full traceback:
  File "game/script.rpy", line 6022, in script call
    call first_memory
  File "game/memories.rpy", line 398, in script
    call screen help_katie
  File "/Applications/renpy-6.99.11-sdk/renpy/ast.py", line 1947, in execute
    self.call("execute")
  File "/Applications/renpy-6.99.11-sdk/renpy/ast.py", line 1935, in call
    return renpy.statements.call(method, parsed, *args, **kwargs)
  File "/Applications/renpy-6.99.11-sdk/renpy/statements.py", line 277, in call
    return method(parsed, *args, **kwargs)
  File "renpy/common/000statements.rpy", line 531, in execute_call_screen
    store._return = renpy.call_screen(name, *args, **kwargs)
  File "/Applications/renpy-6.99.11-sdk/renpy/exports.py", line 2896, in call_screen
    rv = renpy.ui.interact(mouse="screen", type="screen", roll_forward=roll_forward)
  File "/Applications/renpy-6.99.11-sdk/renpy/ui.py", line 295, in interact
    rv = renpy.game.interface.interact(roll_forward=roll_forward, **kwargs)
  File "/Applications/renpy-6.99.11-sdk/renpy/display/core.py", line 2701, in interact
    repeat, rv = self.interact_core(preloads=preloads, trans_pause=trans_pause, **kwargs)
  File "/Applications/renpy-6.99.11-sdk/renpy/display/core.py", line 3509, in interact_core
    rv = renpy.display.focus.mouse_handler(ev, x, y)
  File "/Applications/renpy-6.99.11-sdk/renpy/display/focus.py", line 397, in mouse_handler
    return change_focus(new_focus, default=default)
  File "/Applications/renpy-6.99.11-sdk/renpy/display/focus.py", line 352, in change_focus
    set_focused(current, newfocus.arg, newfocus.screen)
  File "/Applications/renpy-6.99.11-sdk/renpy/display/focus.py", line 109, in set_focused
    new_tooltip = widget._get_tooltip()
  File "/Applications/renpy-6.99.11-sdk/renpy/display/behavior.py", line 746, in _get_tooltip
    return get_tooltip(self.action)
  File "/Applications/renpy-6.99.11-sdk/renpy/display/behavior.py", line 373, in get_tooltip
    return func()
TypeError: unbound method get_tooltip() must be called with Return instance as first argument (got nothing instead)

It's always worked before as it's a pretty simple screen:

Code: Select all

screen help_katie:
    hbox:
        xpos 650
        ypos 400 
        
        textbutton "HELP HER" action Return
I've made some changes since I last tested this part, but mainly narrative. Otherwise, all I have done is update Ren'Py. Any ideas? I can't find this issue online.
Last edited by Kinmoku on Wed Jun 19, 2019 3:10 am, edited 1 time in total.

User avatar
Remix
Eileen-Class Veteran
Posts: 1628
Joined: Tue May 30, 2017 6:10 am
Completed: None... yet (as I'm still looking for an artist)
Projects: An un-named anime based trainer game
Contact:

Re: "Unbound method get_tooltip() must be called with Return"

#2 Post by Remix »

action Return()
Frameworks & Scriptlets:

User avatar
Kinmoku
Miko-Class Veteran
Posts: 591
Joined: Mon Aug 11, 2014 9:39 am
Completed: One Night Stand
Projects: VIDEOVERSE
Tumblr: gamesbykinmoku
itch: kinmoku
Location: Germany
Contact:

Re: "Unbound method get_tooltip() must be called with Return"

#3 Post by Kinmoku »

Remix wrote: Tue Jun 18, 2019 2:14 pm action Return()
It works thank you. What is the reason for it to stop working now?

drKlauz
Veteran
Posts: 239
Joined: Mon Oct 12, 2015 3:04 pm
Contact:

Re: [SOLVED] "Unbound method get_tooltip() must be called with Return"

#4 Post by drKlauz »

Return is class, calling class, like this - Return(), is instancing this class, it return instance of class. Basically class is blueprint, instance of class is actual thing made by this blueprint.
Instance of Return return either None or some value.
But Return() also return value - instance of class.
So sometimes using action Return will work, even if it is obvious bug.
Unless you really know what you doing, like using class method __call__ etc, you should always use action ActionName(action_arguments), not action ActionName.
I may be available for hire, check my thread: viewtopic.php?f=66&t=51350

User avatar
Kinmoku
Miko-Class Veteran
Posts: 591
Joined: Mon Aug 11, 2014 9:39 am
Completed: One Night Stand
Projects: VIDEOVERSE
Tumblr: gamesbykinmoku
itch: kinmoku
Location: Germany
Contact:

Re: [SOLVED] "Unbound method get_tooltip() must be called with Return"

#5 Post by Kinmoku »

drKlauz wrote: Wed Jun 19, 2019 5:13 am Return is class, calling class, like this - Return(), is instancing this class, it return instance of class. Basically class is blueprint, instance of class is actual thing made by this blueprint.
Instance of Return return either None or some value.
But Return() also return value - instance of class.
So sometimes using action Return will work, even if it is obvious bug.
Unless you really know what you doing, like using class method __call__ etc, you should always use action ActionName(action_arguments), not action ActionName.
Okay :) Thank you for explaining it to me.

philat
Eileen-Class Veteran
Posts: 1909
Joined: Wed Dec 04, 2013 12:33 pm
Contact:

Re: [SOLVED] "Unbound method get_tooltip() must be called with Return"

#6 Post by philat »

Updates often enforce correct syntax when mistakes were allowed before.

Post Reply

Who is online

Users browsing this forum: Bing [Bot]