A downloadable asset pack

Download NowName your own price

An easy-to-use and modular inventory system that you can use for anything!

Game Maker version 1.4 Complete

Download

Download NowName your own price

Click download now to get access to the following files:

Inventory3.0.zip 75 kB
Inventory.gmx.zip 4.3 MB

Comments

Log in with itch.io to leave a comment.

(8 edits)

Ok. I've played with this a bit. VERY NICE example. :) Here is some feedback:

(1) ERROR:

If we quickly click-n-drag a stack or item, we get this error (This usually happens when items are dropped ontop of the slots, and then if we click item, the slot and item get crossed signals. Perhaps make it so any dropped items do not spawn atop the slots.):

### ERROR in action number 1

### of Mouse Event for Left Pressed for object o_inv_slot:

### Variable o_inv_slot.SlotSave(100010, -2147483648) not set before reading it. at gml_Script_InstanceItem (line 16) -    _createValue.SlotSensore = other.SlotSave;

### gml_Script_InstanceItem (line 16)

### gml_Object_o_inv_slot_Mouse_4 (line 4) -        InstanceItem(other, x, y, "HUD", o_grap_item);

#######################################

ERROR 2:

So this happens when we change: item_index = 19; I don't understand what this item_index is for. I have tried using ID for the #, but that fails as well. If we have the SAME # for multiple items (eg 4) then all items go to the same slot. Naturally we will have hundreds of inventory items in our games - so I don't understand how to use this item_index. Is there a video tutorial? Manual? How can we increase a inventory item limit for hundreds of items? Also, we cannot MANUALLY keep numbering them - we need a way to auto-assign these numbers in the scripts. They should simply match the "item name" and slot in same slot, otherwise next slot.

ERROR in action number 1

of Mouse Event for Left Pressed for object o_item_carrot:

Push :: Execution Error - Variable Index [19] out of range [10] - -6.item(100020,19)

 at gml_Script_ItemAddSlot (line 7) -                                    if (item[_itemIndex] = true){

gml_Script_ItemAddSlot (line 7)

gml_Object_o_item_carrot_Mouse_4 (line 1) - ItemAddSlot(item_index);

###################################

(2) There seems to be no upper limit on STACKS. I tested this to 4000+ items. Please declare variables in the CREATE event for each item/bag/container. That way we can custom define stack size, how many slots, how wide, how tall, what dimensions, etc.

(3) The ability to SPLIT stacks is needed. ie Select, press X, stack splits into 2. If there is space, they will occupy 2 slots. If there is not enough space, they will occupy what they can, and the rest can be dropped outside the bag.

(4) MERGE stacks. Same as (3) but opposite.

(5) MULTIPLE BAGS on the screen (different sizes and capacities).If we try to reuse your code for making different bags on the same screen - we get "ghost" item errors. :(

(6) Dragable bags. So we can move our bags about. Has ANCHOR or TOP LABEL to drag with.

(5) BAG system for crafting. ie A Definable Crafting table (basically a bag with specified slots). Slot0 == "recipe". Slot1 == ingredientType1, Slot2 == ingredientType2, Slot3 == ingredientType3, Slot4 = Resulting output. //Various types can be defined in the CREATE event and in each item.

(6) SHOPKEEPER Bag with items for SALE. Our BAG with our items. We drag and drop in middle BAG to complete sales and purchase. etc.

(7) Items to be picked up by PLAYER when colliding with items in the WORLD. The items automatically end up inside the inventory bags (if not full).

(8) When dropping items, the option to drop items in a different room via controller (eg we drop item vis RMB in the EQUIPMENT ROOM -> The items then drop in the WORLD room, after we LEAVE the EQUIPMENT ROOM.)

AND The ability to auto-send items to "bags" (ie different room/EQUIPMENT room) when colliding in the WORLD room. 

(9) Oh and Multiple TABS, for large bag sizes! [1][2][3][4][5]... OR Unlimited SCROLLING via scrollbar!! :)

(10) IMPORTANT: Self-Explainatory VARIABLE NAMES. names like xx, yy, aa, aA, ab, Sj, is not easy for users to understand the logic of what is going where etc. Please name vars so they are easily human-readable and understandable.

(11) Please COMMENT EVERYTHING. No matter how insignificant. Let us know what each section is doing.

Many thanks. :)