[Resource] Please Break/Test/MakeUseOf my "Simpler Inventory System!"

I made this system as a way to give something back to this forum. I hope it helps some people make great games!

Take some stress out of creating a new game by already having a functioning weapon/armor (or weapon/clothing) system.

This is the first round, so I’d like people to test it and see if they can break it or find bugs! It shouldn’t be possible as of now, but I might have missed something major right before uploading, so let me know! :slight_smile:

Features:

  • Inventory System
  • Item Slot System
  • Shop system (with currency and item selling)
  • Dual Wielding
  • Two-handed weapons
  • Shields for off-hand
  • Support for lefties (if you select left-handed, your “right” hand will hold your secondary weapon!)
Details

This inventory specifically manages weapons and armors. “Armors” could just be clothes if you like. It doesn’t have to be medieval/fantasy, it could be mundane or sci-fi. It supports shields and two-handed weapons as well.

In the example there is a head slot, body slot, leg slot, and left/right hand slots. You can add as many slots as you wish, but there are some special instructions. See the _INSTRUCTIONS.docx file included in the .zip.

It is not meant for unequippable items; that kind of inventory can be made separate (example: money, ammunition, potions, herbs, ingredients, etc.) so that you can carry multiples.

It also does NOT have stats such as strength or dexterity; these are all specific to the type of game you are making. It is not a combat system, either. You can integrate the damage_total and armor_total values however you want, though.


Let me know if you find a bug or have any questions, or any suggestions on features to add! I did not want to add too much because I wanted it to be barebones and modifiable to use in addition to your own systems.

I think one thing I need to add is the ability to pick up an item that doesn’t have a “slot” so keep an eye out for that. If I make any changes they will have the same link.

Here’s the link to try the sample:
http://choiceofbox.com/SimpleInventory/web/mygame/SimpleInventoryDemo.html

Here’s the link to the .zip archive with all the codes and more detailed instructions:

For Spaces instead of Tabs users:
Here’s the link to the .zip archive with SPACES instead of TABS!

I have been working with @Lordirish to find bugs, and he has kindly agreed to host the example, so thank you to him!

I’ll be happy to help you get this up and running in your own game if you need help. There are some ferocious variable calculations in here.

**

EDIT: Hey guys I’m adding this as an additional tool, it’s a more complex “weight-based” inventory system, let me know if there are any bugs!

**

Thanks everyone!

12 Likes

I really loving it and adapting to my battle system :smile:

2 Likes

Sounds useful, but I’m squeamish with code. I might try this in my WIP.

3 Likes

It’s a little complicated, but the goal is to be able to do just that :slight_smile:

1 Like

I am very bad at higher function CS but there are pretty clear direction and Once I got going it is was not bad at all. To be honest I still struggle a little bit with it but worth the effort as the shop system is really great. Plus finding help on the forum is always easy. :smile:

some games already have inventory systems

also what is the use of a item slot in a interactive novel when you just go to show stats screen to see what you have in inventory.
I may be confused on the item slot system concept but when I think of item slot i think of item slots where you press 1,2,3,4,… to equip items.

1 Like

From my point of view I am working on an RPG style type game, this makes it easy to track items and have stores with versatile lists the player can stop and shop at. Most RPG wips I see require some type of inventory system this puts a very nice package gather for these type of games with the inventory code at its core, plus I am able to adapt to a very complex battle system for my own game. There have been many great RPG wips over the years I have seen fade away because they did not have the inventory system or other lacking tools in their game. I am always excited to see any code that comes out to help writers develop their game to its full potential. :smile:

I’ll actually probably use this in my current WIP.

Of course, the thought of having to jostle around nearly 2k lines of code on the stats screen (I assume this is stats screen–I haven’t fully looked at it yet) to put it in is…daunting.

So…

much…

indent…

editing…

1 Like

Once I grasped how it worked it really not a lot to move around more just add the list of items you want in the game, plus if you need you can add functions to the list make this very expandable, a little bit harder but still very do able.

1 Like

Oh I’m sure it is.

I just really abhor going through all my lines of code and adding the indentation.

I always end up somehow missing a line, no matter how anal I am about it. Ugh.

What do you mean? Are you using spaces as I know he use tab but I change that fairly quickly within Notepad ++ as I use spaces myself.

It’s more just me griping about the additional three minutes of work than anything else LOL

I prefer to use spaces.

If I were to put it in towards the top (which is where I would have to, considering the formatting of my stats screen), I’ll have to go back through and edit every line by at least one space LOL

I’m just lazy.

1 Like

I can understand that lol. :wink:

1 Like

LordIrish prefers spaces too. I find it harder to read, but I can make a version with spaces. I’ll ping you when it’s done, but I won’t be able to get to it tonight.

2 Likes

Oh, wow! No need to go to all that trouble.

I really was just griping for the sake of griping LOL

I think this is a supremely awesome tool. :smiley: And, like I mentioned before, almost 100% chance I’ll be using it. My game isn’t too RPG-ish, but I prefer this inventory systems to some of the others that people have created. :blush:

2 Likes

Actually, I just did a find and replace on all the documents just now. It’s done! Here’s the file with SPACES but not TABS :slight_smile:

3 Likes

How does this differ from @CJW’s inventory system?

I have my own weight-based player inventory system that I wrote a few years back utilizing faux arrays, but I kept it simple, and never adapted it to allow for multiple objects/stores, each with their own separate inventories.

2 Likes

I think those are akin to quickslots on MMOs. This is more like a weapon/armor inventory system, you will still want to have your own inventory for things like quest items, that you don’t want to “accidentally destroy” or just be able to set a variable for, like “hasquestitem1 true”

It’s useful if you want to dress your character, or make use of weapon/armor damage, but not necessarily for picking up herbs and things.

1 Like

This allows you to create individual item stats, such as armor value or prices, and then it auto-adjusts throughout your game. Instead of just listing your inventory as “this and this and this and this” it’s actually got a slot for each wearable item.

But you’ll want something like CJW’s system for quest items or “unequippable” items, like ammunition, potions, tools, etc. :slight_smile: if you make use of that!

2 Likes

It’s not that, it’s a shorthand for a coding concept - where to store data. :slight_smile: The player will never see this kind of slot. Instead they’ll see:

Inventory: Bow, staff, small interesting mushroom
or

Inventory:
Bow
Staff
small interesting mushroom

Whoever’s coding it needs to make sure the Staff doesn’t get saved over the Bow when you pick it up, so you need to remember how many things the player has (possibly sorted by categories), save them to slots there, and display them as needed.

2 Likes