ValueError: need more than 2 values to unpack

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
NEOTH1X_
Newbie
Posts: 5
Joined: Wed Dec 16, 2020 9:40 am
Contact:

ValueError: need more than 2 values to unpack

#1 Post by NEOTH1X_ » Mon Dec 21, 2020 8:39 am

So, I'm still a beginner when it comes to Ren'py and I get very confused when it comes to screens. And I've been trying to make an imagemap that shows another screen, but I keep having an error. I did see another post on this error but I can't comprehend the language haha. I will list the traceback and my code below.

Code: Select all

I'm sorry, but an uncaught exception occurred.

While running game code:
  File "game/introduction.rpy", line 554, in script
    pov "nice"
  File "game/custom_screens.rpy", line 10, in execute
    screen route_picker():
  File "game/custom_screens.rpy", line 10, in execute
    screen route_picker():
  File "game/custom_screens.rpy", line 11, in execute
    window:
  File "game/custom_screens.rpy", line 19, in execute
    imagemap:
  File "game/custom_screens.rpy", line 25, in execute
    hotspot (1000, 432) action Show('route_name')
ValueError: need more than 2 values to unpack

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

Full traceback:
  File "game/introduction.rpy", line 554, in script
    pov "nice"
  File "C:\Users\Birdi\OneDrive\Desktop\renpy-7.3.5-sdk\renpy\ast.py", line 708, in execute
    renpy.exports.say(who, what, *args, **kwargs)
  File "C:\Users\Birdi\OneDrive\Desktop\renpy-7.3.5-sdk\renpy\exports.py", line 1345, in say
    who(what, *args, **kwargs)
  File "C:\Users\Birdi\OneDrive\Desktop\renpy-7.3.5-sdk\renpy\character.py", line 1142, in __call__
    self.do_display(who, what, cb_args=self.cb_args, **display_args)
  File "C:\Users\Birdi\OneDrive\Desktop\renpy-7.3.5-sdk\renpy\character.py", line 842, in do_display
    **display_args)
  File "C:\Users\Birdi\OneDrive\Desktop\renpy-7.3.5-sdk\renpy\character.py", line 591, in display_say
    rv = renpy.ui.interact(mouse='say', type=type, roll_forward=roll_forward)
  File "C:\Users\Birdi\OneDrive\Desktop\renpy-7.3.5-sdk\renpy\ui.py", line 297, in interact
    rv = renpy.game.interface.interact(roll_forward=roll_forward, **kwargs)
  File "C:\Users\Birdi\OneDrive\Desktop\renpy-7.3.5-sdk\renpy\display\core.py", line 2702, in interact
    repeat, rv = self.interact_core(preloads=preloads, trans_pause=trans_pause, **kwargs)
  File "C:\Users\Birdi\OneDrive\Desktop\renpy-7.3.5-sdk\renpy\display\core.py", line 3094, in interact_core
    root_widget.visit_all(lambda i : i.per_interact())
  File "C:\Users\Birdi\OneDrive\Desktop\renpy-7.3.5-sdk\renpy\display\core.py", line 541, in visit_all
    d.visit_all(callback, seen)
  File "C:\Users\Birdi\OneDrive\Desktop\renpy-7.3.5-sdk\renpy\display\core.py", line 541, in visit_all
    d.visit_all(callback, seen)
  File "C:\Users\Birdi\OneDrive\Desktop\renpy-7.3.5-sdk\renpy\display\core.py", line 541, in visit_all
    d.visit_all(callback, seen)
  File "C:\Users\Birdi\OneDrive\Desktop\renpy-7.3.5-sdk\renpy\display\screen.py", line 430, in visit_all
    callback(self)
  File "C:\Users\Birdi\OneDrive\Desktop\renpy-7.3.5-sdk\renpy\display\core.py", line 3094, in <lambda>
    root_widget.visit_all(lambda i : i.per_interact())
  File "C:\Users\Birdi\OneDrive\Desktop\renpy-7.3.5-sdk\renpy\display\screen.py", line 440, in per_interact
    self.update()
  File "C:\Users\Birdi\OneDrive\Desktop\renpy-7.3.5-sdk\renpy\display\screen.py", line 625, in update
    self.screen.function(**self.scope)
  File "game/custom_screens.rpy", line 10, in execute
    screen route_picker():
  File "game/custom_screens.rpy", line 10, in execute
    screen route_picker():
  File "game/custom_screens.rpy", line 11, in execute
    window:
  File "game/custom_screens.rpy", line 19, in execute
    imagemap:
  File "game/custom_screens.rpy", line 25, in execute
    hotspot (1000, 432) action Show('route_name')
  File "C:\Users\Birdi\OneDrive\Desktop\renpy-7.3.5-sdk\renpy\ui.py", line 1294, in _hotspot
    x, y, w, h = spot
ValueError: need more than 2 values to unpack

Windows-8-6.2.9200
Ren'Py 7.3.5.606

game draft 1.0
Mon Dec 21 20:29:08 2020

Code: Select all


screen route_name():
    hbox:
        yalign 0.5
        xalign 0.5

        text "Test"


screen route_picker():
    window:

        xalign 0.5
        yalign 0.5

        hbox:
            text "{font=calligraffiti.ttf}{color=#000000}{size=35}I enjoyed talking to ... the most."

        imagemap:

            idle "gui/lbutton_idle.png"
            hover "gui/lbutton_hover.png"
            ground "gui/lbutton_ground.png"

            hotspot (1000, 432) action Show('route_name')

        background Image("lined_paper.png", xalign=0.5, yalign=0.5)
        
[\code]

Once again, I don't quite understand how screens work, so any advice as to how to fix the error and/or make my code better would be greatly appreciated!

rayminator
Miko-Class Veteran
Posts: 754
Joined: Fri Feb 09, 2018 12:05 am
Location: Canada
Contact:

Re: ValueError: need more than 2 values to unpack

#2 Post by rayminator » Mon Dec 21, 2020 8:56 am

1. Your hotspot is missing the position or height & width

Post Reply

Who is online

Users browsing this forum: No registered users