Announcement

Collapse
No announcement yet.

Looking for data table advice

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    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

    #2
    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.

    Click image for larger version

Name:	Untitled.jpg
Views:	1
Size:	221.0 KB
ID:	1102416

    Does it make sense?

    Comment


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

      Comment

      Working...
      X