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!
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!