Jump to content

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! :)

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,

Andrew

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

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.