I was locked away for several nights, delving into the arcane workings of a dynamic inventory. And I succeeded. In C++ it would've been a lot easier (Polymorphism, better primitive data-structures, speed).
This is what I managed to do:It's fully functional, and any item I create that is a child of obj_baseitem can be picked up/examined/used/eaten/drunken/dropped/thrown.As for the key-layout, I'm using an approximation of Roguelike controls, and relying as little as possible on the mouse (I hate using the mouse for an RPG myself, though I give exception to Morrowind.)Coming soon: Player status Window.GM8.1 stuffI got GM 8.1 Lite. Don't want to get Standard. Can't afford it :PAnyway, it's got it's good points, and I love the zoom feature for rooms, but… it's not quite enough to change me over permanently.GM 8 Pro is still fine for my needs.Also, my internet connection will be intermittent at best, so expect progress updates anytime between now and next month :PQUICK UPDATEI did a few things, like sticking the information-boxes at the top-left of the screen (Don't worry, the font is temporary.), and I changed the UI color.Also, as mentioned in my latest comment, I added more keyboard commands.
Looking good.
If you have GM8 Pro you can upgrade for free.
http://gamemakerblog.com/2011/04/15/upgrading-game-maker-8-to-gamemaker-8-1/Inventory systems aren't TOO bad. They're a pain at first, but also one of those things that make you feel great when you get them finished.
I just use a 1D array for the inventory slots, a 2D array for item data (name, item type, cost, etc), and a ds_map to check if the item is currently in the inventory so it can be stacked.The game looks great so far.i have gm7 so i cant upgrade :(
sexy screenshot
Can we make him a blocky model?
This looks really epic.
How did you implement the inventory system (aka MOAR TECH SPECS!)?MOAR TECH SPECS? YOU ASKED FOR IT…
Nah, just kidding; not that bad.I used an array that's part of the game-control object called vInvSlots, which has 20 elements. (I use the letters v, my, and f for variables in GM. Helps me to spot them later.).Each one of these slots contains either the integer value 0, or an instance ID (Fetched when an inventory item is created). I have a script to handle adding and removing inventory items (Checks for available ID, etc, returns ID to 0 if removed, etc).The inventory system expects some variables to be in the item, so I use inheritance for that.Scott_AW: No. Not in GM. Unless I find myself with lots of time and a heap of graphing paper, or the patience to make a simple geometry editor.Tooltips were blocking the view of the HUD, so I made them all display at the top-left of the screen now.Also, I just finished the item-use keys.The keys are u (Use), q (Quaff/Drink), e (Eat) and D (Drop). The stats are also finished, and they also use a simple array (With 9 elements. Contains the Level and XP of the player as well).lol i dont think GM is all that bad with Inventories. it's just how the programmer codes. i made 3 different inventory systems fairly easily. i think that type of system is too common for me to use. i go with a traditional CAN ONLY HOLD 10 ITEMS PER PERSON deal lol (at least that's what i'm working with atm) i also take weight into account cause i love realism mixed with pointless fantasy!
still pretty neat. are you gonna be able to hold # of items in a slot? other wise it might be a little difficult =PNope. Only ONE ITEM PER SLOT. Not for any particular reason besides the fact that the Roguelikes I play do that. :P