Update 2
Well, It's been a little while since I've said anything about this. A recent post by twisterghost made me realize that taking longer in between updates will most definitely make me lose interest in working on this. So, here's an update on what I've added and how It's changed:I've added an inventory and slight AI to the enemies. (Still haven't given them the simple ability to attack you though. lol)You're now able to pick up items and put them in your inventory.You're able to stack items.You can use potions while they're in your inventory as well.Unfortunately, since I haven't started on the equipment system yet, there's no equipment slot to put your spellbook in to equip it.DownloadHere are the new controls:Left mouse button to attack when spellbook is equipped.Press E while mousing over spellbook you want to equip.Press Q to open and close your inventory.Press left mouse button to grab items and put them in Inventory. (They have to be close enough to pick them up and put them back on the ground. You can tell by how they glow.)Press the right mouse button when you have a potion grabbed and and hovering over the same type of potion to combine stacks.Press enter to create enemies where mouse is. (Testing thing, but still fun to kill stuff since I gave myself a whole bunch of mana to mess around with)Press space to name your character.And Press E to unequip the spellbook/ exchange it with another. (The spellbook you want to exchange with has to be within reachable distance. Also if you just want to equip it, the mouse also has to be within reachable distance.)Update 1This is a sort of RPG.. thingy I've started working on. After I figured out how to do delta time (finally, right?), I decided to continue working on this.Let me know what you think.DownloadControls:Right Click: Pickup the Spell BookRight Click and Shift: Drop the Spell BookLeft Click: If you have the Spell Book, you can use it.Enter: Make a Slime Guy Enemy
Well, it finally happened. I finally figured out how to do something I thought was impossible for me. (Although it might seem absurd to anyone else. lol)I was working on an engine for my games, and I finally overcame the biggest hurdle I've wanted to overcome so far in my game creation "career".Here's what I have so far. Can you guess what I was able to do?If not, I'll just tell you guys in the comments. lol:D
Adventure Guy Time?
New update! More in blog post.
DownloadPlayed it, I did enjoy it. The drawing needs to be fixed though (ex: enemies and sometimes the spell book was drawn over the GUI).
Can't wait to see progress. :)Also, what was the game made in? (I want to assume C++ or GML, but who knows?)It was made in Game Maker, yes. And yeah, I'm having a bit of trouble with the depth of some things because of the way I decided to make an inventory. :(
I wonder how everyone else does it. :/Pretty good start. The way interactables and enemies are highlighted is nice, and it looks like the inventory works most of the time. Also shooting things and the blobs screaming when they die yes good.
I did notice that the inventory seems to eat items sometimes though, and I'm…not sure how that's happening? If it's a depth thing, you should just be able to draw the item sprite over whatever GUI back is there already (I would think anyway - idk how your inventory system works though).I probably did the inventory system the worst way possible. I essentially tell the objects you pick up to stay where you put them on the inventory. They're all still there, just following that part of the view.
When I hide the inventory, I make them all move to a part of the screen where they can hide until you pull up the inventory again.I don't even think there's a way to do automatic looting and stacking with the system I created. :(You have to do it all with the mouse.I would love to do inventories how the Elder Scrolls games do it. In those games, anything can have an inventory. I'm pretty sure that's beyond my capabilities though.I haven't used GM in forever, but to fix the depth thang. You should prolly plan out what objects have what depths / have a global variable to help you with the depths. It's pretty simple once you plan it out and such. I remember doing such a thing in my Tower Defense (back when, the source is in my examples (check it out *nudge*)).
Inventories are hard, man. But here's what I recommend.
If you're afraid of arrays and loops, don't be. Arrays (or data structures) are essential to an inventory system as they allow you to cycle through and perform the most basic of operations. Displaying should be done after you generate a list.What I usually do is:- Prepare a separate 2D array with item ID as the first index, and keep the secondary index for useful things like name, description, damage value, and so on- Have a 1D array to represent your slots in your inventory, or use a ds_list if you want it to be infinite- Handling item stacks gets to be difficult unless you specify the max stack somewhere- Display and operate on via for loopsI have, however, run into issues with GM (namely the inability to pass arrays to scripts as well as not being able to return arrays or use pointers and dereferencing), but using this method, you could theoretically generate a separate inventory for several objects, provided you're not using global values. If you need to hold inventory through screens though, then yes, things will get tricky.Wouldn't it be awesome to have something like this?:
draw_set_depth(4);draw_sprite(sprite_index,-1,x,y);draw_set_depth(0);That'd sure come in handy to me.On an unrelated note, I beat Tiny Tina's Assault on Dragons Keep a few minutes ago. Freakin Good. Was genuinely surprised at the end there. lol