Tracking Shop Item Details

It’s my first time building a shop to sell items in my game. In order to store important information about my items, I’m creating a Configurations file in my server storage. How I keep track of the details is as such:

ItemConfigurations.ITEM_DETAILS = {
    ["ITEM0001"] = {
        ["Name"] = "Item1",
        ["Price"] = 30,
        ["Picture"] = 6344756217,
        ...
    },
    ["ITEM0002"] = {
        ["Name"] = "Item2",
        ["Price"] = 30,
        ["Picture"] = 6344756218,
        ...
    },
    ["ITEM0003"] = {
        ["Name"] = "Item3",
        ["Price"] = 30,
        ["Picture"] = 6344756219,
        ...
    }
}

As I add more items to my shop, the dictionary gets longer and it’s getting harder to track the details. Is there a better way to track these details?

I’ve actually committed pretty hard to the pitfall of an ever-growing dictionary to contain item data in my game. Things started getting really inefficient after the 8,000th line. :upside_down_face: dodge this bullet while you can!

If I were you, I would figure out how to group items into “classes” of items, and create separate modules for them. Then, create one master module that requires and assembles all of them into one large catch-all table. This way it will be simple to keep track of potentially thousands of unique items without having to search very long at all.

1 Like

That’s a great idea! thanks for sharing