Pop-up menu and NoneType is not callable error

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
number473
Regular
Posts: 195
Joined: Tue Dec 15, 2009 4:20 am
Projects: The Duke's Daughter
Location: Cape Town
Contact:

Pop-up menu and NoneType is not callable error

#1 Post by number473 »

Here's a weird one. I wrote the following code which has the quick menu (in the form of an imagemap) pop-up at the bottom of the screen when you move the mouse to the bottom of the screen. That part works fine.
Then I tried to add the following behavior: there is a button (the first hotspot) which when selected causes the quick menu to no longer hide itself automatically.

Code: Select all

screen quick_menu:
    
    zorder 5
    
    mousearea:
        area (150, 540, 500, 60)
        hovered Show("quick_menu_imagemap")
    if not persistent.pin_qm:
        mousearea:
            area (150, 540, 500, 60)
            unhovered Hide("quick_menu_imagemap")

screen quick_menu_imagemap:

    zorder 5
    
    imagemap:
        at qm_slide
        auto "ui/quickmenu_%s.png"
        
        hotspot (26, 0, 28, 32):
            action ToggleField(persistent, "pin_qm",
                    true_value=True, false_value=None)
        hotspot (72, 0, 62, 32) action ShowMenu("gm_preferences")
        hotspot (152, 0, 28, 32) action Preference("auto-forward", "toggle")
        hotspot (198, 0, 42, 32) action Skip()
        hotspot (260, 0, 44, 32) action QuickSave()
        hotspot (324, 0, 44, 32) action QuickLoad()
        hotspot (388, 0, 28, 32) action HideInterface()
I finally got it to have the behavior I wanted, but then encountered the error below. The error occurs under the following conditions:
- I have displayed the quick menu at least once by moving the mouse into the mousearea
- I have gone on to the next line of text (or a later line)
- I try to save

Any insight into what went wrong would be appreciated.
I'm sorry, but an uncaught exception occurred.

While running game code:
File "game/script.rpy", line 5, in script
"Though close to home, this was the first time I had cause to visit it."
TypeError: 'NoneType' object is not callable

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

Full traceback:
File "/home/n473/nobin/renpy-6.13.8/renpy/execution.py", line 261, in run
node.execute()
File "/home/n473/nobin/renpy-6.13.8/renpy/ast.py", line 396, in execute
renpy.exports.say(who, what, interact=self.interact)
File "/home/n473/nobin/renpy-6.13.8/renpy/exports.py", line 699, in say
who(what, interact=interact)
File "/home/n473/nobin/renpy-6.13.8/renpy/character.py", line 770, in __call__
self.do_display(who, what, cb_args=self.cb_args, **display_args)
File "/home/n473/nobin/renpy-6.13.8/renpy/character.py", line 664, in do_display
**display_args)
File "/home/n473/nobin/renpy-6.13.8/renpy/character.py", line 471, in display_say
rv = renpy.ui.interact(mouse='say', type=type, roll_forward=roll_forward)
File "/home/n473/nobin/renpy-6.13.8/renpy/ui.py", line 237, in interact
rv = renpy.game.interface.interact(**kwargs)
File "/home/n473/nobin/renpy-6.13.8/renpy/display/core.py", line 1798, in interact
repeat, rv = self.interact_core(preloads=preloads, **kwargs)
File "/home/n473/nobin/renpy-6.13.8/renpy/display/core.py", line 2322, in interact_core
rv = root_widget.event(ev, x, y, 0)
File "/home/n473/nobin/renpy-6.13.8/renpy/display/layout.py", line 714, in event
rv = i.event(ev, x - xo, y - yo, cst)
File "/home/n473/nobin/renpy-6.13.8/renpy/display/layout.py", line 714, in event
rv = i.event(ev, x - xo, y - yo, cst)
File "/home/n473/nobin/renpy-6.13.8/renpy/display/layout.py", line 714, in event
rv = i.event(ev, x - xo, y - yo, cst)
File "/home/n473/nobin/renpy-6.13.8/renpy/display/screen.py", line 298, in event
rv = self.child.event(ev, x, y, st)
File "/home/n473/nobin/renpy-6.13.8/renpy/display/layout.py", line 714, in event
rv = i.event(ev, x - xo, y - yo, cst)
File "/home/n473/nobin/renpy-6.13.8/renpy/display/motion.py", line 733, in event
rv = d.event(ev, cx, cy, st)
File "/home/n473/nobin/renpy-6.13.8/renpy/display/layout.py", line 714, in event
rv = i.event(ev, x - xo, y - yo, cst)
File "/home/n473/nobin/renpy-6.13.8/renpy/display/behavior.py", line 623, in event
rv = run(self.clicked)
File "/home/n473/nobin/renpy-6.13.8/renpy/display/behavior.py", line 197, in run
new_rv = i(*args)
File "common/00screen.rpy", line 1134, in __call__
renpy.save(fn, extra_info=save_name)
File "/home/n473/nobin/renpy-6.13.8/renpy/loadsave.py", line 157, in save
dump((roots, renpy.game.log), logf)
File "/home/n473/nobin/renpy-6.13.8/renpy/loadsave.py", line 46, in dump
cPickle.dump(o, f, cPickle.HIGHEST_PROTOCOL)
TypeError: 'NoneType' object is not callable

Linux-3.0.0-12-generic-i686-with-debian-wheezy-sid
Ren'Py 6.13.8.1675
The Duke's Daughter 0.0
Mental weather report: Cloudy with a possibility of brain storms.

Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot], Bing [Bot], DewyNebula