Simple Inventory System Example

I recently made a very simple inventory system as a proof of concept, and thought I would pass it on.  It's worth stressing this is a VERY SIMPLE system. If you want much functionality beyond what's here you'll probably be better off using JavaScript.

Inventory System in action

The system uses a button for each type of item in the inventory (you can have multiple items, like two or three flasks of water). Buttons for inventory items the user doesn't have are disabled. 

Each type of item has an associated variable, and there is also an inventory variable that tracks the total number of items in inventory.  I was eventually going to program an error layer that would show if the player tried to add more than ten items to the inventory, but the client's needs changed so we aren't using Storyline after all.

Players can use an inventory item by clicking the button, which removes the item from inventory.  New items are acquired by clicking buttons throughout the game.  Each button click changes the item type variable, and also changes the inventory tracker variable.

Once again, it's VERY trigger hungry, so this might not be the best way to meet your needs. 

Have fun!

 

1 Reply