RPG inventory system

This forum is currently in read-only mode.
From the Asset Store
Advanced inventory mechanics for your RPG game (Array-based). Take Items, split them, pick up them, read the description
  • Hello,

    In my game player's progress is stored in the hash. We've got there statistics and decisions player made. There are 10 inventory slots named as ItemSlot-x, where x is nuber of a slot. Item-slot-x stores string - name of the item, which is used to reffer to hash values containing info about item. For example: Player gets a pipe, simplest weapon. ItemSlot-1 contains "Pipe". When player attacks, game reffers to newly created hash values: Item-Pipe-AttackBonus, Item-Pipe-Strenght and Item-Pipe-WhiteW (as players with special skill uses white weapons better than others), so yes, it's like Item-[value of ItemSlot-1]-SpecifiedStat

    The question is: how to write down all the statistics of an item on the inventory screen or delete all of Item-Pipe-* values along with the item? You see, they cannot be constant, as there is "handyman" skill which can upgrade some items.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • The examples in this thread might help you out.

    Not sure I really understand your problem from your post, but I believe the examples will help.

    If I do understand it...I don't see a good reason to store the item powers and other stats in a hashtable. It makes more sense to store those in an array or to just compute them all on the fly. You could have a base array with all the default values for the item, # items, power, weight, attack bonus, etc. Then you could use the hash table to store the name of the item and the value would hold the index to the array. To delete an item you simply remove it from the hashtable. I did something similar in the Mikeys Adventure tutorial part 5:

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)