x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

Way to manage items.

Sorry for the vague title. I don't know how to phrase it correctly...

I'm looking for some help on ways to manage items the player has on hand, and has in storage.

There are lots of tems/equipment, and they all have various characteristics, some unique some common, like:

  1. Name

  2. Type (feet equipment, leg equipment, torso equipment, torso+leg equipment, weapon, right/left hand equipment, )

  3. Amount

  4. Equipped (whether it's equipped or
    not)

  5. Value (amount of money it can be sold for, varies by location)

  6. Price (amount of money it can be bought for, varies by location)

  7. Visibility

  8. 2D image

  9. 3D model

Right now all the different types are all lumped into the same arrays (Items_on_hand, items_in_storage) where the index serves as the Type identifier and value is the amount. I have a Name, 2d image, price, value, array (in global game vars) where all their respective values are matched by index. It's really easy to save the player's inventory with this system, because I need only save 2 arrays (on_hand, and in_storage).

But now that I've started implementing an item equip screen (wanting to make it so only certain items can be equipped to certain slots), and I'm finding this was perhaps a stupid way to do it.

Anyone know of any tutorials I could look at that might help streamline my item management?

I was thinking, maybe I should have created 1 single actor with a bunch of variables (i.e. type, amount, value, price, etc.) in it?

Thanks in advance for any help or suggestions in these regards.

Product Version: UE 4.14
Tags:
more ▼

asked Jan 20 '17 at 02:18 AM in Blueprint Scripting

avatar image

kusokuso1
352 35 38 58

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

1 answer: sort voted first

Your idea of creating a single actor "with a bunch of variables" seems logical.

An Item actor could hold variables pertinent to every item. Should more specific variables be needed, add then to a derived actor (eg. only weapons would have a damage variable).

Then just make those arrays hold Item actors and you should be good to go.

more ▼

answered Jan 20 '17 at 09:16 AM

avatar image

blkhouse_vlucki
185 5 8 14

avatar image kusokuso1 Jan 25 '17 at 08:02 AM

Thanks for the help blkhouse_vlucki. I never thought about just straight out saving an array of Item Actors. Likely because "actor" brings to mind something that takes up a more than 1 meg of space; so an array of 25 item actors would make the save data way too big. hehe

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question