inventory-system icon indicating copy to clipboard operation
inventory-system copied to clipboard

InventoryItem Class/Type Doesnt Exist

Open iMaCHVFX opened this issue 1 year ago • 4 comments

Im trying to follow the "tutorial" in the wiki, but when you get to "add item to inventory" part of it

https://github.com/expressobits/inventory-system/wiki/Inventory-Node#Add-items-to-inventory

you're thrown the error Parse Error: Parse Error: Could not find type "InventoryItem" in the current scope

i followed the tutorial in the wiki 1:1 and it just doesnt work

i looked through the addon files and i couldnt find a single thing referring to "InventoryItem" the addons file structure also looks ENTIRELY different from the tutorials

iMaCHVFX avatar Jul 28 '24 02:07 iMaCHVFX

Problem solved!

the tutorial is outdated, using InventoryItem instead of Item would highly recommend updating that on the wiki

i lost 2 days of confusion to this

iMaCHVFX avatar Jul 28 '24 23:07 iMaCHVFX

update # 2

the problem went from InventoryItem not working and needing to be Item

to Item not having anything for name

so the slot.item.definition.name from the tutorial doesnt work. returning ``Invalid get index 'name' (on base: 'Item')

so i do think there is a major differences between what you have documented here and the actual addon its self, makes it really hard to use.

cause everything about the addon would make this stuff so much more simple, but the lack of documentation, and the misleading tutorial make it literally impossible to use.

iMaCHVFX avatar Jul 29 '24 00:07 iMaCHVFX

Hello @iMaCHVFX , how are you? Sorry if the tutorial ended up being outdated. The addon itself contains this tutorial in the inventory-system-demos/tutorials/tutorial_01_inventory folder. Testing it here, it is functional. Test this scene and check if the problem could be something else, in the case of the C++ module not having loaded properly.

https://github.com/expressobits/inventory-system/blob/addon/addons/inventory-system-demos/tutorials/tutorial_01_inventory/inventory_tutorial.gd

scriptsengineer avatar Jul 29 '24 01:07 scriptsengineer

hi yeah, the tutorial built in is how i figured out that InventoryItem was no longer correct, and then referenced that for the rest of my attempt doing it, ive already begun writing my inventory from scratch but i will test this in the morning when i wake up in a brand new project file to see if that might be the problem ^-^

iMaCHVFX avatar Jul 29 '24 06:07 iMaCHVFX