Just a temporary thing, inventory screen will look more baggy in the future.
But anyhoo, I’m trying to make an inventory system where the player can place items in any way they want in this screen, doing it visually’s easy, I made a bunch of points on the object, and I just have the game check for the closest one once the player stops dragging their item.
But I’m having trouble figuring out how to have the game place the item’s information into the appropriate child variable in the inventory structure.
The structure variable is currently just one structure, with 32 children, for each slot.
Although I am thinking of having a structure with 4 children, with 8 children for each of those. (4x8 being 32 of course.)
And the info they have is, their name in variable form, and what type of item it is.
Also, looking into how I worded my post, and what I’m looking for is specifically:
If the player clicks and drags their item to slot 22(3rd from the right on the 3rd row), I don’t know how to have the game put the item into the ‘slot22’ child variable.
Ok, let’s start (because probably we’ll have to discuss), check this: InventoryPosition.zip (7.55 KB)
It gets the item number (for example 21, i.e. the slot 22) from the position X; Y (for example 5; 2) and the number of columns (in your case 8).
How do you get the closest point to place the item? (what system do you use?, which information do you finally get?)
Since you cannot access points through dynamic expressions I had to make all those “maths”, but it would be impossible if the slots were not “homogeneous” as the 8x3 grid in the bottom