Value 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
User avatar
WhiteMageChiu
Regular
Posts: 35
Joined: Thu Dec 12, 2013 8:35 pm
Completed: Two Steps Back
Projects: I Woke Up Because it Hurt, A Case of Two Souls Becoming One, In Which I Was Never the Hero
Organization: CureAll
Tumblr: chiuscanvas
Deviantart: inuyashatoysrule
Location: [The World]
Contact:

Value Error

#1 Post by WhiteMageChiu » Mon Nov 03, 2014 8:47 pm

I'm sorry, but an uncaught exception occurred.

While running game code:
File "game/script.rpy", line 35, in script
File "game/script.rpy", line 35, in python
ValueError: need more than 1 value to unpack

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

Full traceback:
File "C:\Users\NSA2011\Desktop\renpy-6.15.5-sdk\renpy\execution.py", line 288, in run
node.execute()
File "C:\Users\NSA2011\Desktop\renpy-6.15.5-sdk\renpy\ast.py", line 718, in execute
renpy.python.py_exec_bytecode(self.code.bytecode, self.hide, store=self.store)
File "C:\Users\NSA2011\Desktop\renpy-6.15.5-sdk\renpy\python.py", line 1297, in py_exec_bytecode
exec bytecode in globals, locals
File "game/script.rpy", line 35, in <module>
$ result = renpy.imagemap("bg5.png","bg5movel.png","bg1.png"),[(770, 300, 130, 70, "arrow"),(610, 2, 200, 75, "door"),(40, 320, 80, 50, "frame"),(440, 570, 200, 45, "glass")]
File "C:\Users\NSA2011\Desktop\renpy-6.15.5-sdk\renpy\exports.py", line 798, in imagemap
style=style, **properties)
File "C:\Users\NSA2011\Desktop\renpy-6.15.5-sdk\renpy\ui.py", line 789, in imagemap_compat
for x0, y0, x1, y1, result in hotspots:
ValueError: need more than 1 value to unpack

Windows-7-6.1.7601-SP1
Ren'Py 6.15.5.354
A Ren'Py Game 0.0


---

So that's the error I get, I'm trying to create an imagemap where there are multiple places you can click for different outcomes.

basic code I've got so far:

$ result = renpy.imagemap("bg5.png","bg5movel.png","bg1.png"),[(770, 300, 130, 70, "arrow"),(610, 2, 200, 75, "door"),(40, 320, 80, 50, "frame"),(440, 570, 200, 45, "glass")]

if result == "arrow":
scene background bedroomr
with fade
b "The other side of my room."

if result == "door":
scene background abyss
with fade
b "The kitchen."

if result == "frame":
b "An empty picture frame."

if result == "glass":
b "some glass on the floor."


Thanks for the help-!
https://twitter.com/CureAllChiu
http://www.chiuscanvas.tumblr.com

Keep updated on my horror/ mystery visual novel [I Woke Up Because It Hurt!]
[Currently @ 20% completion- chugging along on coding, art, music. Writing completed]

User avatar
TheChris
Regular
Posts: 47
Joined: Sat Oct 11, 2014 9:26 pm
Projects: Stickshooter
Deviantart: innocencecanceller
Location: United States
Contact:

Re: Value Error

#2 Post by TheChris » Mon Nov 03, 2014 9:21 pm

Here's an idea...

screen this_screen_name:

imagemap:
ground "???.png"
hover "???.png"

hotspot (?,?,?,?) action [SetVariable("result",'frame'),Hide("this_screen_name"),Return()]
hotspot (?,?,?,?) action [SetVariable("result",'glass'),Hide("this_screen_name"),Return()]


After you call this screen from your script, you should be able to select one of the hotspots and then return to the game.

e "xxx"
window hide
call screen this_screen_name
window show
if result == 'frame':
e "yyy"
elif result == 'glass':
e "zzz"

Post Reply

Who is online

Users browsing this forum: Alex, gas, Majestic-12 [Bot], RicharDann