Array-based inventory

  • 69 favourites


Attached Files

The following files have been attached to this tutorial:



Download now 83.25 KB


11,041 visits, 37,722 views



This tutorial is licensed under CC BY 4.0. Please refer to the license text if you wish to reuse, share or remix the content contained within this tutorial.

Hello everyone. I saw a couple of tutorials about making inventory and decided to share with you my way of making it.

I warn you that English is not my native language and in writing this tutorial, I used a translator. So if you found a grammatical error or a violation of the logic of the text, feel free to notice me.


This is how our inventory will work:

We need Array with 2 lines height and %how-many-inventory-slots-you-want% width.

In first line we will keep item's ID and in the second one - number of it.

Note, that our ID is not Construct 2 objects UID. You need to come up with this numbers by yourself. For example for item "Apple" we can assign ID = 1 and for item "Coin" ID = 2.

When you will click on inventory slot you need to save information about this slot to continue work. For this we need to create 3 variables:

startslot = id of start inventory slot

startitem = id of item in this slot

startnumber = number of this items

You may be asking yourself. Why, if there is an object in a cell, his number is 0 instead of 1.

Actually it does not matter. You'll see it down the tutorial.

After you have selected the required slot you need to select slot where you want to shift your item.

For this we need 3 more variables:




After this, you just need to change the values ​​in the array by using created variables.,0) →,0),1) →,1),0) →,0),1) →,1)

In fact, we did what we needed. We now turn to the practice.


  • Order by
Want to leave a comment? Login or Register an account!