Inventory system

Screen Shot 2017-02-07 at 17.58.38.png

Screen Shot 2017-02-07 at 17.46.52.pngThe inventory for this game is one of the more complex features it has, it allows the player to pick up items as well as view them within the inventory.

Below is the basic structure of the inventory system, I am planning later to stylize it more, but at the moment I have got the basic version.  Within the boxes are several layers of scrollbars and text boxes so the items won’t stack on top of each other.

Next, I simply needed a button to open up the inventory, within the input settings I created a function called “openInv” and set the key to ‘I’ Within the player character blueprint all I needed to do was connect this function to the inventory widget. Screen Shot 2017-02-07 at 18.04.05.png

Another function was created which made the ‘E’ button a pickup function. After this, I needed to work on how the player will pick up items. I set the reference to the player character at first but changed it to the player cursor, this means that the player can click on an item with the mouse and pick it up.

A variable needed to be made before the rest in order to judge how far away the player can be in order to pick up an item, which can be modified at any time. To pick up the items I used a function which traced actors with lines, then when they come into contact the actor is destroyed.  Screen Shot 2017-02-07 at 18.12.22.pngThe actor would be added into the inventory widget after interaction and a sound will be played.Screen Shot 2017-02-07 at 18.12.28.pngBelow is the code which destroys the actor and adds into the inventory. Also what lets me view the item name and descriptions. The items would be added into a separate widget that displays the clickable items as seen in the bottom two blueprints, this is to stop the items from stacking or deleting themselves.Screen Shot 2017-02-07 at 18.03.00.pngScreen Shot 2017-02-07 at 17.58.38.pngScreen Shot 2017-02-07 at 17.58.42.png

I used actors as pick up items within my game, this is because they are easily duplicated and changed. I had to first create a master item and then create children out of that one.Screen Shot 2017-02-07 at 18.29.32.pngBelow is the finished result, as you can see a note has appeared within the inventory box, and when clicked it opens up with an image as well as a description that is changeable within the actor blueprints.

Screen Shot 2017-02-07 at 18.28.52.png

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s