Could someone help me with this error?
I have this screen with image buttons that changes the value of Boolean variables. The code works great until I try to exit the game while the screen is called.
The screen is being called here:
Code: Select all
$ ladysmantles = True
$ redrobin = True
while ladysmantles or redrobin:
call screen shelf
if _return == "ladysmantles":
if redrobin == True:
show redrobinShelf
else:
show emptyShelf
jawad_serious "لقد وجدتك!"
show ladysmantles with zoomin
$ renpy.pause(1, hard=True)
hide ladysmantles with zoomout
$inventory.add(ladysmantlesIcon)
hide redrobinShelf
hide emptyShelf
elif _return == "redrobin":
if ladysmantles == True:
show ladysmantlesShelf
else:
show emptyShelf
jawad_serious "عشبةٌ ذات ساقٍ أحمر."
show redrobin with zoomin
$ renpy.pause(1, hard=True)
hide redrobin with zoomout
$inventory.add(redrobinIcon)
hide ladysmantlesShelf
hide emptyShelf
Code: Select all
screen shelf:
add "emptyShelf.jpg"
if ladysmantles:
imagebutton idle "ladysmantlesImagebutton.png" hover "ladysmantlesImagebutton.png" xpos 1069 ypos 693 action [Return("ladysmantles"), ToggleVariable("ladysmantles", False)] mouse "imagemap"
if redrobin:
imagebutton idle "redrobinImagebutton.png" hover "redrobinImagebutton.png" xpos 267 ypos 131 action [Return("redrobin"), ToggleVariable("redrobin", False)] mouse "imagemap"
hbox align (.95,.04) spacing 20:
imagebutton idle "backpack.png" hover "backpack.png" action Show("inventory_screen")
Code: Select all
I'm sorry, but an uncaught exception occurred.
While running game code:
File "renpy/common/00action_data.rpy", line 168, in get_selected
rv = getattr(self.object, self.field)
AttributeError: 'StoreModule' object has no attribute 'ladysmantles'
-- Full Traceback ------------------------------------------------------------
Full traceback:
File "renpy/common/_layout/screen_main_menu.rpym", line 28, in script
python hide:
File "C:\Users\Fatimah\Desktop\renpy-6.99.12.2-sdk\renpy\ast.py", line 814, in execute
renpy.python.py_exec_bytecode(self.code.bytecode, self.hide, store=self.store)
File "C:\Users\Fatimah\Desktop\renpy-6.99.12.2-sdk\renpy\python.py", line 1695, in py_exec_bytecode
exec bytecode in globals, locals
File "renpy/common/_layout/screen_main_menu.rpym", line 30, in <module>
ui.interact()
File "C:\Users\Fatimah\Desktop\renpy-6.99.12.2-sdk\renpy\ui.py", line 285, in interact
rv = renpy.game.interface.interact(roll_forward=roll_forward, **kwargs)
File "C:\Users\Fatimah\Desktop\renpy-6.99.12.2-sdk\renpy\display\core.py", line 2492, in interact
repeat, rv = self.interact_core(preloads=preloads, trans_pause=trans_pause, **kwargs)
File "C:\Users\Fatimah\Desktop\renpy-6.99.12.2-sdk\renpy\display\core.py", line 2759, in interact_core
root_widget.visit_all(lambda i : i.per_interact())
File "C:\Users\Fatimah\Desktop\renpy-6.99.12.2-sdk\renpy\display\core.py", line 482, in visit_all
d.visit_all(callback)
File "C:\Users\Fatimah\Desktop\renpy-6.99.12.2-sdk\renpy\display\core.py", line 482, in visit_all
d.visit_all(callback)
File "C:\Users\Fatimah\Desktop\renpy-6.99.12.2-sdk\renpy\display\core.py", line 482, in visit_all
d.visit_all(callback)
File "C:\Users\Fatimah\Desktop\renpy-6.99.12.2-sdk\renpy\display\core.py", line 482, in visit_all
d.visit_all(callback)
File "C:\Users\Fatimah\Desktop\renpy-6.99.12.2-sdk\renpy\display\screen.py", line 403, in visit_all
self.child.visit_all(callback)
File "C:\Users\Fatimah\Desktop\renpy-6.99.12.2-sdk\renpy\display\core.py", line 482, in visit_all
d.visit_all(callback)
File "C:\Users\Fatimah\Desktop\renpy-6.99.12.2-sdk\renpy\display\core.py", line 484, in visit_all
callback(self)
File "C:\Users\Fatimah\Desktop\renpy-6.99.12.2-sdk\renpy\display\core.py", line 2759, in <lambda>
root_widget.visit_all(lambda i : i.per_interact())
File "C:\Users\Fatimah\Desktop\renpy-6.99.12.2-sdk\renpy\display\behavior.py", line 788, in per_interact
if self.is_selected():
File "C:\Users\Fatimah\Desktop\renpy-6.99.12.2-sdk\renpy\display\behavior.py", line 778, in is_selected
return is_selected(self.action)
File "C:\Users\Fatimah\Desktop\renpy-6.99.12.2-sdk\renpy\display\behavior.py", line 356, in is_selected
return any(is_selected(i) for i in action)
File "C:\Users\Fatimah\Desktop\renpy-6.99.12.2-sdk\renpy\display\behavior.py", line 356, in <genexpr>
return any(is_selected(i) for i in action)
File "C:\Users\Fatimah\Desktop\renpy-6.99.12.2-sdk\renpy\display\behavior.py", line 359, in is_selected
return action.get_selected()
File "renpy/common/00action_data.rpy", line 168, in get_selected
rv = getattr(self.object, self.field)
AttributeError: 'StoreModule' object has no attribute 'ladysmantles'
Windows-8-6.2.9200
Ren'Py 6.99.12.2.2029
Thanks