Hi,
I'm having a problem adding an object to the inventory; the object is added correctly but I get this error when I want to access the inventory:
'RevertableList' object has no attribute 'image'
This is my inventory code:
NOTE: Error occurs when processing the instruction: $ pic = item.image
It's an object (clothes) that has been added in the new update; and I do it with the following line:
The image is defined but for some reason it gives me error
Do you know what this mistake can be due to and how to solve it?
Thanks in advance.
BTW, I remember that in another update I found that problem when I added a new object that was not present before... I solved it but right now I can't remember how
I'm having a problem adding an object to the inventory; the object is added correctly but I get this error when I want to access the inventory:
'RevertableList' object has no attribute 'image'
This is my inventory code:
NOTE: Error occurs when processing the instruction: $ pic = item.image
Code:
screen inventory_screen:
add "gui/inventory.png"
modal True
imagebutton auto "nav/exit_inv_%s.webp" xpos 930 ypos 10 xalign 1.0 focus_mask True action [ Hide("inventory_screen")]
$ x = 515
$ y = 0
$ i = 0
$ sorted_items = sorted(inventory.items)
$ next_inv_page = inv_page + 1
if next_inv_page > int(len(inventory.items)/9):
$ next_inv_page = 0
for item in sorted_items:
if i+1 <= (inv_page+1)*9 and i+1>inv_page*9:
$ x += 270
if i%3==0:
$ y += 235
$ x = 515
$ pic = item.image
imagebutton idle pic hover pic xpos x+300 ypos y+110 action [Hide("gui_tooltip"), SetVariable("item", item), selectItem(item)] hovered [ Play ("sound", "sfx/click.wav") ] unhovered [Hide("gui_tooltip")] at inv_eff
if item.selected:
add "gui/selected.png" xpos x+200 ypos y+70 anchor(.5,.5)
$ selitem = (item_use)
$ i += 1
if len(inventory.items)>9:
textbutton _("Next Page") action [SetVariable('inv_page', next_inv_page), Show("inventory_screen")] xpos .475 ypos .83
Code:
default sportdress_2 = Item("sportdress_2", element="sportdress_2", image="shopfashion/items/sportdress_2_small_idle.png")
Do you know what this mistake can be due to and how to solve it?
Thanks in advance.
BTW, I remember that in another update I found that problem when I added a new object that was not present before... I solved it but right now I can't remember how
Last edited: