Inventory system?

so id like to add an small inventory, how would one go about doing it?
e.i a door is locked and need a key to be opened
u find the key, collects it and re-clicks on the locked door to open it.
thanks in advance!

Hey @Tsake_Reinhertz, here’s a little demo of a point and click game with an inventory. On frame 3, there’s a “special box”. When you click it, it shows up in your inventory.

The trick is that I have my inventory on a different layer, and I stretch the keyframe that my inventory is on to cover all of the frames of my game. This makes it show up in every frame, and makes it interactive on every frame as well.

inventory_game-3.28.2018 8.02.17 AM.zip (879.1 KB)

thanks! ill try and imploment it into my game^^

Hi @Luxapodular!
I’m actually very curious of how this inventory works, since it could be usefull for my own project. Sadly, it seems I can’t open this file in Wick Editor, though I really would like to know about what happens ‘behind the scenes’. Is there any way you could share this information?

Hi @katosch!

I made this system, you can check out the Wick file:
My Project5-18-2020_10-05-33AM.wick (21.4 KB)

I think this is a similar system to @Luxapodular, the way it works is by having an inventory layer with the frame stretched to be over the whole project.

When you click on an object to add to the inventory, it sets the opacity of the icon in the inventory to 1, and removes the object from the game layer (with this.remove()).

Let me know if you have any questions, hope this helps!

1 Like

Thank you so much @nick! This did help me a lot.
Now I am wondering if there is any way to interact with the objects in the inventory. I tried adding a mousedrag to one of the icons but it just kinda kicks the object out of the working space. Any advise on this? I would really appreciate it :sweat_smile:

Happy to help @katosch! Not sure what you mean by kicks the object out of the working space? How would you want the objects to be used (like is it a key to unlock a door?). You can test whether an item is in the inventory by checking:

if (Inventory.obj1_icon.opacity == 1)

I think a click and drag system would be tricky to do, but definitely possible if you want. It might be easier to do a system where the inventory has slots, and there is a single “active” slot that you can change to use different items in the inventory (like Minecraft), and then you just click to use the active item.

Let me know what you think! :grin: