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:
-
Name
-
Type (feet equipment, leg equipment,
torso equipment, torso+leg
equipment, weapon, right/left
hand equipment, ) -
Amount
-
Equipped (whether it’s equipped or
not) -
Value (amount of money it can be sold for, varies by location)
-
Price (amount of money it can be bought for, varies by location)
-
Visibility
-
2D image
-
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 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 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.