Error
Code: Select all
I'm sorry, but an uncaught exception occurred.
While running game code:
File "renpy/common/00gamemenu.rpy", line 163, in script
$ ui.interact()
File "renpy/common/00gamemenu.rpy", line 163, in <module>
$ ui.interact()
File "renpy/common/00action_other.rpy", line 420, in __call__
self.callable(*self.args, **self.kwargs)
File "game/script.rpy", line 67, in combine_items
if item in recipe and item.selected:
TypeError: argument of type 'Recipe' is not iterable
-- Full Traceback ------------------------------------------------------------
Full traceback:
File "renpy/common/00gamemenu.rpy", line 163, in script
$ ui.interact()
File "/Applications/Renpy6.99/renpy/ast.py", line 785, in execute
renpy.python.py_exec_bytecode(self.code.bytecode, self.hide, store=self.store)
File "/Applications/Renpy6.99/renpy/python.py", line 1448, in py_exec_bytecode
exec bytecode in globals, locals
File "renpy/common/00gamemenu.rpy", line 163, in <module>
$ ui.interact()
File "/Applications/Renpy6.99/renpy/ui.py", line 277, in interact
rv = renpy.game.interface.interact(roll_forward=roll_forward, **kwargs)
File "/Applications/Renpy6.99/renpy/display/core.py", line 2276, in interact
repeat, rv = self.interact_core(preloads=preloads, **kwargs)
File "/Applications/Renpy6.99/renpy/display/core.py", line 2907, in interact_core
rv = root_widget.event(ev, x, y, 0)
File "/Applications/Renpy6.99/renpy/display/layout.py", line 877, in event
rv = i.event(ev, x - xo, y - yo, cst)
File "/Applications/Renpy6.99/renpy/display/transition.py", line 45, in event
return self.new_widget.event(ev, x, y, st) # E1101
File "/Applications/Renpy6.99/renpy/display/layout.py", line 877, in event
rv = i.event(ev, x - xo, y - yo, cst)
File "/Applications/Renpy6.99/renpy/display/layout.py", line 877, in event
rv = i.event(ev, x - xo, y - yo, cst)
File "/Applications/Renpy6.99/renpy/display/screen.py", line 625, in event
rv = self.child.event(ev, x, y, st)
File "/Applications/Renpy6.99/renpy/display/layout.py", line 877, in event
rv = i.event(ev, x - xo, y - yo, cst)
File "/Applications/Renpy6.99/renpy/display/behavior.py", line 785, in event
return handle_click(self.clicked)
File "/Applications/Renpy6.99/renpy/display/behavior.py", line 728, in handle_click
rv = run(action)
File "/Applications/Renpy6.99/renpy/display/behavior.py", line 283, in run
new_rv = run(i, *args, **kwargs)
File "/Applications/Renpy6.99/renpy/display/behavior.py", line 290, in run
return var(*args, **kwargs)
File "renpy/common/00action_other.rpy", line 420, in __call__
self.callable(*self.args, **self.kwargs)
File "game/script.rpy", line 67, in combine_items
if item in recipe and item.selected:
TypeError: argument of type 'Recipe' is not iterable
Darwin-14.4.0-x86_64-i386-64bit
Ren'Py 6.99.4.467
project_zero 0.0
Code: Select all
init python:
def combine_items():
for item in inventory.items:
for recipe in recipes:
recipe_tmp = recipe
if item in Recipe and item.selected:
recipe_tmp.remove(item)
if len(recipe_tmp) == 1:
for tmp_item in recipe:
pass
inventory.drop(item)
inventory.add(recipe[0])
return
class Recipe(store.object):
def __init__(self, items=[], item_created=None):
self.items = items
self.item_created = item_created
def combine_check(self):
too_many=False # too many items selected?
correct_recipe_items = copy.copy(self.items) # make a copy of the list of recipe items
for item in inventory.selected_items:
if item.recipeItem: # and item in self.items:
if item in correct_recipe_items:
correct_recipe_items.remove(item) # remove the current item from the list of correct_recipe_items; if correct_recipe_items is empty at the end, we have created the recipe
if not (item in self.items): # current item is not in this recipe
too_many=True
if len(correct_recipe_items) == 0 and not too_many: # correct_recipe_items is empty means we have selecte just the right items
inventory.add(self.item_created) # add the newly created item
for drop_item in self.items: # remove all the items in this recipe from inventory
inventory.drop(drop_item)
if item in recipe and item.selected:
TypeError: argument of type 'Recipe' is not iterable
Line 67 is
Code: Select all
if item in recipe and item.selected:
Thinking there was something wrong with my class Recipe, I tried renaming 'Recipe' in all manner of ways, but nothing.
Any ideas?