- Home /
Inventory system. Set multiple values/layers to one variable.
Hey guys. My question may be a little hard to understand and/or far-fetched, but here it is. In my game, I'm working on creating an inventory system that stores values for each slot in the inventory. However, because there are many slots, I don't want to create a new variable for each one. I am sort of a beginner to programming, and don't know a way to do this. I was looking for something to allow me to, say, create one variable called "Items" and be able to assign 12 variables for each slot. Something like:
Items(1) = 2 //Pistol magazine
Items(2) = 7 //Soda Can
This may not be possible, but if it is please tell me. Also, if there is a better way to store so many values, I'd love to here it.
Comment