I can't access my kwargs, renpy will throw this exception:
Code: Select all
File "game/test_item_callable.rpy", line 62, in script
"Click the Button"
File "renpy/common/00action_other.rpy", line 430, in __call__
rv = self.callable(*self.args, **self.kwargs)
File "game/test_item_callable.rpy", line 17, in useItem
currentItem = kwargs['i']
KeyError: 'i'
Code: Select all
...
imagebutton xpos 0.5 ypos 0.12 idle girlObj.imagename hover girlObj.imagename action [Function(useItem ,[],{'i': item, 'g': girlObj}),Hide("item_usage_screen")]
...
def useItem(*args, **kwargs):
currentItem = kwargs['i']
currentCharacter = kwargs['g']
renpy.call_in_new_context('executeItemLabel')
return
I hope you can help me to get this work.
Sincerly,
Grauen