Jump to content


This topic is now archived and is closed to further replies.


Modification To ONE Entry When Multiples Exist?

Recommended Posts

In my game I have several tables of different decks of cards. Now, some of these cards are duplicated in the deck (items, spells, etc.) and each card has a unique \'cardid\' entry in the table.


Now, if a player achieves a spell, and the deck has 3 copies of the same spell (and they have separate unique cardid\'s), all 3 entries are tagged as drawn by the player - where it should only tag one of them, freeing the other two entries to be drawn by other players.


The Table search is done based on the Spell NAME (not the cardid) so that I have the ability to add more spells in the future.


How do I tag just ONE instance of the card in the DB instead of ALL of them?


Thanks! :)

Share this post

Link to post
Share on other sites

Not sure if this is a good approach, but...


You could add a prefix to the Card Name i.e.


A Stinky Spell

B Stinky Spell

C Stinky Spell


Then Parse the first part of the Card Name before displaying it. This way you\'ll know which one to tag as being drawn.


Another idea might be to add a column to the table for use by cards that are duplicates and throw A, B and C into the coressponding columns. Use that as a foreign key when tagging the cards as being drawn.


Both solutions imply a little more work, which is why I\'m not sure that either will work in your situation. Just some ideas for you to think about.


Hope this helps,


Share this post

Link to post
Share on other sites


Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.