Download

Looking for data table advice

I am currently working on making an npc shop for an rpg game. I have all my items imported from a csv file into a data table. This has been working out great so far.

What I want to do is have an npc that can sell items to the player. However I want to limit the items the npc can sell to the player at given points. My first idea was to have a column in the spreadsheet for tiers. That way if the player can only have access to tier 1 items right now, the npc won’t offer tier 2, 3, etc.

The issue I was having is that the only way I can reference things from the data table is by row name. Is there a way to search the table by a different column? Where I could do a for loop and grab every item where tier = 1? Or if you have any ideas on the best way to handle this I’m open for anything.

Thanks
Snackmix

Here I spawn the object of the class providing the data table contains a specific entry. You could hold an integer there, or an enumerator which you can reuse as a string…
This will essentially create a filtered result.

c81614c8d8a9f857eba4158e1f7f6746a5b05c89.jpeg

Does it make sense?

Actually that makes perfect sense. Kind of feel silly for not thinking of that. Thanks a lot!