GameMaker Studio 2 Desktop

GameMaker Studio 2 Desktop

Smiles Dec 2, 2023 @ 12:32pm
Diablo-esc Inventory System Help.
I'm working on a prototype for an old school Diablo type game and despite my searching the very few yet free and somewhat functioning resources primary tutorials. Could anyone give a hand by pointing me in a good direction to find Both Free and Functioning resources that could teach me how to code such a system. Mind you; if you're gonna post an old Tutorial, I have already most certainly seen it as well as the fact it may not even function properly as i said my search bore no fruit.
< >
Showing 1-2 of 2 comments
Blind Dec 2, 2023 @ 4:12pm 
I can't think of a tutorial off-hand, but here's a short-hand way to do it.

- First make a grid GUI/box for your inventory so that you have a visual idea where your items should go.

- Make a generic universal object for each possible size of object (1x1, 1x2, 2x2, etc).

- add controls so you can click and drag these objects

- while the inventory is open, here's the trick: do a collision detection to see if you can place an object using the snap_grid feature. If your object snap_grid'd doesn't collide with any other object then allow placement of it when releasing left click (or whatever). If your object snap_grid'd does collide, give it a grey or red tint.

- When an object is placed in the inventory, snap_grid it so it actually fits in the inventory

- when you close the inventory, move the ENTIRE inventory bag/whatever something like 30'000 units off screen. This saves time in having to destroy/create the inventory all the time. When you open the inventory just move it back 30'000 or whatever units so that it's in front of you again.

- whenever you pick up a new item and the inventory is closed, do a singular pass of all squares in the inventory to see if there's empty space and attempt to put the item there once... if it doesn't fit, do a 'i can't carry this right now' voice line or whatever
Smiles Dec 2, 2023 @ 4:18pm 
I do have an inventory set up that mostly works by using the method GameMaker Rob's tutorial provided, I just don't have the other major half of the inventory, such as armor/gear equipping, It occurs to me i should have specified that now as im typing this.
< >
Showing 1-2 of 2 comments
Per page: 1530 50